(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.")
(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.")
;; 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 ()
(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