[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/highlight-parentheses a5eace2 32/49: Added option for high
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/highlight-parentheses a5eace2 32/49: Added option for highlighting adjacent parens. |
Date: |
Sun, 15 Aug 2021 03:57:48 -0400 (EDT) |
branch: elpa/highlight-parentheses
commit a5eace239618a7a16aa4bdc6109f7b01d12ef692
Author: Tim Perkins <tprk77@gmail.com>
Commit: Tim Perkins <tprk77@gmail.com>
Added option for highlighting 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..fcdb5ab 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 ((eq ?\) (preceding-char))
+ (backward-char 1))
+ ((eq ?\( (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 4d1a1cb 06/49: Bumped version to 1.0.1., (continued)
- [nongnu] elpa/highlight-parentheses 4d1a1cb 06/49: Bumped version to 1.0.1., ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 315a901 09/49: Add dir-locals file with code style settings., ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 22719ca 10/49: Add Emacs 24 to compatibility list., ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 7b4ba71 19/49: Add autoload marker for global mode., ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses f3d9dcc 16/49: Update copyright year., ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses f918444 18/49: Fix elisp-lint download URL., ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses f3b1acc 20/49: Merge #5., ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses cccdfe0 28/49: Delete overlays in before-revert-hook and change-major-mode-hook, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 5aa800a 26/49: Release version 1.1.0, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 52a8d36 33/49: Added other brackets, so it works with other languages., ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses a5eace2 32/49: Added option for highlighting adjacent parens.,
ELPA Syncer <=
- [nongnu] elpa/highlight-parentheses 891538d 48/49: Squash emacs 28 define-minor-mode warning; release 2.0.3, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses fdabfda 47/49: Remove cl-lib dependency since it's included in Emacs 24.3 anyhow; release 2.0.2, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 9a99a4b 42/49: Fix custom type error of highlight-parentheses-attributes, ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 3b4d2c6 46/49: Add .elpaignore, ELPA Syncer, 2021/08/15
- [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