emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master c6d5fcc: Merge from origin/emacs-28


From: Stefan Kangas
Subject: master c6d5fcc: Merge from origin/emacs-28
Date: Fri, 19 Nov 2021 01:17:57 -0500 (EST)

branch: master
commit c6d5fccc92fca76bf81dcfdca37ac9b0f96c1d81
Merge: 7138e69 02853ed
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    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'
---
 doc/lispref/windows.texi   |  4 +++-
 lisp/menu-bar.el           |  2 +-
 lisp/mouse.el              | 11 +++++++----
 lisp/repeat.el             | 10 ++++++----
 lisp/tab-bar.el            |  6 ++++--
 lisp/textmodes/flyspell.el |  2 +-
 src/xdisp.c                |  4 +++-
 7 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index d718ac5..f8dcca7 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 1a81f1a..94e75ef 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 4f9c49c..3128b39 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 45201ad..4dcd353 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 c2bf302..4bb6391 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 1d450b5..258e5fd 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 ef49297..6c70ce6 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,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]