[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hl-block-mode d080364c64 58/64: Use a string for hl-block-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hl-block-mode d080364c64 58/64: Use a string for hl-block-bracket characters |
Date: |
Thu, 7 Jul 2022 12:00:10 -0400 (EDT) |
branch: elpa/hl-block-mode
commit d080364c642f273c783e14218ab2197d5d2a3ceb
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Use a string for hl-block-bracket characters
---
hl-block-mode.el | 17 +++++++----------
readme.rst | 8 +++-----
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/hl-block-mode.el b/hl-block-mode.el
index f7da776ad3..0e9b0d356b 100644
--- a/hl-block-mode.el
+++ b/hl-block-mode.el
@@ -41,10 +41,9 @@
(defgroup hl-block nil "Highlight nested blocks or brackets." :group
'convenience)
-(defcustom hl-block-bracket ?\{
- "Characters to use as a starting bracket (defaults to '{').
-Set to nil to use all brackets, a list of starting brackets is also supported."
- :type 'symbol)
+(defcustom hl-block-bracket "{"
+ "Characters to use as a starting bracket. Set to nil to use all brackets."
+ :type '(or null string))
(defcustom hl-block-delay 0.2 "Idle time to wait before highlighting (in
seconds)." :type 'float)
@@ -72,7 +71,7 @@ Useful for languages that use S-expressions to avoid overly
nested highlighting.
:type 'color)
;; For `bracket' draw style.
-(defcustom hl-block-bracket-face '(t (:inverse-video t))
+(defcustom hl-block-bracket-face '(:inverse-video t)
"Face used when `hl-block-style' is set to `bracket'."
:type 'face)
@@ -384,14 +383,12 @@ Argument BLOCK-LIST represents start-end ranges of
braces."
(hl-block--time-buffer-local-enable)
;; Setup brackets:
- ;; Keep as nil to match all brackets.
- (let ((bracket-orig hl-block-bracket))
+ ;; Keep as nil to match all brackets,
+ ;; use a string to convert the string to a list.
+ (let ((bracket-orig (append hl-block-bracket nil)))
;; Make a local, sanitized version of this variable.
(setq-local hl-block-bracket nil)
(when bracket-orig
- ;; Support single values.
- (unless (listp bracket-orig)
- (setq bracket-orig (list bracket-orig)))
;; Filter for recognized values.
(while bracket-orig
(let ((ch (pop bracket-orig)))
diff --git a/readme.rst b/readme.rst
index c661ee6763..8869e9e1dc 100644
--- a/readme.rst
+++ b/readme.rst
@@ -13,10 +13,8 @@ Available via `melpa <https://melpa.org/#/hl-block-mode>`__.
Options
=======
-``hl-block-bracket``: ``{``.
- (character) bracket to use, set to ``nil`` to match all bracket types.
-
- A list of characters is also supported.
+``hl-block-bracket``: ``"{"``.
+ (string or null) bracket to use, set to ``nil`` to match all bracket types.
``hl-block-delay``: ``0.2``
(float) delay in seconds until the drawing the block scope.
``hl-block-multi-line``: ``t``
@@ -35,7 +33,7 @@ Options
``'bracket``:
Highlight each bracket using a custom face, without changing the
background.
- ``hl-block-bracket-face``: ``'((t (:inverse-video t)))``
+ ``hl-block-bracket-face``: ``'(t (:inverse-video t))``
The face used to highlight brackets.
- [nongnu] elpa/hl-block-mode f2ec1f167a 46/64: Correct type of hl-block-color-tint, (continued)
- [nongnu] elpa/hl-block-mode f2ec1f167a 46/64: Correct type of hl-block-color-tint, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 2fb1cc165b 57/64: Simplify local bracket variable use, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 7e0452c768 64/64: Change URL to codeberg, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode a1c03970a0 59/64: Remove unnecessary requirement `seq`, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode d7e274c3f1 04/64: Update readme.rst, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode e7b5b014c9 10/64: Fix: localize hook & timer running when it shouldn't, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 28c9950a90 25/64: Fix for emacs 27, change in line highlighting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode c6341f404e 44/64: Cleanup: store range data in cons cells instead of lists, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode e7ab79e713 36/64: Cleanup: add code-sections, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 7e0c6954f9 52/64: readme: document draw styles, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode d080364c64 58/64: Use a string for hl-block-bracket characters,
ELPA Syncer <=
- [nongnu] elpa/hl-block-mode 3dd29cfbf2 63/64: Cleanup: use brief SPDX license, ELPA Syncer, 2022/07/07
- [nongnu] elpa/hl-block-mode 933cee11e3 02/64: Add readme, ELPA Syncer, 2022/07/07