aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2021-11-19 07:00:24 +0100
committerStefan Kangas2021-11-19 07:00:24 +0100
commitc6d5fccc92fca76bf81dcfdca37ac9b0f96c1d81 (patch)
tree8c880fa3f7c7dc807e0a4cf3b2473a2b365b7777
parent7138e69fdcf2d9f8cfe6bebf750f7f04b6ee6286 (diff)
parent02853edba795b0d47201977d3b500e8a46ed5e0f (diff)
downloademacs-c6d5fccc92fca76bf81dcfdca37ac9b0f96c1d81.tar.gz
emacs-c6d5fccc92fca76bf81dcfdca37ac9b0f96c1d81.zip
Merge from origin/emacs-28
02853edba7 Fix sorting of menus in `context-menu-local' (bug#50067). 14271d050a Fix flyspell-correct-word selected from context menu opene... bf824843f4 * lisp/repeat.el (describe-repeat-maps): Print all bound k... 6fc94fb99e * lisp/tab-bar.el: Use 'mouse-1' for history buttons like ... 5eeaf85767 Improve documentation of window hooks 7404f4b4e0 Improve doc string of 'highlight-nonselected-windows'
-rw-r--r--doc/lispref/windows.texi4
-rw-r--r--lisp/menu-bar.el2
-rw-r--r--lisp/mouse.el11
-rw-r--r--lisp/repeat.el10
-rw-r--r--lisp/tab-bar.el6
-rw-r--r--lisp/textmodes/flyspell.el2
-rw-r--r--src/xdisp.c4
7 files changed, 25 insertions, 14 deletions
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}.
6419during redisplay provided a significant, non-scrolling change of a 6419during redisplay provided a significant, non-scrolling change of a
6420window has been detected. For simplicity, these hooks and the 6420window has been detected. For simplicity, these hooks and the
6421functions they call will be collectively referred to as @dfn{window 6421functions they call will be collectively referred to as @dfn{window
6422change functions}. 6422change functions}. As any hook, these hooks can be set either
6423globally of buffer-locally via the @var{local} argument of
6424@code{add-hook} (@pxref{Setting Hooks}) when the hook is installed.
6423 6425
6424@cindex window buffer change 6426@cindex window buffer change
6425The first of these hooks is run after a @dfn{window buffer change} is 6427The 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."
2738 ;; sorting. 2738 ;; sorting.
2739 (push (cons pos menu-item) menu-end) 2739 (push (cons pos menu-item) menu-end)
2740 (push menu-item menu-bar)))) 2740 (push menu-item menu-bar))))
2741 (lookup-key (or keymap (menu-bar-current-active-maps)) [menu-bar])) 2741 (or keymap (lookup-key (menu-bar-current-active-maps) [menu-bar])))
2742 `(keymap ,@(nreverse menu-bar) 2742 `(keymap ,@(nreverse menu-bar)
2743 ,@(mapcar #'cdr (sort menu-end 2743 ,@(mapcar #'cdr (sort menu-end
2744 (lambda (a b) 2744 (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."
364 (when (consp binding) 364 (when (consp binding)
365 (define-key-after menu (vector key) 365 (define-key-after menu (vector key)
366 (copy-sequence binding)))) 366 (copy-sequence binding))))
367 (menu-bar-keymap global-map)) 367 (menu-bar-keymap (lookup-key global-map [menu-bar])))
368 menu) 368 menu)
369 369
370(defun context-menu-local (menu _click) 370(defun context-menu-local (menu _click)
@@ -377,7 +377,7 @@ Some context functions add menu items below the separator."
377 (when (consp binding) 377 (when (consp binding)
378 (define-key-after menu (vector key) 378 (define-key-after menu (vector key)
379 (copy-sequence binding)))) 379 (copy-sequence binding))))
380 keymap))) 380 (menu-bar-keymap keymap))))
381 menu) 381 menu)
382 382
383(defun context-menu-minor (menu _click) 383(defun context-menu-minor (menu _click)
@@ -541,8 +541,11 @@ activates the menu whose contents depends on its surrounding context."
541 "Start key navigation of the context menu. 541 "Start key navigation of the context menu.
542This is the keyboard interface to \\[context-menu-map]." 542This is the keyboard interface to \\[context-menu-map]."
543 (interactive) 543 (interactive)
544 (let ((inhibit-mouse-event-check t)) 544 (let ((inhibit-mouse-event-check t)
545 (popup-menu (context-menu-map) (point)))) 545 (map (context-menu-map)))
546 (if (commandp map)
547 (call-interactively map)
548 (popup-menu map (point)))))
546 549
547(global-set-key [S-f10] 'context-menu-open) 550(global-set-key [S-f10] 'context-menu-open)
548 551
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'."
533 (dolist (command (sort (cdr keymap) 'string-lessp)) 533 (dolist (command (sort (cdr keymap) 'string-lessp))
534 (let* ((info (help-fns--analyze-function command)) 534 (let* ((info (help-fns--analyze-function command))
535 (map (list (symbol-value (car keymap)))) 535 (map (list (symbol-value (car keymap))))
536 (desc (key-description 536 (desc (mapconcat (lambda (key)
537 (or (where-is-internal command map t) 537 (format-message "`%s'" (key-description key)))
538 (where-is-internal (nth 3 info) map t))))) 538 (or (where-is-internal command map)
539 (princ (format-message " `%s' (bound to '%s')\n" command desc)))) 539 (where-is-internal (nth 3 info) map))
540 ", ")))
541 (princ (format-message " `%s' (bound to %s)\n" command desc))))
540 (princ "\n")))))) 542 (princ "\n"))))))
541 543
542(provide 'repeat) 544(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."
284 (setq tab-bar--dragging-in-progress t) 284 (setq tab-bar--dragging-in-progress t)
285 ;; Don't close the tab when clicked on the close button. Also 285 ;; Don't close the tab when clicked on the close button. Also
286 ;; don't add new tab on down-mouse. Let `tab-bar-mouse-1' do this. 286 ;; don't add new tab on down-mouse. Let `tab-bar-mouse-1' do this.
287 (unless (or (eq (car item) 'add-tab) (nth 2 item)) 287 (unless (or (memq (car item) '(add-tab history-back history-forward))
288 (nth 2 item))
288 (if (functionp (nth 1 item)) 289 (if (functionp (nth 1 item))
289 (call-interactively (nth 1 item)) 290 (call-interactively (nth 1 item))
290 (unless (eq tab-number t) 291 (unless (eq tab-number t)
@@ -298,7 +299,8 @@ regardless of where you click on it. Also add a new tab."
298 (let* ((item (tab-bar--event-to-item (event-start event))) 299 (let* ((item (tab-bar--event-to-item (event-start event)))
299 (tab-number (tab-bar--key-to-number (nth 0 item)))) 300 (tab-number (tab-bar--key-to-number (nth 0 item))))
300 (cond 301 (cond
301 ((and (eq (car item) 'add-tab) (functionp (nth 1 item))) 302 ((and (memq (car item) '(add-tab history-back history-forward))
303 (functionp (nth 1 item)))
302 (call-interactively (nth 1 item))) 304 (call-interactively (nth 1 item)))
303 ((and (nth 2 item) (not (eq tab-number t))) 305 ((and (nth 2 item) (not (eq tab-number t)))
304 (tab-bar-close-tab tab-number))))) 306 (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."
2160 (interactive "e") 2160 (interactive "e")
2161 (let ((save (point))) 2161 (let ((save (point)))
2162 (mouse-set-point event) 2162 (mouse-set-point event)
2163 (flyspell-correct-word-before-point event save))) 2163 (flyspell-correct-word-before-point (and (consp event) event) save)))
2164 2164
2165(defun flyspell-correct-word-before-point (&optional event opoint) 2165(defun flyspell-correct-word-before-point (&optional event opoint)
2166 "Pop up a menu of possible corrections for misspelled word before point. 2166 "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. */);
35370 line_number_display_limit_width = 200; 35370 line_number_display_limit_width = 200;
35371 35371
35372 DEFVAR_BOOL ("highlight-nonselected-windows", highlight_nonselected_windows, 35372 DEFVAR_BOOL ("highlight-nonselected-windows", highlight_nonselected_windows,
35373 doc: /* Non-nil means highlight region even in nonselected windows. */); 35373 doc: /* Non-nil means highlight active region even in nonselected windows.
35374When nil (the default), the active region is only highlighted when
35375the window is selected. */);
35374 highlight_nonselected_windows = false; 35376 highlight_nonselected_windows = false;
35375 35377
35376 DEFVAR_BOOL ("multiple-frames", multiple_frames, 35378 DEFVAR_BOOL ("multiple-frames", multiple_frames,