[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/highlight-parentheses ac0fc4e 13/49: Protect against doubl
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/highlight-parentheses ac0fc4e 13/49: Protect against double initialization of mode. |
Date: |
Sun, 15 Aug 2021 03:57:44 -0400 (EDT) |
branch: elpa/highlight-parentheses
commit ac0fc4e79a261b60def3261185c6cabad9da90e8
Author: Nikolaj Schumacher <git@nschum.de>
Commit: Nikolaj Schumacher <git@nschum.de>
Protect against double initialization of mode.
---
highlight-parentheses.el | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/highlight-parentheses.el b/highlight-parentheses.el
index 2f4c2b5..5451fd5 100644
--- a/highlight-parentheses.el
+++ b/highlight-parentheses.el
@@ -32,6 +32,8 @@
;;
;;; Change Log:
;;
+;; Protect against double initialization (if used in `c-mode-hook').
+;;
;; 2013-03-22 (1.0.2)
;; Fixed bug causing last color not to be displayed.
;;
@@ -117,14 +119,13 @@ This is used to prevent analyzing the same context over
and over.")
(define-minor-mode highlight-parentheses-mode
"Minor mode to highlight the surrounding parentheses."
nil " hl-p" nil
- (if highlight-parentheses-mode
- (progn
- (hl-paren-create-overlays)
- (add-hook 'post-command-hook 'hl-paren-highlight nil t))
- (mapc 'delete-overlay hl-paren-overlays)
- (kill-local-variable 'hl-paren-overlays)
- (kill-local-variable 'hl-paren-last-point)
- (remove-hook 'post-command-hook 'hl-paren-highlight t)))
+ (mapc 'delete-overlay hl-paren-overlays)
+ (kill-local-variable 'hl-paren-overlays)
+ (kill-local-variable 'hl-paren-last-point)
+ (remove-hook 'post-command-hook 'hl-paren-highlight t)
+ (when highlight-parentheses-mode
+ (hl-paren-create-overlays)
+ (add-hook 'post-command-hook 'hl-paren-highlight nil t)))
;;; overlays
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- [nongnu] elpa/highlight-parentheses f0bd58c 35/49: Merge pull request #20 from tprk77/master, (continued)
- [nongnu] elpa/highlight-parentheses f0bd58c 35/49: Merge pull request #20 from tprk77/master, ELPA Syncer, 2021/08/15
- [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 <=
- [nongnu] elpa/highlight-parentheses 7692039 29/49: Allow to specify face attributes for each level of parens, ELPA Syncer, 2021/08/15
- [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