cproject.el plugin cleaned
This commit is contained in:
parent
5a6d720ca6
commit
d39b8763d6
|
@ -1,4 +1,4 @@
|
||||||
;; Shit - My personal emacs IDE configuration
|
;; Kuso - My personal emacs IDE
|
||||||
;; Copyright (C) 2010 Sameer Rahmani <lxsameer@gnu.org>
|
;; Copyright (C) 2010 Sameer Rahmani <lxsameer@gnu.org>
|
||||||
;;
|
;;
|
||||||
;; This program is free software: you can redistribute it and/or modify
|
;; This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -14,50 +14,50 @@
|
||||||
;; You should have received a copy of the GNU General Public License
|
;; You should have received a copy of the GNU General Public License
|
||||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
;; C project plugin for Shit IDE
|
;; C project plugin for Kuso IDE
|
||||||
|
|
||||||
|
|
||||||
;; -------------------------------------------------------------------
|
;; -------------------------------------------------------------------
|
||||||
;; Hooks
|
;; Hooks
|
||||||
;; -------------------------------------------------------------------
|
;; -------------------------------------------------------------------
|
||||||
(defvar shit-cplug-preinit-hook '()
|
(defvar kuso-cplug-preinit-hook '()
|
||||||
"This hook runs before initializing the Shit c-plugin minor mode."
|
"This hook runs before initializing the Kuso c-plugin minor mode."
|
||||||
)
|
)
|
||||||
|
|
||||||
(defvar shit-cplug-postinit-hook '()
|
(defvar kuso-cplug-postinit-hook '()
|
||||||
"This hook runs after Shit c-plugin minor mode initialized."
|
"This hook runs after Kuso c-plugin minor mode initialized."
|
||||||
)
|
)
|
||||||
|
|
||||||
(defvar shit-cplug-prerm--hook '()
|
(defvar kuso-cplug-prerm--hook '()
|
||||||
"This hook runs before deactivating Shit c-plugin minor mode."
|
"This hook runs before deactivating Kuso c-plugin minor mode."
|
||||||
)
|
)
|
||||||
|
|
||||||
(defvar shit-cplug-postrm-hook '()
|
(defvar kuso-cplug-postrm-hook '()
|
||||||
"This hook runs after Shit c-plugin minor mode deactivated."
|
"This hook runs after Kuso c-plugin minor mode deactivated."
|
||||||
)
|
)
|
||||||
|
|
||||||
;; ---------------------------------------------------------------------
|
;; ---------------------------------------------------------------------
|
||||||
;; Keymaps
|
;; Keymaps
|
||||||
;; ---------------------------------------------------------------------
|
;; ---------------------------------------------------------------------
|
||||||
(defvar shit-cplugin-map (make-sparse-keymap)
|
(defvar kuso-cplugin-map (make-sparse-keymap)
|
||||||
"Default keymap for Shit c-plugin minor mode that hold the global key
|
"Default keymap for Kuso c-plugin minor mode that hold the global key
|
||||||
binding for Shit IDE C projects section."
|
binding for Kuso IDE C projects section."
|
||||||
)
|
)
|
||||||
|
|
||||||
;; ---------------------------------------------------------------------
|
;; ---------------------------------------------------------------------
|
||||||
;; Groups
|
;; Groups
|
||||||
;; ---------------------------------------------------------------------
|
;; ---------------------------------------------------------------------
|
||||||
(defgroup shit-cplugin nil
|
(defgroup kuso-cplugin nil
|
||||||
"This group contains all the optional components of Shit IDE C plugin."
|
"This group contains all the optional components of Kuso IDE C plugin."
|
||||||
:group 'shit-group
|
:group 'kuso-group
|
||||||
)
|
)
|
||||||
|
|
||||||
;; ---------------------------------------------------------------------
|
;; ---------------------------------------------------------------------
|
||||||
;; Custom Variables
|
;; Custom Variables
|
||||||
;; ---------------------------------------------------------------------
|
;; ---------------------------------------------------------------------
|
||||||
(defcustom c-plugin t
|
(defcustom c-plugin t
|
||||||
"ShitIDE C programming language plugin."
|
"KusoIDE C programming language plugin."
|
||||||
:group 'shit-features
|
:group 'kuso-features
|
||||||
:type 'boolean
|
:type 'boolean
|
||||||
:tag '"C Plugin")
|
:tag '"C Plugin")
|
||||||
|
|
||||||
|
@ -80,14 +80,14 @@ binding for Shit IDE C projects section."
|
||||||
|
|
||||||
(define-key global-map [menu-bar file new-proj cproj separator1] '("--"))
|
(define-key global-map [menu-bar file new-proj cproj separator1] '("--"))
|
||||||
|
|
||||||
(define-key shit-map (kbd "\C-x n \C-c") 'generic-cpp)
|
(define-key kuso-map (kbd "\C-x n \C-c") 'generic-cpp)
|
||||||
(define-key global-map [menu-bar file new-proj cproj cppgeneric] '("Generic project (C++)" . generic-cpp))
|
(define-key global-map [menu-bar file new-proj cproj cppgeneric] '("Generic project (C++)" . generic-cpp))
|
||||||
|
|
||||||
|
|
||||||
(define-key global-map (kbd "\C-x n c") 'generic-c)
|
(define-key global-map (kbd "\C-x n c") 'generic-c)
|
||||||
(define-key global-map [menu-bar file new-proj cproj cgeneric] '("Generic project (C)" . generic-c))
|
(define-key global-map [menu-bar file new-proj cproj cgeneric] '("Generic project (C)" . generic-c))
|
||||||
)
|
)
|
||||||
;; Thsi function exists because maybe SHIT needs more information
|
;; Thsi function exists because maybe Kuso needs more information
|
||||||
;; about new project in the feature the new-prject function did not
|
;; about new project in the feature the new-prject function did not
|
||||||
;; cover
|
;; cover
|
||||||
(defun c-new-project () "Create a new C/C++ project"
|
(defun c-new-project () "Create a new C/C++ project"
|
||||||
|
@ -126,14 +126,14 @@ binding for Shit IDE C projects section."
|
||||||
)
|
)
|
||||||
|
|
||||||
(defun init-main-menu ()
|
(defun init-main-menu ()
|
||||||
"Initialize the C plugin menu under Shit menus."
|
"Initialize the C plugin menu under Kuso menus."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
(defun initial-keymap ()
|
(defun initial-keymap ()
|
||||||
"Set the key binding for C project."
|
"Set the key binding for C project."
|
||||||
(define-key shit-cpluging-map (kbd "\C-c \C-c") 'compile)
|
(define-key kuso-cpluging-map (kbd "\C-c \C-c") 'compile)
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Initializing c menus at the load time
|
;; Initializing c menus at the load time
|
||||||
|
@ -142,29 +142,29 @@ binding for Shit IDE C projects section."
|
||||||
;; ----------------------------------------------------------------------
|
;; ----------------------------------------------------------------------
|
||||||
;; Minor Modes
|
;; Minor Modes
|
||||||
;; ----------------------------------------------------------------------
|
;; ----------------------------------------------------------------------
|
||||||
(define-minor-mode shit-cplugin-mode
|
(define-minor-mode kuso-cplugin-mode
|
||||||
"Toggle Shit C plugin mode.
|
"Toggle Kuso C plugin mode.
|
||||||
This mode provide C language plugin for Shit IDE."
|
This mode provide C language plugin for Kuso IDE."
|
||||||
:lighter " shit-c"
|
:lighter " kuso-c"
|
||||||
:keymap shit-cplugin-map
|
:keymap kuso-cplugin-map
|
||||||
:global t
|
:global t
|
||||||
:group 'shit-group
|
:group 'kuso-group
|
||||||
|
|
||||||
(if shit-cplugin-mode
|
(if kuso-cplugin-mode
|
||||||
;; shit-cplugin-mode is not loaded
|
;; kuso-cplugin-mode is not loaded
|
||||||
(let ()
|
(let ()
|
||||||
;; before initiazing mode
|
;; before initiazing mode
|
||||||
(run-hooks shit-cplug-preinit-hook)
|
(run-hooks kuso-cplug-preinit-hook)
|
||||||
(initial-keymap)
|
(initial-keymap)
|
||||||
;; after mode was initialized
|
;; after mode was initialized
|
||||||
(run-hooks shit-cplug-postinit-hook)
|
(run-hooks kuso-cplug-postinit-hook)
|
||||||
)
|
)
|
||||||
;; shit-mode already loaded
|
;; kuso-mode already loaded
|
||||||
(let ()
|
(let ()
|
||||||
;; before deactivating mode
|
;; before deactivating mode
|
||||||
(run-hooks shit-cplug-prerm-hook)
|
(run-hooks kuso-cplug-prerm-hook)
|
||||||
;; after deactivating mode
|
;; after deactivating mode
|
||||||
(run-hooks shit-cplug-postrm-hook)
|
(run-hooks kuso-cplug-postrm-hook)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue