aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-04-07 15:32:53 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2023-04-07 15:32:53 +0200
commite17494297dc11fe1dff893156b62586c103bc4b8 (patch)
treeda4043f27eeef282445e83badeed432f3ee22cf7
parented6707cbaca099c832e8fc197a94cb158d83a089 (diff)
Improve make-separator-line again
On graphic display use a string of spaces with :underline=t if length is non-nil, otherwise use only a newline :extend=t. On terminal displays use dashes.
-rw-r--r--compat-28.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/compat-28.el b/compat-28.el
index cfbf48b..620a799 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -221,10 +221,10 @@ and BLUE, is normalized to have its value in [0,65535]."
(compat-defun make-separator-line (&optional length) ;; <compat-tests:make-separator-line>
"Make a string appropriate for usage as a visual separator line.
If LENGTH is nil, use the window width."
- ;; :extend is only supported on Emacs 27 and newer
- (if (and (eval-when-compile (> emacs-major-version 26))
- (not length) (display-graphic-p))
- (propertize "\n" 'face '(:extend t :height 0.1 :inverse-video t))
+ (if (display-graphic-p)
+ (if length
+ (concat (propertize (make-string length ?\s) 'face '(:underline t)) "\n")
+ (propertize "\n" 'face '(:extend t :height 0.1 :inverse-video t)))
(concat (make-string (or length (1- (window-width))) ?-) "\n")))
;;;; Defined in subr.el