[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/telephone-line f1939248be 1/2: Add ability to target heade
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/telephone-line f1939248be 1/2: Add ability to target header-line |
Date: |
Mon, 19 Sep 2022 10:59:21 -0400 (EDT) |
branch: elpa/telephone-line
commit f1939248bef49197421205dcc12e35e5aeb07ea1
Author: Gerry Agbobada <git@gagbo.net>
Commit: Gerry Agbobada <git@gagbo.net>
Add ability to target header-line
---
telephone-line.el | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/telephone-line.el b/telephone-line.el
index 6ad8ccb841..876d27c3d6 100644
--- a/telephone-line.el
+++ b/telephone-line.el
@@ -166,6 +166,12 @@ Secondary separators do not incur a background color
change."
:group 'telephone-line
:type 'symbol)
+(defcustom telephone-line-target 'mode-line
+ "The target line to display telephone-line."
+ :group 'telephone-line
+ :type '(choice (const :tag "Mode line" mode-line)
+ (const :tag "Header line (Emacs 28+)" header-line)))
+
(defun telephone-line-fill (reserve &optional face)
"Return RESERVE empty space on the right, optionally with a FACE."
(propertize " "
@@ -411,10 +417,12 @@ separators, as they are conditional, are evaluated
on-the-fly."
:group 'telephone-line
:global t
:lighter nil
- (setq-default mode-line-format
- (if telephone-line-mode
- `("%e" ,@(telephone-line--generate-mode-line))
- telephone-line--default-mode-line)))
+ (let ((line (if telephone-line-mode
+ `("%e" ,@(telephone-line--generate-mode-line))
+ telephone-line--default-mode-line)))
+ (if (eq telephone-line-target 'mode-line)
+ (setq-default mode-line-format line)
+ (setq-default header-line-format line))))
(provide 'telephone-line)
;;; telephone-line.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [nongnu] elpa/telephone-line f1939248be 1/2: Add ability to target header-line,
ELPA Syncer <=