emacs-diffs
[Top][All Lists]
Advanced

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

master 78066671c0 3/3: Merge from origin/emacs-28


From: Stefan Kangas
Subject: master 78066671c0 3/3: Merge from origin/emacs-28
Date: Sat, 1 Jan 2022 00:52:05 -0500 (EST)

branch: master
commit 78066671c04b09e57cb82ded6b5d29baee7f5f6b
Merge: 48bd406793 67400da412
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Merge from origin/emacs-28
    
    67400da412 Improve doc strings of fringe indicator variables
    a6adfe21e4 * lisp/tab-line.el (tab-line--get-tab-property): New funct...
---
 lisp/tab-line.el | 24 +++++++++++++++---------
 src/buffer.c     |  9 +++++----
 2 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 003bfe1fbe..5144c19920 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -617,6 +617,12 @@ the selected tab visible."
 
 (defvar tab-line-auto-hscroll-buffer (generate-new-buffer " 
*tab-line-hscroll*"))
 
+(defun tab-line--get-tab-property (prop string)
+  (or (get-text-property 1 prop string) ;; for 99% cases of 1-char separator
+      (get-text-property 0 prop string) ;; for empty separator
+      (let ((pos (next-single-property-change 0 prop string))) ;; long 
separator
+        (and pos (get-text-property pos prop string)))))
+
 (defun tab-line-auto-hscroll (strings hscroll)
   (with-current-buffer tab-line-auto-hscroll-buffer
     (let ((truncate-partial-width-windows nil)
@@ -638,7 +644,7 @@ the selected tab visible."
                  (not (integerp hscroll)))
         (let ((selected (seq-position strings 'selected
                                       (lambda (str prop)
-                                        (get-pos-property 1 prop str)))))
+                                        (tab-line--get-tab-property prop 
str)))))
           (cond
            ((null selected)
             ;; Do nothing if no tab is selected
@@ -652,13 +658,13 @@ the selected tab visible."
             (if (> (vertical-motion 1) 0)
                 (let* ((point (previous-single-property-change (point) 'tab))
                        (tab-prop (when point
-                                   (or (get-pos-property point 'tab)
+                                   (or (get-text-property point 'tab)
                                        (and (setq point 
(previous-single-property-change point 'tab))
-                                            (get-pos-property point 'tab)))))
+                                            (get-text-property point 'tab)))))
                        (new-hscroll (when tab-prop
                                       (seq-position strings tab-prop
                                                     (lambda (str tab)
-                                                      (eq (get-pos-property 1 
'tab str) tab))))))
+                                                      (eq 
(tab-line--get-tab-property 'tab str) tab))))))
                   (when new-hscroll
                     (setq hscroll (float new-hscroll))
                     (set-window-parameter nil 'tab-line-hscroll hscroll)))
@@ -679,13 +685,13 @@ the selected tab visible."
               (when (> (vertical-motion 1) 0)
                 (let* ((point (previous-single-property-change (point) 'tab))
                        (tab-prop (when point
-                                   (or (get-pos-property point 'tab)
+                                   (or (get-text-property point 'tab)
                                        (and (setq point 
(previous-single-property-change point 'tab))
-                                            (get-pos-property point 'tab)))))
+                                            (get-text-property point 'tab)))))
                        (new-hscroll (when tab-prop
                                       (seq-position strings tab-prop
                                                     (lambda (str tab)
-                                                      (eq (get-pos-property 1 
'tab str) tab))))))
+                                                      (eq 
(tab-line--get-tab-property 'tab str) tab))))))
                   (when new-hscroll
                     (setq hscroll (float new-hscroll))
                     (set-window-parameter nil 'tab-line-hscroll 
hscroll)))))))))
@@ -744,7 +750,7 @@ So, for example, switching to a previous tab is equivalent 
to
 using the `previous-buffer' command."
   (interactive "e")
   (let* ((posnp (event-start event))
-         (tab (get-pos-property 1 'tab (car (posn-string posnp))))
+         (tab (tab-line--get-tab-property 'tab (car (posn-string posnp))))
          (buffer (if (bufferp tab) tab (cdr (assq 'buffer tab)))))
     (if buffer
         (tab-line-select-tab-buffer buffer (posn-window posnp))
@@ -860,7 +866,7 @@ sight of the tab line."
   (interactive (list last-nonmenu-event))
   (let* ((posnp (and (listp event) (event-start event)))
          (window (and posnp (posn-window posnp)))
-         (tab (get-pos-property 1 'tab (car (posn-string posnp))))
+         (tab (tab-line--get-tab-property 'tab (car (posn-string posnp))))
          (buffer (if (bufferp tab) tab (cdr (assq 'buffer tab))))
          (close-function (unless (bufferp tab) (cdr (assq 'close tab)))))
     (with-selected-window (or window (selected-window))
diff --git a/src/buffer.c b/src/buffer.c
index a2fd0a83bc..1db7b4033c 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -6023,15 +6023,16 @@ specifies.  */);
 
   DEFVAR_PER_BUFFER ("indicate-empty-lines",
                     &BVAR (current_buffer, indicate_empty_lines), Qnil,
-                    doc: /* Visually indicate empty lines after the buffer end.
-If non-nil, a bitmap is displayed in the left fringe of a window on
-window-systems.  */);
+                    doc: /* Visually indicate unused ("empty") screen lines 
after the buffer end.
+If non-nil, a bitmap is displayed in the left fringe of a window
+on graphical displays for each screen line that doesn't correspond
+to any buffer text.  */);
 
   DEFVAR_PER_BUFFER ("indicate-buffer-boundaries",
                     &BVAR (current_buffer, indicate_buffer_boundaries), Qnil,
                     doc: /* Visually indicate buffer boundaries and scrolling.
 If non-nil, the first and last line of the buffer are marked in the fringe
-of a window on window-systems with angle bitmaps, or if the window can be
+of a window on graphical displays with angle bitmaps, or if the window can be
 scrolled, the top and bottom line of the window are marked with up and down
 arrow bitmaps.
 



reply via email to

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