changeset 93674:44fab469d68d

* outline.el (outline-mode-menu-bar-map): * term.el (terminal-signal-menu): Add :help. * net/eudc.el (eudc-mode-map): Declare and define in one step. (eudc-tail-menu, eudc-server-menu, eudc-tools-menu): Add :help. * emacs-lisp/re-builder.el (reb-mode-map): * textmodes/nroff-mode.el (nroff-mode-map): Add menus.
author Dan Nicolaescu <dann@ics.uci.edu>
date Fri, 04 Apr 2008 22:45:01 +0000
parents 928315b10669
children 7fb9a5b86fa8
files lisp/ChangeLog lisp/emacs-lisp/re-builder.el lisp/net/eudc.el lisp/outline.el lisp/term.el lisp/textmodes/nroff-mode.el
diffstat 6 files changed, 234 insertions(+), 106 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Apr 04 22:34:35 2008 +0000
+++ b/lisp/ChangeLog	Fri Apr 04 22:45:01 2008 +0000
@@ -1,5 +1,14 @@
 2008-04-04  Dan Nicolaescu  <dann@ics.uci.edu>
 
+	* outline.el (outline-mode-menu-bar-map):
+	* term.el (terminal-signal-menu): Add :help.
+
+	* net/eudc.el (eudc-mode-map): Declare and define in one step.
+	(eudc-tail-menu, eudc-server-menu, eudc-tools-menu): Add :help.
+
+	* emacs-lisp/re-builder.el (reb-mode-map):
+	* textmodes/nroff-mode.el (nroff-mode-map): Add menus.
+
 	* diff-mode.el (diff-file-junk-re): Recognize the git format for
 	new files.
 	(diff-mode): Set beginning-of-defun-function and
--- a/lisp/emacs-lisp/re-builder.el	Fri Apr 04 22:34:35 2008 +0000
+++ b/lisp/emacs-lisp/re-builder.el	Fri Apr 04 22:45:01 2008 +0000
@@ -232,7 +232,8 @@
 
 ;; Define the local "\C-c" keymap
 (defvar reb-mode-map
-  (let ((map (make-sparse-keymap)))
+  (let ((map (make-sparse-keymap))
+	(menu-map (make-sparse-keymap)))
     (define-key map "\C-c\C-c" 'reb-toggle-case)
     (define-key map "\C-c\C-q" 'reb-quit)
     (define-key map "\C-c\C-w" 'reb-copy)
@@ -242,6 +243,35 @@
     (define-key map "\C-c\C-e" 'reb-enter-subexp-mode)
     (define-key map "\C-c\C-b" 'reb-change-target-buffer)
     (define-key map "\C-c\C-u" 'reb-force-update)
+    (define-key map [menu-bar reb-mode] (cons "Re-Builder" menu-map))
+    (define-key menu-map [rq]
+      '(menu-item "Quit" reb-quit
+		  :help "Quit the RE Builder mode"))
+    (define-key menu-map [rt]
+      '(menu-item "Case sensitive" reb-toggle-case
+		  :button (:toggle . case-fold-search)
+		  :help "Toggle case sensitivity of searches for RE Builder target buffer."))
+    (define-key menu-map [rb]
+      '(menu-item "Change target buffer..." reb-change-target-buffer
+		  :help "Change the target buffer and display it in the target window"))
+    (define-key menu-map [rs]
+      '(menu-item "Change syntax..." reb-change-syntax
+		  :help "Change the syntax used by the RE Builder"))
+    (define-key menu-map [re]
+      '(menu-item "Enter subexpression mode" reb-enter-subexp-mode
+		  :help "Enter the subexpression mode in the RE Builder"))
+    (define-key menu-map [ru]
+      '(menu-item "Force update" reb-force-update
+		  :help "Force an update in the RE Builder target window without a match limit"))
+    (define-key menu-map [rn]
+      '(menu-item "Go to next match" reb-next-match
+		  :help "Go to next match in the RE Builder target window"))
+    (define-key menu-map [rp]
+      '(menu-item "Go to previous match" reb-prev-match
+		  :help "Go to previous match in the RE Builder target window"))
+    (define-key menu-map [rc]
+      '(menu-item "Copy current RE" reb-copy
+		  :help "Copy current RE into the kill ring for later insertion"))
     map)
   "Keymap used by the RE Builder.")
 
