From 61acee99020a65f7d5875d8b338199f16e472095 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Mon, 21 Apr 2008 05:02:06 +0000 Subject: [PATCH] * progmodes/asm-mode.el (asm-mode-map): * progmodes/hideif.el (hide-ifdef-mode-menu): Add :help. * progmodes/m4-mode.el (m4-mode-map): Add menu. --- lisp/ChangeLog | 7 +++++++ lisp/progmodes/asm-mode.el | 11 +++++++---- lisp/progmodes/hideif.el | 34 ++++++++++++++++++++++------------ lisp/progmodes/m4-mode.el | 13 ++++++++++++- 4 files changed, 48 insertions(+), 17 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 221f629029a..a79959ef904 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2008-04-21 Dan Nicolaescu + + * progmodes/asm-mode.el (asm-mode-map): + * progmodes/hideif.el (hide-ifdef-mode-menu): Add :help. + + * progmodes/m4-mode.el (m4-mode-map): Add menu. + 2008-04-21 Kenichi Handa * select.el (xselect-convert-to-string): Send a C_STRING only if diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el index 8f4dfcfcbec..167f851cfd6 100644 --- a/lisp/progmodes/asm-mode.el +++ b/lisp/progmodes/asm-mode.el @@ -81,12 +81,15 @@ (define-key map "\C-m" 'newline-and-indent) (define-key map [menu-bar] (make-sparse-keymap)) (define-key map [menu-bar asm-mode] (cons "Asm" map)) - (define-key map [asm-colon] - '("Insert Colon" . asm-colon)) (define-key map [comment-region] - '("Comment Region" . comment-region)) + '(menu-item "Comment Region" comment-region + :help "Comment or uncomment each line in the region")) (define-key map [newline-and-indent] - '("Insert Newline and Indent" . newline-and-indent)) + '(menu-item "Insert Newline and Indent" newline-and-indent + :help "Insert a newline, then indent according to major mode")) + (define-key map [asm-colon] + '(menu-item "Insert Colon" asm-colon + :help "Insert a colon; if it follows a label, delete the label's indentation")) map) "Keymap for Asm mode.") diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index 9f83d89532e..b3551fefcdc 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el @@ -168,18 +168,28 @@ (easy-menu-define hide-ifdef-mode-menu hide-ifdef-mode-map "Menu for `hide-ifdef-mode'." '("Hide-Ifdef" - ["Hide some ifdefs" hide-ifdefs t] - ["Show all ifdefs" show-ifdefs t] - ["Hide ifdef block" hide-ifdef-block t] - ["Show ifdef block" show-ifdef-block t] - ["Define a variable" hide-ifdef-define t] - ["Define an alist" hide-ifdef-set-define-alist t] - ["Use an alist" hide-ifdef-use-define-alist t] - ["Undefine a variable" hide-ifdef-undef t] + ["Hide some ifdefs" hide-ifdefs + :help "Hide the contents of some #ifdefs"] + ["Show all ifdefs" show-ifdefs + :help "Cancel the effects of `hide-ifdef': show the contents of all #ifdefs"] + ["Hide ifdef block" hide-ifdef-block + :help "Hide the ifdef block (true or false part) enclosing or before the cursor"] + ["Show ifdef block" show-ifdef-block + :help "Show the ifdef block (true or false part) enclosing or before the cursor"] + ["Define a variable..." hide-ifdef-define + :help "Define a VAR so that #ifdef VAR would be included"] + ["Undefine a variable..." hide-ifdef-undef + :help "Undefine a VAR so that #ifdef VAR would not be included"] + ["Define an alist..." hide-ifdef-set-define-alist + :help "Set the association for NAME to `hide-ifdef-env'"] + ["Use an alist..." hide-ifdef-use-define-alist + :help "Set `hide-ifdef-env' to the define list specified by NAME"] ["Toggle read only" hide-ifdef-toggle-read-only - :style toggle :selected hide-ifdef-read-only] + :style toggle :selected hide-ifdef-read-only + :help "Buffer should be read-only while hiding text"] ["Toggle shadowing" hide-ifdef-toggle-shadowing - :style toggle :selected hide-ifdef-shadow])) + :style toggle :selected hide-ifdef-shadow + :help "Text should be shadowed instead of hidden"])) (defvar hide-ifdef-hiding nil "Non-nil when text may be hidden.") @@ -257,8 +267,8 @@ how the hiding is done: ;; else end hide-ifdef-mode (kill-local-variable 'line-move-ignore-invisible) (remove-from-invisibility-spec '(hide-ifdef . t)) - (if hide-ifdef-hiding - (show-ifdefs)))) + (when hide-ifdef-hiding + (show-ifdefs)))) (defun hif-show-all () diff --git a/lisp/progmodes/m4-mode.el b/lisp/progmodes/m4-mode.el index 65aa80c44bd..c22a1f0d574 100644 --- a/lisp/progmodes/m4-mode.el +++ b/lisp/progmodes/m4-mode.el @@ -103,10 +103,21 @@ (modify-syntax-entry ?\" "w" m4-mode-syntax-table) (defvar m4-mode-map - (let ((map (make-sparse-keymap))) + (let ((map (make-sparse-keymap)) + (menu-map (make-sparse-keymap))) (define-key map "\C-c\C-b" 'm4-m4-buffer) (define-key map "\C-c\C-r" 'm4-m4-region) (define-key map "\C-c\C-c" 'comment-region) + (define-key map [menu-bar m4-mode] (cons "M4" menu-map)) + (define-key menu-map [m4c] + '(menu-item "Comment Region" comment-region + :help "Comment Region")) + (define-key menu-map [m4b] + '(menu-item "M4 Buffer" m4-m4-buffer + :help "Send contents of the current buffer to m4")) + (define-key menu-map [m4r] + '(menu-item "M4 Region" m4-m4-region + :help "Send contents of the current region to m4")) map)) (defvar m4-mode-abbrev-table nil -- 2.39.5