conditional load removed from cproject plugin.

This commit is contained in:
Sameer Rahmani 2011-01-04 22:54:41 +03:30
parent 8d46774a79
commit 7209be7dd6
1 changed files with 117 additions and 122 deletions

View File

@ -39,42 +39,39 @@
;; ----------------------------------------------------------------------
;; If user dont want the plug in so it should not loaded
(if c-plugin
(progn
;; -------------------------------------------------------------------
;; Hooks
;; -------------------------------------------------------------------
(defvar kuso-cplug-preinit-hook '()
;; -------------------------------------------------------------------
;; Hooks
;; -------------------------------------------------------------------
(defvar kuso-cplug-preinit-hook '()
"This hook runs before initializing the Kuso c-plugin minor mode."
)
(defvar kuso-cplug-postinit-hook '()
(defvar kuso-cplug-postinit-hook '()
"This hook runs after Kuso c-plugin minor mode initialized."
)
(defvar kuso-cplug-prerm--hook '()
(defvar kuso-cplug-prerm--hook '()
"This hook runs before deactivating Kuso c-plugin minor mode."
)
(defvar kuso-cplug-postrm-hook '()
(defvar kuso-cplug-postrm-hook '()
"This hook runs after Kuso c-plugin minor mode deactivated."
)
;; ---------------------------------------------------------------------
;; Keymaps
;; ---------------------------------------------------------------------
(defvar kuso-cplugin-map (make-sparse-keymap)
;; ---------------------------------------------------------------------
;; Keymaps
;; ---------------------------------------------------------------------
(defvar kuso-cplugin-map (make-sparse-keymap)
"Default keymap for Kuso c-plugin minor mode that hold the global key
binding for Kuso IDE C projects section."
)
;; ---------------------------------------------------------------------
;; Functions
;; ---------------------------------------------------------------------
(defun init-menus () "Draw required menu for C mode"
;; ---------------------------------------------------------------------
;; Functions
;; ---------------------------------------------------------------------
(defun init-menus () "Draw required menu for C mode"
(define-key-after global-map [menu-bar file new-proj cproj] (cons "C/C++" (make-sparse-keymap "c-cpp-proj")))
;; (define-key global-map (kbd "\C-x n k") 'kmodule)
@ -98,15 +95,15 @@ binding for Kuso IDE C projects section."
)
;; Thsi function exists because maybe Kuso needs more information
;; about new project in the feature the new-prject function did not
;; cover
(defun c-new-project () "Create a new C/C++ project"
;; Thsi function exists because maybe Kuso needs more information
;; about new project in the feature the new-prject function did not
;; cover
(defun c-new-project () "Create a new C/C++ project"
(new-project)
)
(defun compile ()
(defun compile ()
"Run the make command and return the putput"
(interactive)
(let (output)
@ -115,7 +112,7 @@ binding for Kuso IDE C projects section."
)
)
(defun generic-c () "Create a generic type C project"
(defun generic-c () "Create a generic type C project"
(interactive)
(c-new-project)
(project/copying-license-copy)
@ -135,7 +132,7 @@ binding for Kuso IDE C projects section."
(kuso-cplugin-mode)
)
(defun initial-keymap ()
(defun initial-keymap ()
"Set the key binding for C project."
(define-key kuso-cplugin-map (kbd "\C-c \C-c") 'compile)
)
@ -145,13 +142,13 @@ binding for Kuso IDE C projects section."
;; Initializing c menus at the load time
(add-hook 'kuso-postinit-mode-hook 'init-menus)
;; Initializing c menus at the load time
(add-hook 'kuso-postinit-mode-hook 'init-menus)
;; ----------------------------------------------------------------------
;; Minor Modes
;; ----------------------------------------------------------------------
(define-minor-mode kuso-cplugin-mode
;; ----------------------------------------------------------------------
;; Minor Modes
;; ----------------------------------------------------------------------
(define-minor-mode kuso-cplugin-mode
"Toggle Kuso C plugin mode.
This mode provide C language plugin for Kuso IDE."
:lighter " kuso-c"
@ -177,5 +174,3 @@ This mode provide C language plugin for Kuso IDE."
)
)
)
)
)