diff options
Diffstat (limited to 'devdocs/elisp/modifying-menus.html')
| -rw-r--r-- | devdocs/elisp/modifying-menus.html | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/devdocs/elisp/modifying-menus.html b/devdocs/elisp/modifying-menus.html deleted file mode 100644 index 7c9c4cd7..00000000 --- a/devdocs/elisp/modifying-menus.html +++ /dev/null @@ -1,15 +0,0 @@ - <h4 class="subsection">Modifying Menus</h4> <p>When you insert a new item in an existing menu, you probably want to put it in a particular place among the menu’s existing items. If you use <code>define-key</code> to add the item, it normally goes at the front of the menu. To put it elsewhere in the menu, use <code>define-key-after</code>: </p> <dl> <dt id="define-key-after">Function: <strong>define-key-after</strong> <em>map key binding &optional after</em> -</dt> <dd> -<p>Define a binding in <var>map</var> for <var>key</var>, with value <var>binding</var>, just like <code>define-key</code>, but position the binding in <var>map</var> after the binding for the event <var>after</var>. The argument <var>key</var> should be of length one—a vector or string with just one element. But <var>after</var> should be a single event type—a symbol or a character, not a sequence. The new binding goes after the binding for <var>after</var>. If <var>after</var> is <code>t</code> or is omitted, then the new binding goes last, at the end of the keymap. However, new bindings are added before any inherited keymap. </p> <p>Here is an example: </p> <div class="example"> <pre class="example">(define-key-after my-menu [drink] - '("Drink" . drink-command) 'eat) -</pre> -</div> <p>makes a binding for the fake function key <tt class="key">DRINK</tt> and puts it right after the binding for <tt class="key">EAT</tt>. </p> <p>Here is how to insert an item called ‘<samp>Work</samp>’ in the ‘<samp>Signals</samp>’ menu of Shell mode, after the item <code>break</code>: </p> <div class="example"> <pre class="example">(define-key-after shell-mode-map [menu-bar signals work] - '("Work" . work-command) 'break) -</pre> -</div> </dd> -</dl><div class="_attribution"> - <p class="_attribution-p"> - Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> - <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Modifying-Menus.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Modifying-Menus.html</a> - </p> -</div> |
