[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master f921f18 1/3: Partially revert previous make-separator-line change
From: |
Lars Ingebrigtsen |
Subject: |
master f921f18 1/3: Partially revert previous make-separator-line change |
Date: |
Sat, 6 Nov 2021 13:56:49 -0400 (EDT) |
branch: master
commit f921f189ee3d77715247bc81a723c09408971cc4
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Partially revert previous make-separator-line change
* lisp/simple.el (make-separator-line): Use dashes on displays
that don't support underlines (bug#32950).
---
lisp/simple.el | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index 456844d..82e373b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -721,10 +721,16 @@ When called from Lisp code, ARG may be a prefix string to
copy."
This uses the `separator-line' face.
If LENGTH is nil, use the window width."
- (if length
- (concat (propertize (make-string length ?\s) 'face 'separator-line)
- "\n")
- (propertize "\n" 'face '(:inherit separator-line :extend t))))
+ (if (or (display-graphic-p)
+ (display-supports-face-attributes-p '(:underline t)))
+ (if length
+ (concat (propertize (make-string length ?\s) 'face 'separator-line)
+ "\n")
+ (propertize "\n" 'face '(:inherit separator-line :extend t)))
+ ;; In terminals (that don't support underline), use a line of dashes.
+ (concat (propertize (make-string (or length (1- (window-width))) ?-)
+ 'face 'separator-line)
+ "\n")))
(defun delete-indentation (&optional arg beg end)
"Join this line to previous and fix up whitespace at join.