emacs-devel
[Top][All Lists]
Advanced

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

Re: Modify menu-bar help


From: Tim Cross
Subject: Re: Modify menu-bar help
Date: Sun, 27 Feb 2011 09:27:08 +1100



On Sat, Feb 26, 2011 at 9:22 PM, Jan Djärv <address@hidden> wrote:


Tim Cross skrev 2011-02-26 00.58:


I'm a bit surprised that the same problem seems to occur under the NextStep OS
- while I'm not expert here and could have things confused, it looked to me
like the ns version added menu 'buttons' when I scanned the menu-bar.el file.


Menu-bar.el has nothing to do with how things are implemented at the toolkit level.  Looking at it gives no clue what so ever.

       Jan D.

This was my mis-reading/remembering of the code in menu-bar.el. I thought there was code in menu-bar.el that was adding 'action' menus 'buttons' at the top level in the ns port, but looking at it again, I realise this is for the GNUStep version. My (flawed) logic was that if menu-bar.el is adding top level action buttons for a version, then the tookit used for that version must allow it. I think my logic is OK, it was my scanning of the code that led to the wrong conclusion! The code in quesiton was 
(if (not (featurep 'ns))
    ;; Force Help item to come last, after the major mode's own items.
    ;; The symbol used to be called `help', but that gets confused with the
    ;; help key.
    (setq menu-bar-final-items '(help-menu))
  (if (eq system-type 'darwin)
      (setq menu-bar-final-items '(buffer services help-menu))
    (setq menu-bar-final-items '(buffer services hide-app quit))
    ;; Add standard top-level items to GNUstep menu.
    (define-key global-map [menu-bar quit]
      `(menu-item ,(purecopy "Quit") save-buffers-kill-emacs
                  :help ,(purecopy "Save unsaved buffers, then exit")))
    (define-key global-map [menu-bar hide-app]
      `(menu-item ,(purecopy "Hide") ns-do-hide-emacs
                  :help ,(purecopy "Hide Emacs"))))
  (define-key global-map [menu-bar services] ; set-up in ns-win
    (cons (purecopy "Services") (make-sparse-keymap "Services"))))

Tim




reply via email to

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