From c5bfdab4769fc5ac92226aae20f000739d3671cd Mon Sep 17 00:00:00 2001 From: Brady McDonough Date: Sat, 28 Jan 2023 16:11:47 -0700 Subject: [PATCH] Starting on runtime errors, 2 immediate more to come --- tacc.el | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tacc.el b/tacc.el index 9ee274b..f876184 100644 --- a/tacc.el +++ b/tacc.el @@ -108,6 +108,8 @@ :group 'faces :prefix "tacc-") +;; Font/face inheritance is not well described anywhere in the elisp programming manual +;; Check emacs user manual? (defface tacc-graph-work '((t (:inherit 'success))) "For work graph bars" @@ -417,12 +419,16 @@ Note, if there is no tacc-buffer then you shouldn't be touching tacc-info" (+ len (if (<= ticker rem) 1 0))))) (defun gradient-string (width chars) - (mapconcat (let ((ticker 0)) - (lambda (c) (let ((rem (mod width (length chars))) - (len (/ width (length chars)))) - (make-string (progn (setf ticker (1+ ticker)) - (+ len (if (<= ticker rem) 1 0))) - c)))) + ;; ERROR: If I'm not mistaken mapconcat internally uses a call to eval + ;; In order for eval to respect lexical binding rules rather than dynamic ones + ;; it requires an optional argument to enable the feature. + ;; A look at the source is required and maybe a less "clever" solution should be found + (mapconcat (let ((ticker 0) + (rem (mod width (length chars))) + (len (/ width (length chars)))) + (lambda (c) + (make-string (+ len (if (<= (setq ticker (1+ ticker)) rem) 1 0)) + c))) chars "")) (defun tacc-header-render (width)