help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: how to remove a menu item?


From: Drew Adams
Subject: RE: how to remove a menu item?
Date: Mon, 2 Feb 2009 20:12:28 -0800

> >> if i want to remove the menu under Help ? Emacs 
> >> Psychotherapist, how do i do it?
> > 
> > C-h k, then click Help > Emacs Psychotherapist shows this:
> > 
> > ,----
> > | <menu-bar> <help-menu> <emacs-psychotherapist> runs the 
> > | command doctor
> > |   which is an interactive autoloaded Lisp function in `doctor'.
> > | It is bound to <menu-bar> <help-menu> <emacs-psychotherapist>.
> > | (doctor)
> > | 
> > | Switch to *doctor* buffer and start giving psychotherapy.
> > `----
> > 
> > Either of these will get rid of this binding:
> > 
> > (define-key global-map [menu-bar help-menu 
> >             emacs-psychotherapist] nil)
> > 
> > (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
> 
> Thanks, Drew. On my build it was "eliza" rather than 
> "emacs-psychotherapist" that was revealed by C-h k. Evaluating the 
> define-key expression stripped the bottom item off the help menu but 
> left the separator bar.

Look in lisp/menu-bar.el for the binding of `eliza'. Just after or before it
will be a separator definition. Define that pseudo-key to nil.

E.g. in Emacs 22.1, menu-bar.el:

(define-key menu-bar-help-menu [eliza]
  '(menu-item "Emacs Psychotherapist" doctor
              :help "Our doctor will help you feel better"))
(define-key menu-bar-help-menu [sep4]
  '("--"))
(define-key menu-bar-help-menu [describe-no-warranty]
  '(menu-item "(Non)Warranty" describe-no-warranty
              :help "Explain that Emacs has NO WARRANTY"))

That corresponds to these menu items, in order:

(Non)Warranty
-------------
Emacs Psychotherapist

This will remove the Dr and the separator:

(define-key menu-bar-help-menu [eliza] nil)
(define-key menu-bar-help-menu [sep4] nil)






reply via email to

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