]> code.delx.au - gnu-emacs/blobdiff - lisp/menu-bar.el
(eldoc-minor-mode-string): New variable.
[gnu-emacs] / lisp / menu-bar.el
index 685d54efe2c01bf6e51109b48b4e1a055379d219..986f61e6c545058ffea25b77914e390f0e6a1fc3 100644 (file)
@@ -21,6 +21,8 @@
 ;; along with GNU Emacs; see the file COPYING.  If not, write to
 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
+;; Avishai Yacobi suggested some menu rearrangements.
+
 ;;; Code:
 
 ;; Don't clobber an existing menu-bar keymap, to preserve any menu-bar key
 
 (if (fboundp 'delete-frame)
     (progn
-      (define-key menu-bar-files-menu [delete-frame]
+      ;; Don't use delete-frame as event name
+      ;; because that is a special event.
+      (define-key menu-bar-files-menu [delete-this-frame]
        '("Delete Frame" . delete-frame))
       (define-key menu-bar-files-menu [make-frame-on-display]
        '("Open New Display..." . make-frame-on-display))
 (define-key menu-bar-files-menu [dired] '("Open Directory..." . dired))
 (define-key menu-bar-files-menu [open-file] '("Open File..." . find-file))
 
-;; This is just one element of the ediff menu--the first.
-(define-key menu-bar-ediff-menu [window]
-  '("This Window And Next Window" . compare-windows))
 \f
 (defun nonincremental-search-forward (string)
   "Read a string and search for it nonincrementally."
@@ -302,9 +303,12 @@ Do the same for the keys of the same name."
   '("Show Version" . emacs-version))
 (define-key menu-bar-help-menu [report-emacs-bug]
   '("Send Bug Report..." . report-emacs-bug))
+(define-key menu-bar-help-menu [finder-by-keyword]
+  '("Find Lisp Packages..." . finder-by-keyword))
 (define-key menu-bar-help-menu [emacs-tutorial]
   '("Emacs Tutorial" . help-with-tutorial))
-(define-key menu-bar-help-menu [man] '("Man..." . manual-entry))
+(define-key menu-bar-help-menu [man]
+  '("Man..." . manual-entry))
 (define-key menu-bar-help-menu [describe-variable]
   '("Describe Variable..." . describe-variable))
 (define-key menu-bar-help-menu [describe-function]
@@ -392,6 +396,10 @@ Do the same for the keys of the same name."
                        (substring string 0 (/ yank-menu-length 2))
                        "..."
                        (substring string (- (/ yank-menu-length 2)))))))
+    ;; Don't let the menu string be all dashes
+    ;; because that has a special meaning in a menu.
+    (if (string-match "\\`-+\\'" menu-string)
+       (setq menu-string (concat menu-string " ")))
     ;; If we're supposed to be extending an existing string, and that
     ;; string really is at the front of the menu, then update it in place.
     (if (and old (or (eq old (car front))
@@ -411,9 +419,10 @@ Do the same for the keys of the same name."
   (push-mark (point))
   (insert last-command-event))
 \f
-(define-key global-map [menu-bar buffer] '("Buffers" . menu-bar-buffers))
-
-(defalias 'menu-bar-buffers (make-sparse-keymap "Buffers"))
+;; This definition is just to show what this looks like.
+;; It gets overridden below when menu-bar-update-buffers is called.
+(define-key global-map [menu-bar buffer]
+  (cons "Buffers" (make-sparse-keymap "Buffers")))
 
 (defvar buffers-menu-max-size 10
   "*Maximum number of entries which may appear on the Buffers menu.
@@ -575,6 +584,8 @@ A large number or nil slows down menu responsiveness.")
 
 (add-hook 'menu-bar-update-hook 'menu-bar-update-buffers)
 
+(menu-bar-update-buffers)
+
 ;; this version is too slow
 ;;;(defun format-buffers-menu-line (buffer)
 ;;;  "Returns a string to represent the given buffer in the Buffer menu.
@@ -613,7 +624,7 @@ A large number or nil slows down menu responsiveness.")
     (define-key map [menu-bar minibuf space]
       '("Complete Word" . minibuffer-complete-word))
     (define-key map [menu-bar minibuf tab]
-      '("Complete" . 'minibuffer-complete))
+      '("Complete" . minibuffer-complete))
     ))
  (list minibuffer-local-must-match-map
        minibuffer-local-completion-map))