2

I have been using XEmacs for years and have completely redefined the menubar for my productivity. I would like to replace XEmacs with Emacs 28.2. I have tried several ways to redefine some menubar items, but so far, no luck. I copied menu-bar.el to my .emacs.d and load it from .emacs. I can tell that the local file is being read, as I have re-ordered the menus and they appear as desired:

File Edit Tools Options Buffers

So far, so good. However I removed the "New Tab" and "Close Tab" entries from menu-bar-file-menu definition, but they still appear in the File menu. I tried

  (define-key global-map [menu-bar] nil)
  (define-key global-map [menu-bar] (make-sparse-keymap "menu-bar"))

hoping this would re-create the keymaps. No luck. I also tried

  (define-key global-map [menu-bar file] nil)
  (define-key global-map [menu-bar edit] nil)
  (define-key global-map [menu-bar options] nil)
  (define-key global-map [menu-bar buffer] nil)
  (define-key global-map [menu-bar tools] nil)
  (define-key global-map [menu-bar help-menu] nil)

Again, hoping to get the keymap redefined, but the two tab entries still appear. I realize, I can delete and add menu entries, but to get the customization I want, this would entail more effort than re-defining menu-bar.el

Any idea what I'm doing wrong?

Drew
  • 75,699
  • 9
  • 109
  • 225
  • Try setting the values of global vars such as `menu-bar-file-menu`, which define the various menus. Looking at the code of library [MenuBar+](https://www.emacswiki.org/emacs/MenuBarPlus) might help; dunno. – Drew Jan 02 '23 at 23:03
  • Here is a link to the menu-bar buffer-menu component of Xemacs that I stole and converted to regular Emacs a few years ago ... I don know if it works with a more recent version of Emacs ... perhaps something in there might give you some ideas: https://github.com/lawlist/buffer-menu – lawlist Jan 02 '23 at 23:42

0 Answers0