Previous: Mode Line Buffer List Menu Customization, Up: Customization   [Contents][Index]


5.4 Main Menu Customization ¶

Anju modifies the main menu via the customizable hook variable anju-reconfigure-main-menu-hook. This hook is run in the command anju-init.

By default, the following hook functions are run:

anju-main-menu--reconfigure-text-mode

Reconfigures Text menu for text mode buffers.

anju-main-menu--reconfigure-bookmarks

Adds Bookmarks menu to main menu.

anju-main-menu--reconfigure-help

Reconfigures Help menu.

  • Set the customizable variable anju-help-menu-remove-emacs-tutorial to t if removing the tutorial entries is desired.

anju-reconfigure-main-menu-hook can be modified to add additional custom hook functions. Users who wish to do this should familiarize themselves with menu keymaps (elisp#Menu Keymaps) and the Easy Menu (elisp#Easy Menu) library.

Shown below is an example Elisp function which modifies the “Text” menu section of the main menu for modes which derive from text-mode.

(defun anju-main-menu--reconfigure-text-mode ()
  "Reconfigure Text mode menu."
  (easy-menu-remove-item text-mode-menu nil "Center Line")
  (easy-menu-remove-item text-mode-menu nil "Center Region")
  (easy-menu-remove-item text-mode-menu nil "Center Paragraph")
  (easy-menu-remove-item text-mode-menu nil "Paragraph Indent")
  (easy-menu-remove-item text-mode-menu nil "---")

  (easy-menu-add-item text-mode-menu nil anju-transform-text-menu "Auto Fill")
  (easy-menu-add-item text-mode-menu nil anju-style-menu "Auto Fill"))