[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/highlight-parentheses 7692039 29/49: Allow to specify face
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/highlight-parentheses 7692039 29/49: Allow to specify face attributes for each level of parens |
Date: |
Sun, 15 Aug 2021 03:57:47 -0400 (EDT) |
branch: elpa/highlight-parentheses
commit 7692039d7948dd8e0d1328c643caf758cf31d955
Author: Constantin Kulikov <zxnotdead@gmail.com>
Commit: Constantin Kulikov <zxnotdead@gmail.com>
Allow to specify face attributes for each level of parens
---
highlight-parentheses.el | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/highlight-parentheses.el b/highlight-parentheses.el
index f7715e2..60471bf 100644
--- a/highlight-parentheses.el
+++ b/highlight-parentheses.el
@@ -50,18 +50,25 @@
(defcustom hl-paren-colors
'("firebrick1" "IndianRed1" "IndianRed3" "IndianRed4")
"List of colors for the highlighted parentheses.
-The list starts with the the inside parentheses and moves outwards."
+The list starts with the inside parentheses and moves outwards."
:type '(repeat color)
:set 'hl-paren-set
:group 'highlight-parentheses)
(defcustom hl-paren-background-colors nil
"List of colors for the background highlighted parentheses.
-The list starts with the the inside parentheses and moves outwards."
+The list starts with the inside parentheses and moves outwards."
:type '(repeat color)
:set 'hl-paren-set
:group 'highlight-parentheses)
+(defcustom hl-paren-attributes nil
+ "List of face attributes for the highlighted parentheses.
+The list starts with the inside parentheses and moves outwards."
+ :type plist
+ :set 'hl-paren-set
+ :group 'highlight-parentheses)
+
(defface hl-paren-face nil
"Face used for highlighting parentheses.
Color attributes might be overriden by `hl-paren-colors' and
@@ -149,15 +156,23 @@ overlays when scrolling or moving point by pressing and
holding
(defun hl-paren-create-overlays ()
(let ((fg hl-paren-colors)
(bg hl-paren-background-colors)
+ (attr hl-paren-attributes)
attributes)
- (while (or fg bg)
+ (while (or fg bg attr)
(setq attributes (face-attr-construct 'hl-paren-face))
- (when (car fg)
- (setq attributes (plist-put attributes :foreground (car fg))))
+ (let ((car-fg (car fg))
+ (car-bg (car bg))
+ (car-attr (car attr)))
+ (loop for (key . (val . _rest)) on car-attr by #'cddr
+ do (setq attributes
+ (plist-put attributes key val)))
+ (when car-fg
+ (setq attributes (plist-put attributes :foreground car-fg)))
+ (when car-bg
+ (setq attributes (plist-put attributes :background car-bg))))
(pop fg)
- (when (car bg)
- (setq attributes (plist-put attributes :background (car bg))))
(pop bg)
+ (pop attr)
(dotimes (i 2) ;; front and back
(push (make-overlay 0 0 nil t) hl-paren-overlays)
(overlay-put (car hl-paren-overlays) 'font-lock-face attributes)))
- [nongnu] elpa/highlight-parentheses 21fd617 41/49: Update README, (continued)
- [nongnu] elpa/highlight-parentheses 21fd617 41/49: Update README, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses b335e9e 49/49: Don't exclude README.md from ELPA package, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 59ff08a 23/49: Merge pull request #11 from tsdh/master, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses ba48dac 36/49: Remove deprecated cl.el, fix compiler/linter nag, version bump, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 72283a2 45/49: Add highlight-parentheses property to our overlays, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses d871467 43/49: Adapt URL to sr.ht, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 23fe07f 39/49: Add LICENSE and screenshot, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 9d8f351 44/49: Release 2.0.1, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 013ac29 38/49: Fix errors due to forgotten version in define-obsolete-function/variable-alias, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses ac0fc4e 13/49: Protect against double initialization of mode., ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 7692039 29/49: Allow to specify face attributes for each level of parens,
ELPA Syncer <=
- [nongnu] elpa/highlight-parentheses a821a31 27/49: Don't enable highlight-parentheses-mode in *Messages*, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses e18f2c2 37/49: Declare cl-lib dependency; update Compatibility, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 723abf9 40/49: Add Makefile, ELPA Syncer, 2021/08/15