diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index d718ac59be6..f8dcca72cc0 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -6419,7 +6419,9 @@ changed. @xref{Other Font Lock Variables}. during redisplay provided a significant, non-scrolling change of a window has been detected. For simplicity, these hooks and the functions they call will be collectively referred to as @dfn{window -change functions}. +change functions}. As any hook, these hooks can be set either +globally of buffer-locally via the @var{local} argument of +@code{add-hook} (@pxref{Setting Hooks}) when the hook is installed. @cindex window buffer change The first of these hooks is run after a @dfn{window buffer change} is diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 1a81f1a3d06..94e75efeeb0 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -2738,7 +2738,7 @@ could provide `global-map' where items are limited to the global map only." ;; sorting. (push (cons pos menu-item) menu-end) (push menu-item menu-bar)))) - (lookup-key (or keymap (menu-bar-current-active-maps)) [menu-bar])) + (or keymap (lookup-key (menu-bar-current-active-maps) [menu-bar]))) `(keymap ,@(nreverse menu-bar) ,@(mapcar #'cdr (sort menu-end (lambda (a b) diff --git a/lisp/mouse.el b/lisp/mouse.el index 4f9c49ce463..3128b39ce51 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -364,7 +364,7 @@ Some context functions add menu items below the separator." (when (consp binding) (define-key-after menu (vector key) (copy-sequence binding)))) - (menu-bar-keymap global-map)) + (menu-bar-keymap (lookup-key global-map [menu-bar]))) menu) (defun context-menu-local (menu _click) @@ -377,7 +377,7 @@ Some context functions add menu items below the separator." (when (consp binding) (define-key-after menu (vector key) (copy-sequence binding)))) - keymap))) + (menu-bar-keymap keymap)))) menu) (defun context-menu-minor (menu _click) @@ -541,8 +541,11 @@ activates the menu whose contents depends on its surrounding context." "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)))) + (let ((inhibit-mouse-event-check t) + (map (context-menu-map))) + (if (commandp map) + (call-interactively map) + (popup-menu map (point))))) (global-set-key [S-f10] 'context-menu-open) diff --git a/lisp/repeat.el b/lisp/repeat.el index 45201ad1aa6..4dcd353e346 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -533,10 +533,12 @@ Used in `repeat-mode'." (dolist (command (sort (cdr keymap) 'string-lessp)) (let* ((info (help-fns--analyze-function command)) (map (list (symbol-value (car keymap)))) - (desc (key-description - (or (where-is-internal command map t) - (where-is-internal (nth 3 info) map t))))) - (princ (format-message " `%s' (bound to '%s')\n" command desc)))) + (desc (mapconcat (lambda (key) + (format-message "`%s'" (key-description key))) + (or (where-is-internal command map) + (where-is-internal (nth 3 info) map)) + ", "))) + (princ (format-message " `%s' (bound to %s)\n" command desc)))) (princ "\n")))))) (provide 'repeat) diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index c2bf3021b08..4bb6391cd91 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -284,7 +284,8 @@ existing tab." (setq tab-bar--dragging-in-progress t) ;; Don't close the tab when clicked on the close button. Also ;; don't add new tab on down-mouse. Let `tab-bar-mouse-1' do this. - (unless (or (eq (car item) 'add-tab) (nth 2 item)) + (unless (or (memq (car item) '(add-tab history-back history-forward)) + (nth 2 item)) (if (functionp (nth 1 item)) (call-interactively (nth 1 item)) (unless (eq tab-number t) @@ -298,7 +299,8 @@ regardless of where you click on it. Also add a new tab." (let* ((item (tab-bar--event-to-item (event-start event))) (tab-number (tab-bar--key-to-number (nth 0 item)))) (cond - ((and (eq (car item) 'add-tab) (functionp (nth 1 item))) + ((and (memq (car item) '(add-tab history-back history-forward)) + (functionp (nth 1 item))) (call-interactively (nth 1 item))) ((and (nth 2 item) (not (eq tab-number t))) (tab-bar-close-tab tab-number))))) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 1d450b50012..258e5fde674 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -2160,7 +2160,7 @@ The word checked is the word at the mouse position." (interactive "e") (let ((save (point))) (mouse-set-point event) - (flyspell-correct-word-before-point event save))) + (flyspell-correct-word-before-point (and (consp event) event) save))) (defun flyspell-correct-word-before-point (&optional event opoint) "Pop up a menu of possible corrections for misspelled word before point. diff --git a/src/xdisp.c b/src/xdisp.c index ef49297e0fe..6c70ce60bb5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -35370,7 +35370,9 @@ line number may be omitted from the mode line. */); line_number_display_limit_width = 200; DEFVAR_BOOL ("highlight-nonselected-windows", highlight_nonselected_windows, - doc: /* Non-nil means highlight region even in nonselected windows. */); + doc: /* Non-nil means highlight active region even in nonselected windows. +When nil (the default), the active region is only highlighted when +the window is selected. */); highlight_nonselected_windows = false; DEFVAR_BOOL ("multiple-frames", multiple_frames,