emacs-diffs
[Top][All Lists]
Advanced

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

master 9e34efb 2/2: Merge from origin/emacs-28


From: Alan Mackenzie
Subject: master 9e34efb 2/2: Merge from origin/emacs-28
Date: Sun, 7 Nov 2021 15:54:25 -0500 (EST)

branch: master
commit 9e34efb29a72d0f9a7074a4066c16dd5c1381115
Merge: 78afcea 0c51db6
Author: Alan Mackenzie <acm@muc.de>
Commit: Alan Mackenzie <acm@muc.de>

    Merge from origin/emacs-28
    
    0c51db6bb1 Amend Follow Mode to handle header lines and tab lines cor...
    261367781b * lisp/files.el (user-emacs-directory-warning): Clarify do...
    8d9b55330d * doc/emacs/frames.texi (Tab Bars): Add text about mouse a...
    d9b0b730e8 * doc/emacs/frames.texi (Tab Bars): Describe tab-last.
---
 doc/emacs/frames.texi | 21 +++++++++++++++++++--
 etc/NEWS              |  9 +++++----
 lisp/files.el         |  6 ++++--
 lisp/follow.el        | 20 ++++++++++++++------
 4 files changed, 42 insertions(+), 14 deletions(-)

diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index ebb68ee..c14ada2 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -1456,9 +1456,7 @@ names is sorted by recency, so you can use @kbd{M-n}
 the second last, and so on.
 
 @kindex C-1, tab bar
-@kindex C-9, tab bar
 @kindex M-1, tab bar
-@kindex M-9, tab bar
 @findex tab-select
 @vindex tab-bar-select-tab-modifiers
 @vindex tab-bar-tab-hints
@@ -1474,6 +1472,15 @@ name, you can customize another variable 
@code{tab-bar-tab-hints}.
 This will help you decide which numerical key to press to select the
 tab by its number.
 
+@kindex C-9, tab bar
+@kindex M-9, tab bar
+@findex tab-last
+@item @var{modifier}-@kbd{9}
+Switch to the last tab (@code{tab-last}).  The key combination is
+the modifier key defined by @code{tab-bar-select-tab-modifiers} and
+the key @kbd{9}.  With a numeric argument @var{n}, switch to the
+@var{n}th last tab.
+
 @kindex C-0, tab bar
 @kindex M-0, tab bar
 @findex tab-recent
@@ -1501,6 +1508,13 @@ to the right; with a negative argument @minus{}@var{n}, 
move it
 @var{n} positions to the left.
 @end table
 
+  You can use the mouse to operate on tabs.  Clicking @kbd{mouse-2}
+closes the tab.  Clicking @kbd{mouse-3} pops up the context menu with
+the items that operate on the clicked tab.  Dragging the tab with
+@kbd{mouse-1} moves it to another position on the tab bar.  Mouse
+wheel scrolling switches to the next or previous tab.  Holding down
+the @key{SHIFT} key during scrolling moves the tab to the left or right.
+
 @findex tab-bar-history-mode
   You can enable @code{tab-bar-history-mode} to remember window
 configurations used in every tab, and later restore them.
@@ -1517,6 +1531,9 @@ Cancel restoration of the previous window configuration.
 This moves forward in the history of window configurations.
 @end table
 
+  It's possible to customize the items displayed on the tab bar
+by the user option @code{tab-bar-format}.
+
 @node Dialog Boxes
 @section Using Dialog Boxes
 @cindex dialog boxes
diff --git a/etc/NEWS b/etc/NEWS
index 97da145..7c7615a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -246,6 +246,7 @@ representation as emojis.
 +++
 *** New command 'C-x t C-r' to open file read-only in the other tab.
 
++++
 *** The tab bar now supports more mouse commands.
 Clicking 'mouse-2' closes the tab, 'mouse-3' displays the context menu
 with items that operate on the clicked tab.  Dragging the tab with
