[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/indent-bars 10ce56b4e0 255/431: Improve stipple docstri
From: |
ELPA Syncer |
Subject: |
[elpa] externals/indent-bars 10ce56b4e0 255/431: Improve stipple docstring and comment |
Date: |
Mon, 16 Sep 2024 12:59:35 -0400 (EDT) |
branch: externals/indent-bars
commit 10ce56b4e00203430ad68f523be8fb0547ea702b
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
Improve stipple docstring and comment
---
indent-bars.el | 56 ++++++++++++++++++++++++++++----------------------------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/indent-bars.el b/indent-bars.el
index ecf0aa86aa..ee88ae8bdd 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -515,12 +515,12 @@ May be nil, a color string or a vector of colors
strings.")
:documentation "Depth palette of highlighted colors."))
(defvar-local indent-bars--remaps nil
- "An alist of active face-remap cookie for faces.
+ "An alist of active face-remap cookies for faces.
Keyed by style tag (nil for the main style). These remaps are
-used to change the current depth highlight.")
+used to change the current depth highlight (aside from stipple changes).")
(defvar-local indent-bars--stipple-remaps nil
- "A hash table of active face-remap cookies for stipples.
+ "A hash table of active stipple face-remap cookies.
The hash table is keyed by the `whr', an integer composing font
width, height, and window starting offset (see
`indent-bars--whr'). Elements of the hash table are plists with
@@ -530,8 +530,9 @@ the following keys:
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.")
+window pixel start (pattern rotation \"rot\") change, due to
+window layout or font size changes. Note that all stipple
+attributes are set via filtered face remaps.")
(defsubst indent-bars--tag (format-str s &rest r)
"Tag FORMAT-STR with style S and return the associate interned symbol.
@@ -1149,41 +1150,40 @@ ROT should be less than W."
;;
;; Turning on :stipple for a character merely "opens a window" on that
;; frame-filling, repeating stipple pattern. Since the pattern starts
-;; outside the body (in literally the first frame pixel, typically in
-;; the fringe), you must consider the shift between the first pixel of
-;; a character and the first pixel of the repeating stipple block at
-;; that pixel position or above:
+;; outside the body (in literally the first frame pixel, typically
+;; within the fringe), you must consider the shift between the first
+;; pixel of a window character and the first pixel of the repeating
+;; stipple block at that pixel position or above:
;;
;; |<-frame edge |<---buffer/window edge
;; |<--w-->|<--w-->|<--w-->| w = pattern width
-;; | marg/fringe |<-chr->| chr = character width = w
+;; | marg+fringe |<-chr->| chr = character width = w
;; |<-g->| g = gutter offset of chr start, g<w
;;
;; Or, when the character width exceeds the margin/fringe offset:
;;
;; |<-frame edge |<---buffer/window edge
;; |<--------w-------->|<---------w-------->|
-;; | marg/fringe |<-------chr------->|
+;; | marg+fringe |<-------chr------->|
;; |<-----g----->|
;;
-;; So g = (mod marg/fringe w).
+;; So g = (mod marg+fringe w).
;;
-;; When the block/zigzag/whatever pattern is made, to align with
-;; characters, it must get shifted up (= right) by g bits, with carry
-;; over (wrap) around w=(window-font-width) bits (i.e the width of the
-;; bitmap). The byte/bit pattern is first-lowest-leftmost.
+;; When the block/zigzag/whatever stipple pattern is made, to align
+;; with characters, it must get shifted up (= right) by g bits, with
+;; carry over (wrap) around w=(window-font-width) bits (i.e the width
+;; of the bitmap). The byte/bit pattern is first-lowest-leftmost.
;;
-;; Note that different window sides will often have different g
-;; values, which means the same bitmap cannot work for the buffer in
-;; both windows. So showing the same buffer side by side can lead to
-;; mis-alignment in the non-active buffer.
+;; Note that different windows may have different g values
+;; (e.g. left/right), which means the same bitmap cannot work for the
+;; buffer in both windows. In practice that means that all stipple
+;; face attributes must be set via filtered face remaps, with the
+;; filter set to match the pattern size (width and height) as well as
+;; gutter offset "rot" value in that window.
;;
-;; Solution: use window hooks to update the stipple bitmap as focus or
-;; windows change. So at least the focused buffer looks correct. If
-;; this is insufficient, use C-x 4 c
-;; (clone-indirect-buffer-other-window). A bug in Emacs <29 means
-;; `face-remapping-alist' is unintentionally shared between indirect
-;; and master buffers. Fixed in Emacs 29.
+;; Note: a bug in Emacs <29 means `face-remapping-alist' is
+;; unintentionally shared between indirect and master buffers. Fixed
+;; in Emacs 29.
(defun indent-bars--stipple (w h rot &optional style
width-frac pad-frac pattern zigzag)
@@ -1273,8 +1273,8 @@ is created for each active style, for both
:main[-styletag] and
1 nil
(apply-partially #'indent-bars--cleanup-stipple-remaps
(current-buffer)))))
-(defun indent-bars--text-scale ()
- "Update stipples on text scale."
+(defun indent-bars--update-all-stipples ()
+ "Update all stipples for current buffer."
(dolist (w (get-buffer-window-list nil nil t))
(indent-bars--window-change w))
(indent-bars--schedule-remap-cleanup))
- [elpa] externals/indent-bars 1bf77531f2 257/431: Better handling of --styles on setup and teardown, (continued)
- [elpa] externals/indent-bars 1bf77531f2 257/431: Better handling of --styles on setup and teardown, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars e4ab2f8865 231/431: Prevent altering the original custom var during inherit, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 7d63303e27 275/431: current-indentation-depth: no takes no POS arg, use s-e, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 00ee9d62fe 250/431: Do not apply face-remap given new final face argument, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 7d415237d8 258/431: Use style correctly when setting main stipple face, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars aacb0a574b 279/431: docstring: treesit-wrap, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars c6f08762b2 273/431: Use min-lines 3 for TS scope, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d06e6e10da 268/431: Overhaul scope structure and logic, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars bfcc3fac50 271/431: assign update-depth-function in :success clause, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d883507335 270/431: docs: improve update-scope1 docstring, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 10ce56b4e0 255/431: Improve stipple docstring and comment,
ELPA Syncer <=
- [elpa] externals/indent-bars d7b56cf13f 284/431: Tweak PPSS logic, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d7c1bd96e4 287/431: use idle-timer for highlighted bar update too, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars e3ebe0d389 289/431: Remove window-state-change-functions hook on teardown, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars e12b91fe3f 295/431: doc: custom tweak, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 8855d462da 297/431: Add unspecified choice to simple custom vars too, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars dd4f7bd3ee 296/431: update-scope: consider no node or scope match as full-file, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 93a268799d 307/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars a78445ef7d 299/431: update copyrights, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d962712541 302/431: Update-name and relocate delay vars, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars def1e3e395 303/431: README: document v0.5 release, ELPA Syncer, 2024/09/16