[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/telephone-line 4885ebe7ae 130/195: Separate unicode separa
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/telephone-line 4885ebe7ae 130/195: Separate unicode separators out into their own class so they can be intermixed with XPM separators |
Date: |
Wed, 5 Jan 2022 02:59:39 -0500 (EST) |
branch: elpa/telephone-line
commit 4885ebe7ae2b7b3ef6bea10a33843db76a6412f5
Author: Daniel Bordak <dbordak@fastmail.fm>
Commit: Daniel Bordak <dbordak@fastmail.fm>
Separate unicode separators out into their own class so they can be
intermixed with XPM separators
---
telephone-line-separators.el | 23 ++++++++++++++++++-----
telephone-line-utils.el | 21 +++++++++++++--------
2 files changed, 31 insertions(+), 13 deletions(-)
diff --git a/telephone-line-separators.el b/telephone-line-separators.el
index a7829ea41e..ec12fbbf85 100644
--- a/telephone-line-separators.el
+++ b/telephone-line-separators.el
@@ -46,23 +46,36 @@
:axis-func #'identity
:pattern-func #'telephone-line-row-pattern-fixed-gradient))
+(defvar telephone-line-u-abs-right
+ (make-instance 'telephone-line-unicode-separator
+ :char #xe0b2
+ :inverse-video nil))
+(defvar telephone-line-u-abs-left
+ (make-instance 'telephone-line-unicode-separator
+ :char #xe0b0))
+(defvar telephone-line-u-abs-hollow-right
+ (make-instance 'telephone-line-unicode-separator
+ :char #xe0b3))
+(defvar telephone-line-u-abs-hollow-left
+ (make-instance 'telephone-line-unicode-separator
+ :char #xe0b1))
+
(defvar telephone-line-abs-right
(make-instance 'telephone-line-separator
:axis-func #'abs
- :alt-char #xe0b2
- :inverse-video nil))
+ :alt-separator telephone-line-u-abs-right))
(defvar telephone-line-abs-left
(make-instance 'telephone-line-separator
:axis-func (telephone-line-complement abs)
- :alt-char #xe0b0))
+ :alt-separator telephone-line-u-abs-left))
(defvar telephone-line-abs-hollow-right
(make-instance 'telephone-line-subseparator
:axis-func #'abs
- :alt-char #xe0b3))
+ :alt-separator telephone-line-u-abs-hollow-right))
(defvar telephone-line-abs-hollow-left
(make-instance 'telephone-line-subseparator
:axis-func (telephone-line-complement abs)
- :alt-char #xe0b1))
+ :alt-separator telephone-line-u-abs-hollow-left))
(defvar telephone-line-cubed-right
(make-instance 'telephone-line-separator
diff --git a/telephone-line-utils.el b/telephone-line-utils.el
index 7c631bfaa9..d30c42d15f 100644
--- a/telephone-line-utils.el
+++ b/telephone-line-utils.el
@@ -142,12 +142,15 @@ color1 and color2."
`(lambda (x)
(- (,func x))))
+(defclass telephone-line-unicode-separator ()
+ ((char :initarg :char)
+ (inverse-video :initarg :inverse-video :initform t)))
+
(defclass telephone-line-separator ()
((axis-func :initarg :axis-func)
(pattern-func :initarg :pattern-func :initform #'telephone-line-row-pattern)
(forced-width :initarg :forced-width :initform nil)
- (alt-char :initarg :alt-char)
- (inverse-video :initarg :inverse-video :initform t)
+ (alt-separator :initarg :alt-separator)
(image-cache :initform (make-hash-table :test 'equal :size 10))))
(cl-defmethod telephone-line-separator-height ((obj telephone-line-separator))
@@ -215,18 +218,20 @@ If it doesn't exist, create and cache it."
background foreground))
(oref obj image-cache)))))
-(cl-defmethod telephone-line-separator-render-unicode ((obj
telephone-line-separator) foreground background)
- (list :propertize (char-to-string (oref obj alt-char))
- 'face (list :foreground foreground
- :background background
- :inverse-video (oref obj inverse-video))))
+(cl-defmethod telephone-line-separator-render ((obj
telephone-line-unicode-separator) foreground background)
+ (let ((fg-color (telephone-line-separator--arg-handler foreground))
+ (bg-color (telephone-line-separator--arg-handler background)))
+ (list :propertize (char-to-string (oref obj char))
+ 'face (list :foreground fg-color
+ :background bg-color
+ :inverse-video (oref obj inverse-video)))))
(cl-defmethod telephone-line-separator-render ((obj telephone-line-separator)
foreground background)
(let ((fg-color (telephone-line-separator--arg-handler foreground))
(bg-color (telephone-line-separator--arg-handler background)))
(if window-system
(telephone-line-separator-render-image obj fg-color bg-color)
- (telephone-line-separator-render-unicode obj fg-color bg-color))))
+ (telephone-line-separator-render (oref obj alt-separator) fg-color
bg-color))))
(cl-defmethod telephone-line-separator-render ((obj
telephone-line-nil-separator) foreground background)
nil)
- [nongnu] elpa/telephone-line 70c113bea3 063/195: Version Bump, (continued)
- [nongnu] elpa/telephone-line 70c113bea3 063/195: Version Bump, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 797f257642 183/195: Wrap the segment in bound-and-true-p, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 1705f029c7 009/195: Better conform to existing standards, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 5968746a49 137/195: Added option to show window number in unicode., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 6e4e1e648b 151/195: Use built-in faces in flycheck-segment., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 1dc10acfc4 175/195: Apparently this is the only hook that's needed now?, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 356e7b8834 117/195: Update docstring for new axis, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line cdbe1a6be5 140/195: Merge pull request #62 from anandpiyer/master, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 3e73a0ed24 135/195: Add :args and :truncate segment modifiers, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line c17c71ae18 132/195: Add missing methods to telephone-line-unicode-separator, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 4885ebe7ae 130/195: Separate unicode separators out into their own class so they can be intermixed with XPM separators,
ELPA Syncer <=
- [nongnu] elpa/telephone-line 9dfaef65b2 020/195: Formatting, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 80b642aee1 099/195: Add simple (no mouse bind) minor/major mode segments, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 45d97b4021 127/195: Oops, that was markdown format., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 9fe198d82c 008/195: Remove autoloads carried over from names, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line d486eb3398 055/195: More indentation fixes, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line dd5a939edd 035/195: Fix error in erc segment when erc is not loaded, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 5638edc4fa 032/195: Fix title typo, ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line b58e3d1e43 030/195: Probably improve Unicode separators., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line 54850e413d 105/195: Switch to create-trig-axis all the timeNow that the algorithm works properly, we can assume a trig axis -- no rounding errors means it'll still be clear for everything else., ELPA Syncer, 2022/01/05
- [nongnu] elpa/telephone-line a5c7225dad 088/195: Link to examples in readme, ELPA Syncer, 2022/01/05