cpluging minor mode done - Menu system failed

This commit is contained in:
lxsameer 2011-01-02 21:22:02 +03:30
parent e66336773c
commit d496d1388f
2 changed files with 18 additions and 4 deletions

View File

@ -14,7 +14,9 @@
;; 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/>.
;; ---------------------------------------------------------------------
;; Functions
;; ---------------------------------------------------------------------
(defun pymenu () "draw python project menu" (defun pymenu () "draw python project menu"
;; Python submenu ;; Python submenu
(define-key global-map [Ctrl-x p p d] 'django-proj) (define-key global-map [Ctrl-x p p d] 'django-proj)
@ -37,7 +39,6 @@
(defun menu/init-menu () "Initializing Shit IDE menu" (defun menu/init-menu () "Initializing Shit IDE menu"
;; New Project Menu ;; New Project Menu
(define-key-after global-map [menu-bar file new-proj] (cons "New Project" (make-sparse-keymap "new project")) 'new-file) (define-key-after global-map [menu-bar file new-proj] (cons "New Project" (make-sparse-keymap "new project")) 'new-file)
;; New Project sub menus ;; 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 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) ;; (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 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 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) ;; (define-key-after global-map [menu-bar file new-proj phpproj] (cons "PHP" (make-sparse-keymap "php-proj")) 'pyproj)
(message "Menus Initinalized") (message "Menus Initinalized")
) )

View File

@ -56,6 +56,8 @@ binding for Shit IDE C projects section."
;; Functions ;; Functions
;; --------------------------------------------------------------------- ;; ---------------------------------------------------------------------
(defun init-menus () "Draw required menu for C mode" (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 (kbd "\C-x n k") 'kmodule)
(define-key global-map [menu-bar file new-proj cproj kmodule] '("Kernel Module" . 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 (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 SHIT 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
@ -115,6 +116,17 @@ binding for Shit IDE C projects section."
(message major-mode) (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 ;; Initializing c menus at the load time
(init-menus) (init-menus)
@ -134,7 +146,7 @@ This mode provide C language plugin for Shit IDE."
(let () (let ()
;; before initiazing mode ;; before initiazing mode
(run-hooks shit-cplug-preinit-hook) (run-hooks shit-cplug-preinit-hook)
(define-key shit-cpluging-map (kbd "\C-c \C-c") 'compile) (initial-keymap)
;; after mode was initialized ;; after mode was initialized
(run-hooks shit-cplug-postinit-hook) (run-hooks shit-cplug-postinit-hook)
) )