diff options
| author | Richard M. Stallman | 1996-08-31 16:25:51 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-08-31 16:25:51 +0000 |
| commit | b3398af135341cbf4f738d05e1c4ad99efcf03e1 (patch) | |
| tree | 80cabe14d7b79d8e8df4d1a751438715d7aeb89c | |
| parent | 292d74a3386c62462f4a11286e4c908643befb71 (diff) | |
| download | emacs-b3398af135341cbf4f738d05e1c4ad99efcf03e1.tar.gz emacs-b3398af135341cbf4f738d05e1c4ad99efcf03e1.zip | |
(menu-bar-update-buffers): Make the Frames menu a submenu of the Buffers menu.
| -rw-r--r-- | lisp/menu-bar.el | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index e72aab64f01..60ef3a8ea59 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -477,6 +477,7 @@ Do the same for the keys of the same name." | |||
| 477 | (frame-or-buffer-changed-p) | 477 | (frame-or-buffer-changed-p) |
| 478 | (let ((buffers (buffer-list)) | 478 | (let ((buffers (buffer-list)) |
| 479 | (frames (frame-list)) | 479 | (frames (frame-list)) |
| 480 | (maxlen 0) | ||
| 480 | buffers-menu frames-menu) | 481 | buffers-menu frames-menu) |
| 481 | ;; If requested, list only the N most recently selected buffers. | 482 | ;; If requested, list only the N most recently selected buffers. |
| 482 | (if (and (integerp buffers-menu-max-size) | 483 | (if (and (integerp buffers-menu-max-size) |
| @@ -491,7 +492,6 @@ Do the same for the keys of the same name." | |||
| 491 | (mapcar 'list buffers)) | 492 | (mapcar 'list buffers)) |
| 492 | tail | 493 | tail |
| 493 | (menu-bar-update-buffers-maxbuf 0) | 494 | (menu-bar-update-buffers-maxbuf 0) |
| 494 | (maxlen 0) | ||
| 495 | alist | 495 | alist |
| 496 | head) | 496 | head) |
| 497 | ;; Put into each element of buffer-list | 497 | ;; Put into each element of buffer-list |
| @@ -564,26 +564,26 @@ Do the same for the keys of the same name." | |||
| 564 | 564 | ||
| 565 | ;; Make a Frames menu if we have more than one frame. | 565 | ;; Make a Frames menu if we have more than one frame. |
| 566 | (if (cdr frames) | 566 | (if (cdr frames) |
| 567 | (setq frames-menu | 567 | (let ((name (concat (make-string (max (- (/ maxlen 2) 3) 0) |
| 568 | (cons "Select Frame" | 568 | ?\ ) |
| 569 | (mapcar '(lambda (frame) | 569 | "Frames")) |
| 570 | (nconc (list frame | 570 | (frames-menu |
| 571 | (cdr (assq 'name | 571 | (cons 'keymap |
| 572 | (frame-parameters frame))) | 572 | (cons "Select Frame" |
| 573 | (cons nil nil)) | 573 | (mapcar '(lambda (frame) |
| 574 | 'menu-bar-select-frame)) | 574 | (nconc (list frame |
| 575 | frames)))) | 575 | (cdr (assq 'name |
| 576 | (frame-parameters frame))) | ||
| 577 | (cons nil nil)) | ||
| 578 | 'menu-bar-select-frame)) | ||
| 579 | frames))))) | ||
| 580 | ;; Put it underneath the Buffers menu. | ||
| 581 | (setq buffers-menu (cons (cons 'frames (cons name frames-menu)) | ||
| 582 | buffers-menu)))) | ||
| 576 | (if buffers-menu | 583 | (if buffers-menu |
| 577 | (setq buffers-menu (cons 'keymap buffers-menu))) | 584 | (setq buffers-menu (cons 'keymap buffers-menu))) |
| 578 | (if frames-menu | ||
| 579 | (setq frames-menu (cons 'keymap frames-menu))) | ||
| 580 | (define-key (current-global-map) [menu-bar buffer] | 585 | (define-key (current-global-map) [menu-bar buffer] |
| 581 | (cons "Buffers" | 586 | (cons "Buffers" buffers-menu))))) |
| 582 | (if (and buffers-menu frames-menu) | ||
| 583 | (list 'keymap "Buffers and Frames" | ||
| 584 | (cons 'buffers (cons "Buffers" buffers-menu)) | ||
| 585 | (cons 'frames (cons "Frames" frames-menu))) | ||
| 586 | (or buffers-menu frames-menu 'undefined))))))) | ||
| 587 | 587 | ||
| 588 | (add-hook 'menu-bar-update-hook 'menu-bar-update-buffers) | 588 | (add-hook 'menu-bar-update-hook 'menu-bar-update-buffers) |
| 589 | 589 | ||