emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/menu-bar.el


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/menu-bar.el
Date: Tue, 23 Apr 2002 04:35:00 -0400

Index: emacs/lisp/menu-bar.el
diff -c emacs/lisp/menu-bar.el:1.207 emacs/lisp/menu-bar.el:1.208
*** emacs/lisp/menu-bar.el:1.207        Tue Apr 23 01:01:50 2002
--- emacs/lisp/menu-bar.el      Tue Apr 23 04:34:57 2002
***************
*** 1282,1287 ****
--- 1282,1290 ----
           file))
        (car elt)))
  
+ ;; Used to cache the menu entries for commands in the Buffers menu
+ (defvar menu-bar-buffers-menu-command-entries nil)
+ 
  (defun menu-bar-update-buffers (&optional force)
    ;; If user discards the Buffers item, play along.
    (and (lookup-key (current-global-map) [menu-bar buffer])
***************
*** 1357,1376 ****
                          `((frames-separator "--")
                            (frames menu-item "Frames" ,frames-menu))))))
  
!        ;; Add in some normal commands at the end of the menu
         (setq buffers-menu
!              (nconc buffers-menu
!                     '((command-separator "--")
!                       (select-named-buffer
!                        menu-item
!                        "Select Named Buffer..."
!                        switch-to-buffer
!                        :help "Prompt for a buffer name, and select that 
buffer in the current window")
!                       (list-all-buffers
!                        menu-item
!                        "List All Buffers"
!                        list-buffers
!                        :help "Pop up a window listing all emacs buffers"))))
  
         (setq buffers-menu (cons 'keymap (cons "Select Buffer" buffers-menu)))
         (define-key (current-global-map) [menu-bar buffer]
--- 1360,1386 ----
                          `((frames-separator "--")
                            (frames menu-item "Frames" ,frames-menu))))))
  
!        ;; Add in some normal commands at the end of the menu.  We use
!        ;; the copy cached in `menu-bar-buffers-menu-command-entries'
!        ;; if it's been set already.  Note that we can't use constant
!        ;; lists for the menu-entries, because the low-level menu-code
!        ;; modifies them.
!        (unless menu-bar-buffers-menu-command-entries
!          (setq menu-bar-buffers-menu-command-entries
!                (list '(command-separator "--")
!                      (list 'select-named-buffer
!                            'menu-item
!                            "Select Named Buffer..."
!                            'switch-to-buffer
!                            :help "Prompt for a buffer name, and select that 
buffer in the current window")
!                      (list 'list-all-buffers
!                            'menu-item
!                            "List All Buffers"
!                            'list-buffers
!                            :help "Pop up a window listing all emacs buffers"
!                            ))))
         (setq buffers-menu
!              (nconc buffers-menu menu-bar-buffers-menu-command-entries))
  
         (setq buffers-menu (cons 'keymap (cons "Select Buffer" buffers-menu)))
         (define-key (current-global-map) [menu-bar buffer]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]