emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/telephone-line 6789e79806 124/195: Define nil separator in


From: ELPA Syncer
Subject: [nongnu] elpa/telephone-line 6789e79806 124/195: Define nil separator in terms of a pattern func; fixes height support.
Date: Wed, 5 Jan 2022 02:59:37 -0500 (EST)

branch: elpa/telephone-line
commit 6789e79806a188e278af8fb27dc65a28dbaf7505
Author: Daniel Bordak <dbordak@fastmail.fm>
Commit: Daniel Bordak <dbordak@fastmail.fm>

    Define nil separator in terms of a pattern func; fixes height support.
---
 telephone-line-separators.el | 12 ++++++++++--
 telephone-line-utils.el      |  5 -----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/telephone-line-separators.el b/telephone-line-separators.el
index be0fce2b74..65a21bbecf 100644
--- a/telephone-line-separators.el
+++ b/telephone-line-separators.el
@@ -25,6 +25,16 @@
 (require 'color)
 (require 'telephone-line-utils)
 
+(defun telephone-line-row-pattern-nil (_ width)
+  "Create a block of 1s of WIDTH. _ is disregarded."
+  (make-list width 1))
+
+(defvar telephone-line-nil
+  (make-instance 'telephone-line-separator
+                 :axis-func #'identity
+                 :forced-width 1
+                 :pattern-func #'telephone-line-row-pattern-nil))
+
 (defun telephone-line-row-pattern-fixed-gradient (_ width)
   "Create a gradient bytestring of WIDTH.  _ is disregarded."
   (mapcar (lambda (num)
@@ -120,8 +130,6 @@
 (defvar telephone-line-identity-hollow-left
   (make-instance 'telephone-line-subseparator :axis-func #'-))
 
-(defvar telephone-line-nil
-  (make-instance 'telephone-line-nil-separator))
 
 (provide 'telephone-line-separators)
 ;;; telephone-line-separators.el ends here
diff --git a/telephone-line-utils.el b/telephone-line-utils.el
index ca57b807b0..7301879c81 100644
--- a/telephone-line-utils.el
+++ b/telephone-line-utils.el
@@ -160,8 +160,6 @@ color1 and color2."
   ((pattern-func :initarg :pattern-func
                  :initform #'telephone-line-row-pattern-hollow)))
 
-(defclass telephone-line-nil-separator (telephone-line-separator) ())
-
 (cl-defmethod telephone-line-separator-create-body ((obj 
telephone-line-separator))
   "Create a bytestring of a PBM image body of dimensions WIDTH and HEIGHT, and 
shape created from AXIS-FUNC and PATTERN-FUNC."
   (let* ((height (telephone-line-separator-height obj))
@@ -227,9 +225,6 @@ If it doesn't exist, create and cache it."
         (telephone-line-separator-render-image obj fg-color bg-color)
       (telephone-line-separator-render-unicode obj fg-color bg-color))))
 
-(cl-defmethod telephone-line-separator-render ((obj 
telephone-line-nil-separator) foreground background)
-  nil)
-
 (cl-defmethod telephone-line-separator-clear-cache ((obj 
telephone-line-separator))
   (clrhash (oref obj image-cache)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]