@findex context-menu-mode
@vindex context-menu-functions
@kindex Down-mouse-3
+@kindex S-F10
Many GUI applications use @kbd{mouse-3} to display @dfn{context
menus}: menus that provide access to various pertinent settings and
actions for the location and context of the mouse click. If you
mouse. To customize the contents of the context menu, you can use the
variable @code{context-menu-functions} (@pxref{Major Mode
Conventions,,, elisp, The Emacs Lisp Reference Manual}).
+You can also invoke the context menu by pressing @kbd{S-@key{F10}}.
@node Mode Line Mouse
@section Mode Line Mouse Commands
pops up a menu whose contents depends on surrounding context near the
mouse click. You can change the order of the default sub-menus in the
context menu by customizing the user option 'context-menu-functions'.
+You can also invoke the context menu by pressing 'S-<F10>'.
+++
*** The "Edit => Clear" menu item now obeys a rectangular region.
When non-nil, matches for identifiers in the file visited by the
current buffer will be shown first in the "*xref*" buffer.
+---
+** New variable 'inhibit-mouse-event-check'.
+If bound to non-nil, a command with '(interactive "e")'
+doesn't signal an error when no mouse event is produced
+while using the keyboard.
+
\f
* Changes in Emacs 28.1 on Non-Free Operating Systems
activates the menu whose contents depends on its surrounding context."
:global t :group 'mouse)
+(defun context-menu-open ()
+ "Start key navigation of the context menu.
+This is the keyboard interface to \\[context-menu-map]."
+ (interactive)
+ (let ((inhibit-mouse-event-check t))
+ (popup-menu (context-menu-map) (point))))
+
+(global-set-key [S-f10] 'context-menu-open)
+
\f
;; Commands that operate on windows.
break;
case 'e': /* The invoking event. */
- if (next_event >= key_count)
+ if (!inhibit_mouse_event_check && next_event >= key_count)
error ("%s must be bound to an event with parameters",
(SYMBOLP (function)
? SSDATA (SYMBOL_NAME (function))
a way to turn themselves off when a mouse command switches windows. */);
Vmouse_leave_buffer_hook = Qnil;
+ DEFVAR_BOOL ("inhibit-mouse-event-check", inhibit_mouse_event_check,
+ doc: /* Non-nil means the interactive spec "e" doesn't check for events.
+In this case `(interactive "e")' doesn't signal an error when no mouse event
+is produced while using the keyboard. Then `event-start', `event-end',
+`event-click-count' can create a new event. */);
+ inhibit_mouse_event_check = false;
+
defsubr (&Sinteractive);
defsubr (&Scall_interactively);
defsubr (&Sfuncall_interactively);