[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/highlight-parentheses cccdfe0 28/49: Delete overlays in be
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/highlight-parentheses cccdfe0 28/49: Delete overlays in before-revert-hook and change-major-mode-hook |
Date: |
Sun, 15 Aug 2021 03:57:47 -0400 (EDT) |
branch: elpa/highlight-parentheses
commit cccdfe08635bfbe0cd7a79ec86ddb5a48a1b4b2d
Author: Constantin Kulikov <zxnotdead@gmail.com>
Commit: Constantin Kulikov <zxnotdead@gmail.com>
Delete overlays in before-revert-hook and change-major-mode-hook
---
highlight-parentheses.el | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/highlight-parentheses.el b/highlight-parentheses.el
index 1f40161..f7715e2 100644
--- a/highlight-parentheses.el
+++ b/highlight-parentheses.el
@@ -83,6 +83,9 @@ This is used to prevent analyzing the same context over and
over.")
"A timer initiating the movement of the `hl-paren-overlays'.")
(make-variable-buffer-local 'hl-paren-timer)
+(defun* hl-paren-delete-overlays (&optional (overlays hl-paren-overlays))
+ (mapc #'delete-overlay overlays))
+
(defun hl-paren-highlight ()
"Highlight the parentheses around point."
(unless (= (point) hl-paren-last-point)
@@ -99,7 +102,7 @@ This is used to prevent analyzing the same context over and
over.")
(move-overlay (pop overlays) (1- pos2) pos2)))
(error nil))
(goto-char pos))
- (mapc #'delete-overlay overlays))))
+ (hl-paren-delete-overlays overlays))))
(defcustom hl-paren-delay 0.137
"Fraction of seconds after which the `hl-paren-overlays' are adjusted.
@@ -120,17 +123,21 @@ overlays when scrolling or moving point by pressing and
holding
(define-minor-mode highlight-parentheses-mode
"Minor mode to highlight the surrounding parentheses."
nil " hl-p" nil
- (mapc 'delete-overlay hl-paren-overlays)
+ (hl-paren-delete-overlays)
(kill-local-variable 'hl-paren-overlays)
(kill-local-variable 'hl-paren-last-point)
(remove-hook 'post-command-hook 'hl-paren-initiate-highlight t)
+ (remove-hook 'before-revert-hook 'hl-paren-delete-overlays)
+ (remove-hook 'change-major-mode-hook 'hl-paren-delete-overlays)
(when (and highlight-parentheses-mode
;; Don't enable in *Messages* buffer.
;; https://github.com/tsdh/highlight-parentheses.el/issues/14
(not (eq major-mode 'messages-buffer-mode))
(not (string= (buffer-name) "*Messages*")))
(hl-paren-create-overlays)
- (add-hook 'post-command-hook 'hl-paren-initiate-highlight nil t)))
+ (add-hook 'post-command-hook 'hl-paren-initiate-highlight nil t)
+ (add-hook 'before-revert-hook 'hl-paren-delete-overlays)
+ (add-hook 'change-major-mode-hook 'hl-paren-delete-overlays)))
;;;###autoload
(define-globalized-minor-mode global-highlight-parentheses-mode
@@ -160,7 +167,7 @@ overlays when scrolling or moving point by pressing and
holding
(dolist (buffer (buffer-list))
(with-current-buffer buffer
(when hl-paren-overlays
- (mapc 'delete-overlay hl-paren-overlays)
+ (hl-paren-delete-overlays)
(setq hl-paren-overlays nil)
(hl-paren-create-overlays)
(let ((hl-paren-last-point -1)) ;; force update
- [nongnu] elpa/highlight-parentheses ce95ed5 08/49: Fixed bug causing last color not to be displayed., (continued)
- [nongnu] elpa/highlight-parentheses ce95ed5 08/49: Fixed bug causing last color not to be displayed., ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 02cb984 11/49: Clean up doc strings., ELPA Syncer, 2021/08/15
- [nongnu] elpa/highlight-parentheses 22ec446 12/49: (Finally) Bump version to 1.0.2., ELPA Syncer, 2021/08/15
- [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 <=
- [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, 2021/08/15
- [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