[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/indent-bars 29d32e5718 241/431: Make style variables gl
From: |
ELPA Syncer |
Subject: |
[elpa] externals/indent-bars 29d32e5718 241/431: Make style variables global and move remaps to buffer-local vars |
Date: |
Mon, 16 Sep 2024 12:59:33 -0400 (EDT) |
branch: externals/indent-bars
commit 29d32e5718f34bfaf64166e38c60c1ca8eeb1c0e
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
Make style variables global and move remaps to buffer-local vars
---
indent-bars.el | 69 +++++++++++++++++++++++++++++++++++-----------------------
1 file changed, 42 insertions(+), 27 deletions(-)
diff --git a/indent-bars.el b/indent-bars.el
index 0400cdbf77..2cd2b3e85b 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -471,7 +471,7 @@ returned."
((color-defined-p el) el)
(t nil)))))
;;;; Style
-(defvar-local indent-bars-style nil
+(defvar indent-bars-style nil
"The `indent-bars-style' struct for the main style.")
(defvar indent-bars--styles nil
@@ -503,18 +503,33 @@ May be nil, a color string or a vector of colors
strings.")
( stipple-face nil :type face
:documentation "A stipple face to inherit from.")
( no-stipple-chars nil
- :documentation "A vector of style non-stipple chars.")
- ;; Current depth remapping
- ( remap nil :type list
- :documentation "An active face-remap cookie for faces.")
- ( remap-stipple nil :type list
- :documentation "An active face-remap cookie for stipple.")
+ :documentation "A vector of styled non-stipple chars.")
+ ;; Current depth highlighting
+ ( current-stipple-face nil :type face
+ :documentation "A current depth stipple face to inherit from.")
( current-bg-color nil :type color
:documentation "The background color of the current depth highlight.")
( current-depth-palette nil
- :documentation "Depth palette of current highlight colors.")
- ( current-depth-stipple nil :type list
- :documentation "The stipple pattern for the current depth."))
+ :documentation "Depth palette of highlighted colors."))
+
+(defvar-local indent-bars--remaps nil
+ "An alist of active face-remap cookie for faces.
+Keyed by style tag (nil for the main style). These remaps are
+used to change the current depth highlight.")
+
+(defvar-local indent-bars--stipple-remaps nil
+ "A hash table of active face-remap cookies for stipples.
+The hash table is keyed by the `whr': an integer composing font
+width, height, and window starting offset (see
+`indent-bars--whr'). Element of the hash table are plist with
+the following keys:
+
+ (:main[-styletag] ... :current[-styletag] ...)
+
+These are used to update relevant stipples for main and current
+stipple faces for the various styles as character size and/or
+window pixel start (pattern rotation) change, due to window
+layout of font size changes.")
(defun indent-bars--new-style (&optional tag)
"Create and record a new style struct with TAG."
@@ -738,6 +753,23 @@ NAME is a string, and ALT and be a string or nil."
(intern (format "indent-bars%s-%s"
(if alt (concat "-" alt) "") name)))
+(defun indent-bars--style1 (style name)
+ "Return the value of style variable NAME for STYLE.
+Considers ([no-]inherit . rest) inheritance."
+ (let* ((tag (ibs/tag style))
+ (sym (indent-bars--alt name tag))
+ (val (symbol-value sym))
+ (inhrt t)) ; inherit by default
+ (when tag
+ ;; Check for the ([no-]inherit . actual-val) form
+ (when (and (consp val) (memq (car val) '(inherit no-inherit)))
+ (setq inhrt (and (car val) (not (eq (car val) 'no-inherit)))
+ val (cdr val)))
+ (when inhrt
+ (setq val (indent-bars--custom-inherit
+ (symbol-value (indent-bars--alt name nil)) val))))
+ val))
+
(defun indent-bars--style (style name)
"Return the value of style variable NAME for STYLE.
Determines variables to use based on the style tag. For style
@@ -780,23 +812,6 @@ returned."
(t new)))
-(defun indent-bars--style1 (style name)
- "Return the value of style variable NAME for STYLE.
-Considers ([no-]inherit . rest) inheritance."
- (let* ((tag (indent-bars-style-tag style))
- (sym (indent-bars--alt name tag))
- (val (symbol-value sym))
- (inhrt t)) ; inherit by default
- (when tag
- ;; Check for the ([no-]inherit . actual-val) form
- (when (and (consp val) (memq (car val) '(inherit no-inherit)))
- (setq inhrt (and (car val) (not (eq (car val) 'no-inherit)))
- val (cdr val)))
- (when inhrt
- (setq val (indent-bars--custom-inherit
- (symbol-value (indent-bars--alt name nil)) val))))
- val))
-
;;;; Indentation and Drawing
(defvar-local indent-bars-spacing nil)
(defvar-local indent-bars--offset nil)
- [elpa] externals/indent-bars 76875aef81 401/431: slightly tweak main bar pattern and blend, (continued)
- [elpa] externals/indent-bars 76875aef81 401/431: slightly tweak main bar pattern and blend, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars aade176740 412/431: Merge pull request #52 from brownts/feature/ada-gpr, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars ca71453ad0 407/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars db7d4ba51d 388/431: Protect against custom-set reentry, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 79c21f2999 429/431: Assign copyright to FSF, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 9fc2e57d38 420/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 852c12b1fe 430/431: README: mention ELPA, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 2d1d854dda 393/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars c02ded1991 406/431: Bump version, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 51f12b7c06 215/431: Correct depth calculation (again), ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 29d32e5718 241/431: Make style variables global and move remaps to buffer-local vars,
ELPA Syncer <=
- [elpa] externals/indent-bars fb1a0d6d1a 239/431: Merge pull request #39 from oxcl/main, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 5c06a2d47a 252/431: re-organize requires, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 06c9d7e380 274/431: TS scope update: use idle-timer instead, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 0d684be9eb 290/431: docs: custom vars doc improvmements, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 8787ebc872 300/431: Increase default TS out-of-scope color blend factor to 0.15, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 7c8d680619 348/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 29005e1bd0 317/431: Increase default color blend to 0.5, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 1a851b6503 345/431: remove ts-teardown hook function on teardown, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars c12c740153 346/431: Bump version, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 0af707c007 338/431: Update README.md, ELPA Syncer, 2024/09/16