--- a/lisp/net/eudc.el	Fri Apr 04 22:34:35 2008 +0000
+++ b/lisp/net/eudc.el	Fri Apr 04 22:45:01 2008 +0000
@@ -67,7 +67,17 @@
 ;;{{{      Internal variables and compatibility tricks
 
 (defvar eudc-form-widget-list nil)
-(defvar eudc-mode-map nil)
+
+(defvar eudc-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "q" 'kill-this-buffer)
+    (define-key map "x" 'kill-this-buffer)
+    (define-key map "f" 'eudc-query-form)
+    (define-key map "b" 'eudc-try-bbdb-insert)
+    (define-key map "n" 'eudc-move-to-next-record)
+    (define-key map "p" 'eudc-move-to-previous-record)
+    map))
+(set-keymap-parent eudc-mode-map widget-keymap)
 
 (defvar mode-popup-menu)
 
@@ -1105,45 +1115,44 @@
 
 (require 'easymenu)
 
-(setq eudc-mode-map
-      (let ((map (make-sparse-keymap)))
-	(define-key map "q" 'kill-this-buffer)
-	(define-key map "x" 'kill-this-buffer)
-	(define-key map "f" 'eudc-query-form)
-	(define-key map "b" 'eudc-try-bbdb-insert)
-	(define-key map "n" 'eudc-move-to-next-record)
-	(define-key map "p" 'eudc-move-to-previous-record)
-	map))
-(set-keymap-parent eudc-mode-map widget-keymap)
-
 (defconst eudc-custom-generated-menu (cdr (custom-menu-create 'eudc)))
 
 (defconst eudc-tail-menu
   `(["---" nil nil]
-    ["Query with Form" eudc-query-form t]
-    ["Expand Inline Query" eudc-expand-inline t]
+    ["Query with Form" eudc-query-form
+     :help "Display a form to query the directory server"]
+    ["Expand Inline Query" eudc-expand-inline
+     :help "Query the directory server, and expand the query string before point"]
     ["Insert Record into BBDB" eudc-insert-record-at-point-into-bbdb
      (and (or (featurep 'bbdb)
 	      (prog1 (locate-library "bbdb") (message "")))
 	  (overlays-at (point))
-	  (overlay-get (car (overlays-at (point))) 'eudc-record))]
+	  (overlay-get (car (overlays-at (point))) 'eudc-record))
+     :help "Insert record at point into the BBDB database"]
     ["Insert All Records into BBDB" eudc-batch-export-records-to-bbdb
      (and (eq major-mode 'eudc-mode)
 	  (or (featurep 'bbdb)
-	      (prog1 (locate-library "bbdb") (message ""))))]
+	      (prog1 (locate-library "bbdb") (message ""))))
+     :help "Insert all the records returned by a directory query into BBDB"]
     ["---" nil nil]
-    ["Get Email" eudc-get-email t]
-    ["Get Phone" eudc-get-phone t]
-    ["List Valid Attribute Names" eudc-get-attribute-list t]
+    ["Get Email" eudc-get-email
+     :help "Get the email field of NAME from the directory server"]
+    ["Get Phone" eudc-get-phone
+     :help "Get the phone field of name from the directory server"]
+    ["List Valid Attribute Names" eudc-get-attribute-list
+     :help "Return a list of valid attributes for the current server"]
     ["---" nil nil]
     ,(cons "Customize" eudc-custom-generated-menu)))
 
 
 (defconst eudc-server-menu
   '(["---" nil nil]
-    ["Bookmark Current Server" eudc-bookmark-current-server t]
-    ["Edit Server List" eudc-edit-hotlist t]
-    ["New Server" eudc-set-server t]))
+    ["Bookmark Current Server" eudc-bookmark-current-server
+     :help "Add current server to the EUDC `servers' hotlist"]
+    ["Edit Server List" eudc-edit-hotlist
+     :help "Edit the hotlist of directory servers in a specialized buffer"]
+    ["New Server" eudc-set-server
+     :help "Set the directory server to SERVER using PROTOCOL"]))
 
 (defun eudc-menu ()
   (let (command)
@@ -1229,54 +1238,60 @@
   nil)
 
 ;;;###autoload
-(cond ((not (featurep 'xemacs))
-       (defvar eudc-tools-menu (make-sparse-keymap "Directory Search"))
-       (fset 'eudc-tools-menu (symbol-value 'eudc-tools-menu))
-       (define-key eudc-tools-menu [phone]
-	 '("Get Phone" . eudc-get-phone))
-       (define-key eudc-tools-menu [email]
-	 '("Get Email" . eudc-get-email))
-       (define-key eudc-tools-menu [separator-eudc-email]
-	 '("--"))
-       (define-key eudc-tools-menu [expand-inline]
-	 '("Expand Inline Query" . eudc-expand-inline))
-       (define-key eudc-tools-menu [query]
-	 '("Query with Form" . eudc-query-form))
-       (define-key eudc-tools-menu [separator-eudc-query]
-	 '("--"))
-       (define-key eudc-tools-menu [new]
-	 '("New Server" . eudc-set-server))
-       (define-key eudc-tools-menu [load]
-	 '("Load Hotlist of Servers" . eudc-load-eudc)))
-
-      (t
-       (let ((menu  '("Directory Search"
-		      ["Load Hotlist of Servers" eudc-load-eudc t]
-		      ["New Server" eudc-set-server t]
-		      ["---" nil nil]
-		      ["Query with Form" eudc-query-form t]
-		      ["Expand Inline Query" eudc-expand-inline t]
-		      ["---" nil nil]
-		      ["Get Email" eudc-get-email t]
-		      ["Get Phone" eudc-get-phone t])))
-	 (if (not (featurep 'eudc-autoloads))
-	     (if (featurep 'xemacs)
-		 (if (and (featurep 'menubar)
-			  (not (featurep 'infodock)))
-		     (add-submenu '("Tools") menu))
-	       (require 'easymenu)
-	       (cond
-		((fboundp 'easy-menu-add-item)
-		 (easy-menu-add-item nil '("tools")
-				     (easy-menu-create-menu (car menu)
-							    (cdr menu))))
-		((fboundp 'easy-menu-create-keymaps)
-		 (define-key
-		   global-map
-		   [menu-bar tools eudc]
-		   (cons "Directory Search"
-			 (easy-menu-create-keymaps "Directory Search"
-						   (cdr menu)))))))))))
+(cond
+ ((not (featurep 'xemacs))
+  (defvar eudc-tools-menu
+    (let ((map (make-sparse-keymap "Directory Search")))
+      (define-key map [phone]
+	'(menu-item "Get Phone" eudc-get-phone
+		    :help "Get the phone field of name from the directory server"))
+      (define-key map [email]
+	'(menu-item "Get Email" eudc-get-email
+		    :help "Get the email field of NAME from the directory server"))
+      (define-key map [separator-eudc-email] '("--"))
+      (define-key map [expand-inline]
+	'(menu-item "Expand Inline Query" eudc-expand-inline
+		    :help "Query the directory server, and expand the query string before point"))
+      (define-key map [query]
+	'(menu-item "Query with Form" eudc-query-form
+		    :help "Display a form to query the directory server"))
+      (define-key map [separator-eudc-query] '("--"))
+      (define-key map [new]
+	'(menu-item "New Server" eudc-set-server
+		    :help "Set the directory server to SERVER using PROTOCOL"))
+      (define-key map [load]
+	'(menu-item "Load Hotlist of Servers" eudc-load-eudc
+		    :help "Load the Emacs Unified Directory Client"))
+      map))
+  (fset 'eudc-tools-menu (symbol-value 'eudc-tools-menu)))
+ (t
+  (let ((menu  '("Directory Search"
+		 ["Load Hotlist of Servers" eudc-load-eudc t]
+		 ["New Server" eudc-set-server t]
+		 ["---" nil nil]
+		 ["Query with Form" eudc-query-form t]
+		 ["Expand Inline Query" eudc-expand-inline t]
+		 ["---" nil nil]
+		 ["Get Email" eudc-get-email t]
+		 ["Get Phone" eudc-get-phone t])))
+    (if (not (featurep 'eudc-autoloads))
+	(if (featurep 'xemacs)
+	    (if (and (featurep 'menubar)
+		     (not (featurep 'infodock)))
+		(add-submenu '("Tools") menu))
+	  (require 'easymenu)
+	  (cond
+	   ((fboundp 'easy-menu-add-item)
+	    (easy-menu-add-item nil '("tools")
+				(easy-menu-create-menu (car menu)
+						       (cdr menu))))
+	   ((fboundp 'easy-menu-create-keymaps)
+	    (define-key
+	      global-map
+	      [menu-bar tools eudc]
+	      (cons "Directory Search"
+		    (easy-menu-create-keymaps "Directory Search"
+					      (cdr menu)))))))))))
 
 ;;}}}
 
--- a/lisp/outline.el	Fri Apr 04 22:34:35 2008 +0000
+++ b/lisp/outline.el	Fri Apr 04 22:45:01 2008 +0000
@@ -97,47 +97,86 @@
 
     (define-key map [hide] (cons "Hide" (make-sparse-keymap "Hide")))
 
-    (define-key map [hide hide-other] '("Hide Other" . hide-other))
-    (define-key map [hide hide-sublevels] '("Hide Sublevels" . hide-sublevels))
-    (define-key map [hide hide-subtree] '("Hide Subtree" . hide-subtree))
-    (define-key map [hide hide-entry] '("Hide Entry" . hide-entry))
-    (define-key map [hide hide-body] '("Hide Body" . hide-body))
-    (define-key map [hide hide-leaves] '("Hide Leaves" . hide-leaves))
+    (define-key map [hide hide-other]
+      '(menu-item "Hide Other" hide-other
+		  :help "Hide everything except current body and parent and top-level headings"))
+    (define-key map [hide hide-sublevels]
+      '(menu-item "Hide Sublevels" hide-sublevels
+		  :help "Hide everything but the top LEVELS levels of headers, in whole buffer"))
+    (define-key map [hide hide-subtree]
+      '(menu-item "Hide Subtree" hide-subtree
+		  :help ""))
+    (define-key map [hide hide-entry]
+      '(menu-item "Hide Entry" hide-entry
+		  :help ""))
+    (define-key map [hide hide-body]
+      '(menu-item "Hide Body" hide-body
+		  :help ""))
+    (define-key map [hide hide-leaves]
+      '(menu-item "Hide Leaves" hide-leaves
+		  :help ""))
 
     (define-key map [show] (cons "Show" (make-sparse-keymap "Show")))
 
-    (define-key map [show show-subtree] '("Show Subtree" . show-subtree))
-    (define-key map [show show-children] '("Show Children" . show-children))
-    (define-key map [show show-branches] '("Show Branches" . show-branches))
-    (define-key map [show show-entry] '("Show Entry" . show-entry))
-    (define-key map [show show-all] '("Show All" . show-all))
+    (define-key map [show show-subtree]
+      '(menu-item "Show Subtree" show-subtree
+		  :help ""))
+    (define-key map [show show-children]
+      '(menu-item "Show Children" show-children
+		  :help ""))
+    (define-key map [show show-branches]
+      '(menu-item "Show Branches" show-branches
+		  :help ""))
+    (define-key map [show show-entry]
+      '(menu-item "Show Entry" show-entry
+		  :help ""))
+    (define-key map [show show-all]
+      '(menu-item "Show All" show-all
+		  :help ""))
 
     (define-key map [headings]
       (cons "Headings" (make-sparse-keymap "Headings")))
 
     (define-key map [headings demote-subtree]
-      '(menu-item "Demote subtree" outline-demote))
+      '(menu-item "Demote subtree" outline-demote
+		  :help ""))
     (define-key map [headings promote-subtree]
-      '(menu-item "Promote subtree" outline-promote))
+      '(menu-item "Promote subtree" outline-promote
+		  :help ""))
     (define-key map [headings move-subtree-down]
-      '(menu-item "Move subtree down" outline-move-subtree-down))
+      '(menu-item "Move subtree down" outline-move-subtree-down
+		  :help ""))
     (define-key map [headings move-subtree-up]
-      '(menu-item "Move subtree up" outline-move-subtree-up))
+      '(menu-item "Move subtree up" outline-move-subtree-up
+		  :help ""))
     (define-key map [headings copy]
       '(menu-item "Copy to kill ring" outline-headers-as-kill
-	:enable mark-active))
+		  :enable mark-active
+		  :help ""))
     (define-key map [headings outline-insert-heading]
-      '("New heading" . outline-insert-heading))
+
+      '(menu-item "New heading" outline-insert-heading
+		  :help ""))
     (define-key map [headings outline-backward-same-level]
-      '("Previous Same Level" . outline-backward-same-level))
+
+      '(menu-item "Previous Same Level" outline-backward-same-level
+		  :help ""))
     (define-key map [headings outline-forward-same-level]
-      '("Next Same Level" . outline-forward-same-level))
+
+      '(menu-item "Next Same Level" outline-forward-same-level
+		  :help ""))
     (define-key map [headings outline-previous-visible-heading]
-      '("Previous" . outline-previous-visible-heading))
+
+      '(menu-item "Previous" outline-previous-visible-heading
+		  :help ""))
     (define-key map [headings outline-next-visible-heading]
-      '("Next" . outline-next-visible-heading))
+
+      '(menu-item "Next" outline-next-visible-heading
+		  :help ""))
     (define-key map [headings outline-up-heading]
-      '("Up" . outline-up-heading))
+
+      '(menu-item "Up" outline-up-heading
+		  :help ""))
     map))
 
 (defvar outline-minor-mode-menu-bar-map
--- a/lisp/term.el	Fri Apr 04 22:34:35 2008 +0000
+++ b/lisp/term.el	Fri Apr 04 22:45:01 2008 +0000
@@ -777,13 +777,17 @@
   (let (newmap)
     (setq newmap (make-sparse-keymap "Terminal"))
     (define-key newmap [terminal-pager-enable]
-      '("Enable paging" . term-fake-pager-enable))
+      '(menu-item "Enable paging" term-fake-pager-enable
+		  :help "Enable paging feature"))
     (define-key newmap [terminal-pager-disable]
-      '("Disable paging" . term-fake-pager-disable))
+      '(menu-item "Disable paging" term-fake-pager-disable
+		  :help "Disable paging feature"))
     (define-key newmap [terminal-char-mode]
-      '("Character mode" . term-char-mode))
+      '(menu-item "Character mode" term-char-mode
+		  :help "Switch to char (raw) sub-mode of term mode"))
     (define-key newmap [terminal-line-mode]
-      '("Line mode" . term-line-mode))
+      '(menu-item "Line mode" term-line-mode
+		  :help "Switch to char (raw) sub-mode of term mode."))
     (setq term-terminal-menu (cons "Terminal" newmap))
 
     ;; completion:  (line mode only)
@@ -841,14 +845,26 @@
 
     ;; Signals
     (setq newmap (make-sparse-keymap "Signals"))
-    (define-key newmap [eof] '("EOF" . term-send-eof))
-    (define-key newmap [kill] '("KILL" . term-kill-subjob))
-    (define-key newmap [quit] '("QUIT" . term-quit-subjob))
-    (define-key newmap [cont] '("CONT" . term-continue-subjob))
-    (define-key newmap [stop] '("STOP" . term-stop-subjob))
-    (define-key newmap [] '("BREAK" . term-interrupt-subjob))
     (define-key term-mode-map [menu-bar signals]
       (setq term-signals-menu (cons "Signals" newmap)))
+    (define-key newmap [eof]
+      '(menu-item "EOF" term-send-eof
+		  :help "Send an EOF to the current buffer's process"))
+    (define-key newmap [kill]
+      '(menu-item "KILL" term-kill-subjob
+		  :help "Send kill signal to the current subjob"))
+    (define-key newmap [quit]
+      '(menu-item "QUIT" term-quit-subjob
+		  :help "Send quit signal to the current subjob."))
+    (define-key newmap [cont]
+      '(menu-item "CONT" term-continue-subjob
+		  :help "Send CONT signal to process buffer's process group"))
+    (define-key newmap [stop]
+      '(menu-item "STOP" term-stop-subjob
+		  :help "Stop the current subjob"))
+    (define-key newmap [brk]
+      '(menu-item "BREAK" term-interrupt-subjob
+		  :help "Interrupt the current subjob"))
     ))
 
 ;; Set up term-raw-map, etc.
--- a/lisp/textmodes/nroff-mode.el	Fri Apr 04 22:34:35 2008 +0000
+++ b/lisp/textmodes/nroff-mode.el	Fri Apr 04 22:45:01 2008 +0000
@@ -49,13 +49,32 @@
   :type 'boolean)
 
 (defvar nroff-mode-map
-  (let ((map (make-sparse-keymap)))
+  (let ((map (make-sparse-keymap))
+	(menu-map (make-sparse-keymap)))
     (define-key map "\t"  'tab-to-tab-stop)
     (define-key map "\es" 'center-line)
     (define-key map "\e?" 'nroff-count-text-lines)
     (define-key map "\n"  'nroff-electric-newline)
     (define-key map "\en" 'nroff-forward-text-line)
     (define-key map "\ep" 'nroff-backward-text-line)
+    (define-key map [menu-bar nroff-mode] (cons "Nroff" menu-map))
+    (define-key menu-map [nn]
+      '(menu-item "Newline" nroff-electric-newline
+		  :help "Insert newline for nroff mode; special if nroff-electric mode"))
+    (define-key menu-map [nc]
+      '(menu-item "Count text lines" nroff-count-text-lines
+		  :help "Count lines in region, except for nroff request lines."))
+    (define-key menu-map [nf]
+      '(menu-item "Forward text line" nroff-forward-text-line
+		  :help "Go forward one nroff text line, skipping lines of nroff requests"))
+    (define-key menu-map [nb]
+      '(menu-item "Backward text line" nroff-backward-text-line
+		  :help "Go backward one nroff text line, skipping lines of nroff requests"))
+    (define-key menu-map [ne]
+      '(menu-item "Electric newline mode"
+		  nroff-electric-mode
+		  :help "Auto insert closing requests if necessary"
+		  :button (:toggle . nroff-electric-mode)))
     map)
   "Major mode keymap for `nroff-mode'.")
 
@@ -247,8 +266,8 @@
     (".de" . "..")))
 
 (defun nroff-electric-newline (arg)
-  "Insert newline for nroff mode; special if electric-nroff mode.
-In `electric-nroff-mode', if ending a line containing an nroff opening request,
+  "Insert newline for nroff mode; special if nroff-electric mode.
+In `nroff-electric-mode', if ending a line containing an nroff opening request,
 automatically inserts the matching closing request after point."
   (interactive "P")
   (let ((completion (save-excursion