@@ -266,7 +267,7 @@ frame regardless of the values of 'tab-bar-mode' and 
'tab-bar-show'.
 This allows enabling/disabling the tab bar independently on different
 frames.
 
----
++++
 *** New user option 'tab-bar-format' defines a list of tab bar items.
 When it contains 'tab-bar-format-global' (possibly appended after
 'tab-bar-format-align-right'), then after enabling 'display-time-mode'
@@ -275,14 +276,14 @@ aligned to the right on the tab bar instead of on the 
mode line.
 When 'tab-bar-format-tabs' is replaced with 'tab-bar-format-tabs-groups',
 the tab bar displays tab groups.
 
----
++++
 *** New optional key binding for 'tab-last'.
 If you customize the user option 'tab-bar-select-tab-modifiers' to
 allow selecting tabs using their index numbers, the '<MODIFIER>-9' key
 is bound to 'tab-last', and switches to the last tab.  Here <MODIFIER>
 is any of the modifiers in the list that is the value of
-'tab-bar-select-tab-modifiers'.  You can also use negative indices,
-which count from the last tab: -1 is the last tab, -2 the one before
+'tab-bar-select-tab-modifiers'.  You can also use positive indices,
+which count from the last tab: 1 is the last tab, 2 the one before
 that, etc.
 
 ---
diff --git a/lisp/files.el b/lisp/files.el
index 3af9730..0bc7a92 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1059,8 +1059,10 @@ the function needs to examine, starting with FILE."
     (if root (file-name-as-directory root))))
 
 (defcustom user-emacs-directory-warning t
-  "Non-nil means warn if cannot access `user-emacs-directory'.
-Set this to nil at your own risk..."
+  "Non-nil means warn if unable to access or create `user-emacs-directory'.
+Set this to nil at your own risk, as it might lead to data loss
+when Emacs tries to write something to a non-existent or
+inaccessible location."
   :type 'boolean
   :group 'initialization
   :version "24.4")
diff --git a/lisp/follow.el b/lisp/follow.el
index b64f4cb..2ca2c1f 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -667,7 +667,8 @@ Works like `scroll-down' when not in Follow mode."
         (scroll-down-command arg))
        (arg (follow-scroll-down-arg arg))
         (t
-        (let* ((windows (follow-all-followers))
+        (let* ((orig-point (point))
+                (windows (follow-all-followers))
                (win (car (reverse windows)))
                (start (window-start (car windows))))
           (if (eq start (point-min))
@@ -678,11 +679,14 @@ Works like `scroll-down' when not in Follow mode."
             (select-window win)
             (goto-char start)
             (vertical-motion (- (- (window-height win)
-                                   (if header-line-format 2 1)
-                                   next-screen-context-lines)))
+                                   (if header-line-format 2 1) ; always 
mode-line
+                                   (if tab-line-format 1 0)
+                                    next-screen-context-lines)))
             (set-window-start win (point))
-            (goto-char start)
-            (vertical-motion (- next-screen-context-lines 1))
+             (if (< orig-point (window-end win t))
+                 (goto-char orig-point)
+               (goto-char start)
+              (vertical-motion (- next-screen-context-lines 1)))
             (setq follow-internal-force-redisplay t))))))
 (put 'follow-scroll-down 'scroll-command t)
 
@@ -947,7 +951,11 @@ used."
   (let* ((win (or win (selected-window)))
         (edges (window-inside-pixel-edges win))
         (ht (- (nth 3 edges) (nth 1 edges)))
-        (last-line-pos (posn-point (posn-at-x-y 0 (1- ht) win))))
+        (last-line-pos (posn-point
+                         (posn-at-x-y 0 (+ (window-header-line-height win)
+                                           (window-tab-line-height win)
+                                           (1- ht))
+                                      win))))
     (if (pos-visible-in-window-p last-line-pos win)
        (let ((end (window-end win t)))
          (list end (pos-visible-in-window-p (point-max) win)))



reply via email to

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