summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2022-01-01 06:51:58 +0100
committerStefan Kangas <stefan@marxist.se>2022-01-01 06:51:58 +0100
commit78066671c04b09e57cb82ded6b5d29baee7f5f6b (patch)
tree409aff2cd0504c3b5863e201e0d82a40c1a32081
parent48bd406793c60a95bd23b15f3c5f7c9f2f228db2 (diff)
parent67400da412d8939a42ad6b88c9e6a07979a8f46f (diff)
downloademacs-78066671c04b09e57cb82ded6b5d29baee7f5f6b.tar.gz
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...
-rw-r--r--lisp/tab-line.el24
-rw-r--r--src/buffer.c9
2 files changed, 20 insertions, 13 deletions
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 003bfe1fbe3..5144c199209 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 a2fd0a83bce..1db7b4033c1 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.