aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2008-02-21 07:41:21 +0000
committerDan Nicolaescu2008-02-21 07:41:21 +0000
commit7d55bf043c84bd12a8a3cc0790b36e00f9e7c9f3 (patch)
treeabca8811977a51d724fe43d7cf3c3db24d72478e
parent2a9eb3f5f867a87b1c2c1495715fa44e9f5b601b (diff)
downloademacs-7d55bf043c84bd12a8a3cc0790b36e00f9e7c9f3.tar.gz
emacs-7d55bf043c84bd12a8a3cc0790b36e00f9e7c9f3.zip
(eval-when-compile): Don't define
add-submenu. (verilog-xemacs-menu): Add :keys for C-M-a, C-M-e and C-M-h. Remove. Move contents to the only use ... (verilog-menu): ... here. (verilog-statement-menu): Remove. Move contents to the only use ... (verilog-stmt-menu): ... here. (verilog-mark-defun): Simply call mark-defun for emacs. (occur-pos-list): Declare for byte compiler. (mode-popup-menu): Don't defvar. (verilog-add-statement-menu): Remove. (verilog-mode-hook): Don't add verilog-add-statement-menu. (verilog-mode): Call easy-menu-add and set mode-popup-menu for XEmacs.
-rw-r--r--lisp/ChangeLog17
-rw-r--r--lisp/progmodes/verilog-mode.el82
2 files changed, 43 insertions, 56 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2c5f0299b1c..3071fd4107e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,20 @@
12008-02-21 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * progmodes/verilog-mode.el (eval-when-compile): Don't define
4 add-submenu.
5 (verilog-xemacs-menu): Add :keys for C-M-a, C-M-e and C-M-h.
6 Remove. Move contents to the only use ...
7 (verilog-menu): ... here.
8 (verilog-statement-menu): Remove. Move contents to the only use ...
9 (verilog-stmt-menu): ... here.
10 (verilog-mark-defun): Simply call mark-defun for emacs.
11 (occur-pos-list): Declare for byte compiler.
12 (mode-popup-menu): Don't defvar.
13 (verilog-add-statement-menu): Remove.
14 (verilog-mode-hook): Don't add verilog-add-statement-menu.
15 (verilog-mode): Call easy-menu-add and set mode-popup-menu for
16 XEmacs.
17
12008-02-21 Michael McNamara <mac@mail.brushroad.com> 182008-02-21 Michael McNamara <mac@mail.brushroad.com>
2 19
3 * progmodes/verilog-mode.el (verilog-xemacs-menu): Remove XEmacs 20 * progmodes/verilog-mode.el (verilog-xemacs-menu): Remove XEmacs
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index 3d40e4ecfa2..fd9b3d30d59 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -161,13 +161,6 @@
161 (defmacro store-match-data (&rest args) nil)) 161 (defmacro store-match-data (&rest args) nil))
162 (error nil)) 162 (error nil))
163 (condition-case nil 163 (condition-case nil
164 (if (boundp 'current-menubar)
165 nil ;; great
166 (progn
167 (defmacro add-submenu (&rest args) nil))
168 )
169 (error nil))
170 (condition-case nil
171 (if (fboundp 'char-before) 164 (if (fboundp 'char-before)
172 nil ;; great 165 nil ;; great
173 (defmacro char-before (&rest body) 166 (defmacro char-before (&rest body)
@@ -957,7 +950,8 @@ If set will become buffer local.")
957 "Keymap used in Verilog mode.") 950 "Keymap used in Verilog mode.")
958 951
959;; menus 952;; menus
960(defvar verilog-xemacs-menu 953(easy-menu-define
954 verilog-menu verilog-mode-map "Menu for Verilog mode"
961 `("Verilog" 955 `("Verilog"
962 ("Choose Compilation Action" 956 ("Choose Compilation Action"
963 ["None" 957 ["None"
@@ -992,9 +986,12 @@ If set will become buffer local.")
992 :selected (equal verilog-tool `verilog-compiler)] 986 :selected (equal verilog-tool `verilog-compiler)]
993 ) 987 )
994 ("Move" 988 ("Move"
995 ["Beginning of function" verilog-beg-of-defun t] 989 ["Beginning of function" verilog-beg-of-defun
996 ["End of function" verilog-end-of-defun t] 990 :keys "C-M-a"]
997 ["Mark function" verilog-mark-defun t] 991 ["End of function" verilog-end-of-defun
992 :keys "C-M-e"]
993 ["Mark function" verilog-mark-defun
994 :keys "C-M-h"]
998 ["Goto function/module" verilog-goto-defun t] 995 ["Goto function/module" verilog-goto-defun t]
999 ["Move to beginning of block" electric-verilog-backward-sexp t] 996 ["Move to beginning of block" electric-verilog-backward-sexp t]
1000 ["Move to end of block" electric-verilog-forward-sexp t] 997 ["Move to end of block" electric-verilog-forward-sexp t]
@@ -1051,11 +1048,10 @@ If set will become buffer local.")
1051 ["Submit bug report" verilog-submit-bug-report t] 1048 ["Submit bug report" verilog-submit-bug-report t]
1052 ["Version and FAQ" verilog-faq t] 1049 ["Version and FAQ" verilog-faq t]
1053 ["Customize Verilog Mode..." verilog-customize t] 1050 ["Customize Verilog Mode..." verilog-customize t]
1054 ["Customize Verilog Fonts & Colors" verilog-font-customize t] 1051 ["Customize Verilog Fonts & Colors" verilog-font-customize t]))
1055 ) 1052
1056 "Emacs menu for Verilog mode." 1053(easy-menu-define
1057 ) 1054 verilog-stmt-menu verilog-mode-map "Menu for statement templates in Verilog."
1058(defvar verilog-statement-menu
1059 '("Statements" 1055 '("Statements"
1060 ["Header" verilog-sk-header t] 1056 ["Header" verilog-sk-header t]
1061 ["Comment" verilog-sk-comment t] 1057 ["Comment" verilog-sk-comment t]
@@ -1086,14 +1082,7 @@ If set will become buffer local.")
1086 ["Repeat" verilog-sk-repeat t] 1082 ["Repeat" verilog-sk-repeat t]
1087 ["Case" verilog-sk-case t] 1083 ["Case" verilog-sk-case t]
1088 ["Casex" verilog-sk-casex t] 1084 ["Casex" verilog-sk-casex t]
1089 ["Casez" verilog-sk-casez t] 1085 ["Casez" verilog-sk-casez t]))
1090 )
1091 "Menu for statement templates in Verilog.")
1092
1093(easy-menu-define verilog-menu verilog-mode-map "Menu for Verilog mode"
1094 verilog-xemacs-menu)
1095(easy-menu-define verilog-stmt-menu verilog-mode-map "Menu for statement templates in Verilog."
1096 verilog-statement-menu)
1097 1086
1098(defvar verilog-mode-abbrev-table nil 1087(defvar verilog-mode-abbrev-table nil
1099 "Abbrev table in use in Verilog-mode buffers.") 1088 "Abbrev table in use in Verilog-mode buffers.")
@@ -2375,11 +2364,9 @@ Key bindings specific to `verilog-mode-map' are:
2375 2364
2376 ;; Setting up menus 2365 ;; Setting up menus
2377 (when (featurep 'xemacs) 2366 (when (featurep 'xemacs)
2378 (when (and current-menubar 2367 (easy-menu-add verilog-stmt-menu)
2379 (not (assoc "Verilog" current-menubar))) 2368 (easy-menu-add verilog-menu)
2380 ;; (set-buffer-menubar (copy-sequence current-menubar)) 2369 (setq mode-popup-menu (cons "Verilog Mode" verilog-stmt-menu)))
2381 (add-submenu nil verilog-xemacs-menu)
2382 (add-submenu nil verilog-stmt-menu)))
2383 2370
2384 ;; Stuff for GNU emacs 2371 ;; Stuff for GNU emacs
2385 (set (make-local-variable 'font-lock-defaults) 2372 (set (make-local-variable 'font-lock-defaults)
@@ -2673,13 +2660,15 @@ following code fragment:
2673 "Mark the current Verilog function (or procedure). 2660 "Mark the current Verilog function (or procedure).
2674This puts the mark at the end, and point at the beginning." 2661This puts the mark at the end, and point at the beginning."
2675 (interactive) 2662 (interactive)
2676 (when (featurep 'xemacs) 2663 (if (featurep 'xemacs)
2677 (push-mark (point)) 2664 (progn
2678 (verilog-end-of-defun) 2665 (push-mark (point))
2679 (push-mark (point)) 2666 (verilog-end-of-defun)
2680 (verilog-beg-of-defun) 2667 (push-mark (point))
2681 (if (fboundp 'zmacs-activate-region) 2668 (verilog-beg-of-defun)
2682 (zmacs-activate-region)))) 2669 (if (fboundp 'zmacs-activate-region)
2670 (zmacs-activate-region)))
2671 (mark-defun)))
2683 2672
2684(defun verilog-comment-region (start end) 2673(defun verilog-comment-region (start end)
2685 ; checkdoc-params: (start end) 2674 ; checkdoc-params: (start end)
@@ -5510,9 +5499,7 @@ If search fails, other files are checked based on
5510 (verilog-goto-defun-file label)))) 5499 (verilog-goto-defun-file label))))
5511 5500
5512;; Eliminate compile warning 5501;; Eliminate compile warning
5513(eval-when-compile 5502(defvar occur-pos-list)
5514 (if (not (boundp 'occur-pos-list))
5515 (defvar occur-pos-list nil "Backward compatibility occur positions.")))
5516 5503
5517(defun verilog-showscopes () 5504(defun verilog-showscopes ()
5518 "List all scopes in this module." 5505 "List all scopes in this module."
@@ -9869,23 +9856,6 @@ and the case items."
9869 > ("case selector: " str ": begin" \n > "next_" verilog-sk-state " = " _ ";" \n > (- verilog-indent-level-behavioral) "end" \n ) 9856 > ("case selector: " str ": begin" \n > "next_" verilog-sk-state " = " _ ";" \n > (- verilog-indent-level-behavioral) "end" \n )
9870 resume: > (- verilog-case-indent) "endcase" (progn (electric-verilog-terminate-line) nil) 9857 resume: > (- verilog-case-indent) "endcase" (progn (electric-verilog-terminate-line) nil)
9871 > (- verilog-indent-level-behavioral) "end" (progn (electric-verilog-terminate-line) nil)) 9858 > (- verilog-indent-level-behavioral) "end" (progn (electric-verilog-terminate-line) nil))
9872
9873;; Eliminate compile warning
9874(eval-when-compile
9875 (if (not (boundp 'mode-popup-menu))
9876 (defvar mode-popup-menu nil "Compatibility with XEmacs.")))
9877
9878;; ---- add menu 'Statements' in Verilog mode (MH)
9879(defun verilog-add-statement-menu ()
9880 "Add the menu 'Statements' to the menu bar in Verilog mode."
9881 (if (featurep 'xemacs)
9882 (progn
9883 (easy-menu-add verilog-stmt-menu)
9884 (easy-menu-add verilog-menu)
9885 (setq mode-popup-menu (cons "Verilog Mode" verilog-stmt-menu)))))
9886
9887(add-hook 'verilog-mode-hook 'verilog-add-statement-menu)
9888
9889 9859
9890 9860
9891;; 9861;;