Mercurial > emacs
changeset 15996:0704ccc73df8
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 31 Aug 1996 16:25:51 +0000 |
parents | 7284f973fc42 |
children | 647b8cab9d9a |
files | lisp/menu-bar.el |
diffstat | 1 files changed, 18 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/menu-bar.el Sat Aug 31 16:25:21 1996 +0000 +++ b/lisp/menu-bar.el Sat Aug 31 16:25:51 1996 +0000 @@ -477,6 +477,7 @@ (frame-or-buffer-changed-p) (let ((buffers (buffer-list)) (frames (frame-list)) + (maxlen 0) buffers-menu frames-menu) ;; If requested, list only the N most recently selected buffers. (if (and (integerp buffers-menu-max-size) @@ -491,7 +492,6 @@ (mapcar 'list buffers)) tail (menu-bar-update-buffers-maxbuf 0) - (maxlen 0) alist head) ;; Put into each element of buffer-list @@ -564,26 +564,26 @@ ;; Make a Frames menu if we have more than one frame. (if (cdr frames) - (setq frames-menu - (cons "Select Frame" - (mapcar '(lambda (frame) - (nconc (list frame - (cdr (assq 'name - (frame-parameters frame))) - (cons nil nil)) - 'menu-bar-select-frame)) - frames)))) + (let ((name (concat (make-string (max (- (/ maxlen 2) 3) 0) + ?\ ) + "Frames")) + (frames-menu + (cons 'keymap + (cons "Select Frame" + (mapcar '(lambda (frame) + (nconc (list frame + (cdr (assq 'name + (frame-parameters frame))) + (cons nil nil)) + 'menu-bar-select-frame)) + frames))))) + ;; Put it underneath the Buffers menu. + (setq buffers-menu (cons (cons 'frames (cons name frames-menu)) + buffers-menu)))) (if buffers-menu (setq buffers-menu (cons 'keymap buffers-menu))) - (if frames-menu - (setq frames-menu (cons 'keymap frames-menu))) (define-key (current-global-map) [menu-bar buffer] - (cons "Buffers" - (if (and buffers-menu frames-menu) - (list 'keymap "Buffers and Frames" - (cons 'buffers (cons "Buffers" buffers-menu)) - (cons 'frames (cons "Frames" frames-menu))) - (or buffers-menu frames-menu 'undefined))))))) + (cons "Buffers" buffers-menu))))) (add-hook 'menu-bar-update-hook 'menu-bar-update-buffers)