X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/cd29dce07a96ab5a60e3b38b0444100340752a75..bd3e1759259f1f64c7e79d0779c4d156128b83d3:/lisp/menu-bar.el diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 685d54efe2..986f61e6c5 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -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 @@ -98,7 +100,9 @@ (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)) @@ -120,9 +124,6 @@ (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)) (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)) -(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))