[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/highlight-parentheses f0bd58c 35/49: Merge pull request #2
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/highlight-parentheses f0bd58c 35/49: Merge pull request #20 from tprk77/master |
Date: |
Sun, 15 Aug 2021 03:57:48 -0400 (EDT) |
branch: elpa/highlight-parentheses
commit f0bd58c8dadd2db703b7bfd09e911b5fda05b3df
Merge: c38885b 73b4aa7
Author: Tassilo Horn <tsdh@gnu.org>
Commit: GitHub <noreply@github.com>
Merge pull request #20 from tprk77/master
Optionally highlight adjacent parens
---
highlight-parentheses.el | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/highlight-parentheses.el b/highlight-parentheses.el
index bdffd37..0d602a0 100644
--- a/highlight-parentheses.el
+++ b/highlight-parentheses.el
@@ -1,6 +1,7 @@
;;; highlight-parentheses.el --- highlight surrounding parentheses
;;
;; Copyright (C) 2007, 2009, 2013 Nikolaj Schumacher
+;; Copyright (C) 2018 Tim Perkins
;;
;; Author: Nikolaj Schumacher <bugs * nschum de>
;; Maintainer: Tassilo Horn <tsdh@gnu.org>
@@ -69,6 +70,12 @@ The list starts with the inside parentheses and moves
outwards."
:set 'hl-paren-set
:group 'highlight-parentheses)
+(defcustom hl-paren-highlight-adjacent nil
+ "Highlight adjacent parentheses, just like show-paren-mode."
+ :type '(boolean)
+ :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
@@ -98,17 +105,19 @@ This is used to prevent analyzing the same context over
and over.")
(unless (= (point) hl-paren-last-point)
(setq hl-paren-last-point (point))
(let ((overlays hl-paren-overlays)
- pos1 pos2
- (pos (point)))
+ pos1 pos2)
(save-excursion
- (condition-case err
- (while (and (setq pos1 (cadr (syntax-ppss pos1)))
- (cdr overlays))
- (move-overlay (pop overlays) pos1 (1+ pos1))
- (when (setq pos2 (scan-sexps pos1 1))
- (move-overlay (pop overlays) (1- pos2) pos2)))
- (error nil))
- (goto-char pos))
+ (ignore-errors
+ (when hl-paren-highlight-adjacent
+ (cond ((memq (preceding-char) '(?\) ?\} ?\] ?\>))
+ (backward-char 1))
+ ((memq (following-char) '(?\( ?\{ ?\[ ?\<))
+ (forward-char 1))))
+ (while (and (setq pos1 (cadr (syntax-ppss pos1)))
+ (cdr overlays))
+ (move-overlay (pop overlays) pos1 (1+ pos1))
+ (when (setq pos2 (scan-sexps pos1 1))
+ (move-overlay (pop overlays) (1- pos2) pos2)))))
(hl-paren-delete-overlays overlays))))
(defcustom hl-paren-delay 0.137
- [nongnu] elpa/highlight-parentheses bef1bc2 14/49: Add configuration for travis-ci., (continued)
- [nongnu] elpa/highlight-parentheses bef1bc2 14/49: Add configuration for travis-ci., ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses e653594 15/49: Add README with travis build state., ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses d421e15 17/49: Add globalized highlight-parentheses-mode, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 8869fba 21/49: Fix slowdown by moving overlays less often., ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 5e1fa9d 22/49: Make overlays front-advancing, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 9b9137b 24/49: New defcustom: hl-paren-delay (see issue #12), ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses ebf8827 25/49: Fix Travis build incidator, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses c38885b 31/49: Merge pull request #18 from Bad-ptr/master, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 73b4aa7 34/49: Added angle brackets!, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 69c694a 30/49: Allow hl-paren- -[background-]colors, -attributes to be functions, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses f0bd58c 35/49: Merge pull request #20 from tprk77/master,
ELPA Syncer <=
- [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