diff --git a/src/lib/menu.el b/src/lib/menu.el index a21b9e9..e48f5b6 100644 --- a/src/lib/menu.el +++ b/src/lib/menu.el @@ -14,7 +14,9 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . - +;; --------------------------------------------------------------------- +;; Functions +;; --------------------------------------------------------------------- (defun pymenu () "draw python project menu" ;; Python submenu (define-key global-map [Ctrl-x p p d] 'django-proj) @@ -37,7 +39,6 @@ (defun menu/init-menu () "Initializing Shit IDE menu" ;; New Project Menu (define-key-after global-map [menu-bar file new-proj] (cons "New Project" (make-sparse-keymap "new project")) 'new-file) - ;; New Project sub menus ;; (define-key-after global-map [menu-bar file new-proj cproj] (cons "C/C++" (make-sparse-keymap "c-cpp-proj"))) ;; (define-key-after global-map [menu-bar file new-proj pyproj] (cons "Python" (make-sparse-keymap "python-proj")) 'cproj) @@ -45,6 +46,7 @@ ;; (define-key-after global-map [menu-bar file new-proj jproj] (cons "Java" (make-sparse-keymap "j-proj")) 'elproj) ;; (define-key-after global-map [menu-bar file new-proj jsproj] (cons "JS" (make-sparse-keymap "js-proj")) 'jproj) ;; (define-key-after global-map [menu-bar file new-proj phpproj] (cons "PHP" (make-sparse-keymap "php-proj")) 'pyproj) + (message "Menus Initinalized") ) diff --git a/src/plugins/cproject.el b/src/plugins/cproject.el index c9836fd..e0ebdcb 100644 --- a/src/plugins/cproject.el +++ b/src/plugins/cproject.el @@ -56,6 +56,8 @@ binding for Shit IDE C projects section." ;; 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) (define-key global-map [menu-bar file new-proj cproj kmodule] '("Kernel Module" . kmodule)) @@ -76,7 +78,6 @@ binding for Shit IDE C projects section." (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)) ) - ;; Thsi function exists because maybe SHIT needs more information ;; about new project in the feature the new-prject function did not ;; cover @@ -115,6 +116,17 @@ binding for Shit IDE C projects section." (message major-mode) ) +(defun init-main-menu () + "Initialize the C plugin menu under Shit menus." + (interactive) + +) + +(defun initial-keymap () + "Set the key binding for C project." + (define-key shit-cpluging-map (kbd "\C-c \C-c") 'compile) +) + ;; Initializing c menus at the load time (init-menus) @@ -134,7 +146,7 @@ This mode provide C language plugin for Shit IDE." (let () ;; before initiazing mode (run-hooks shit-cplug-preinit-hook) - (define-key shit-cpluging-map (kbd "\C-c \C-c") 'compile) + (initial-keymap) ;; after mode was initialized (run-hooks shit-cplug-postinit-hook) )