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

[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.
 
 



reply via email to

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