From 2bb721031c98f54a629d505b6d59d8cc8a4747f8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Sep 2024 11:55:08 +0300 Subject: [PATCH] ; Improve documentation of 'easy-menu-define' * doc/lispref/keymaps.texi (Easy Menu): * lisp/emacs-lisp/easymenu.el (easy-menu-define): Document that SYMBOL is also defined as a variable. (Bug#73108) (cherry picked from commit ad289f364e5c508d6f5d6ae530ee919c5fa43335) --- doc/lispref/keymaps.texi | 3 ++- lisp/emacs-lisp/easymenu.el | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index c06de3a6852..2f9529a2a18 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -3243,7 +3243,8 @@ contents are given by @var{menu}. If @var{symbol} is non-@code{nil}, it should be a symbol; then this macro defines @var{symbol} as a function for popping up the menu -(@pxref{Pop-Up Menus}), with @var{doc} as its documentation string. +(@pxref{Pop-Up Menus}), with @var{doc} as its documentation string. It +also defines @var{symbol} as a variable whose value is the menu. @var{symbol} should not be quoted. Regardless of the value of @var{symbol}, if @var{maps} is a keymap, diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 6740c2af58d..0a273ef0f7c 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -38,7 +38,8 @@ (defmacro easy-menu-define (symbol maps doc menu) "Define a pop-up menu and/or menu bar menu specified by MENU. If SYMBOL is non-nil, define SYMBOL as a function to pop up the -submenu defined by MENU, with DOC as its doc string. +submenu defined by MENU, with DOC as its doc string. Also define +SYMBOL as a variable whose value is the menu. MAPS, if non-nil, should be a keymap or a list of keymaps; add the submenu defined by MENU to the keymap or each of the keymaps, -- 2.39.2