branch: elpa/highlight-parentheses commit 6a4119982dc2f030ac5c03581dc45d771dfe42a7 Author: Tassilo Horn <t...@gnu.org> Commit: Tassilo Horn <t...@gnu.org>
Fix error when timer fn runs in buffer where mode is not active Fixes: https://todo.sr.ht/~tsdh/highlight-parentheses.el/6 --- highlight-parentheses.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/highlight-parentheses.el b/highlight-parentheses.el index ccff799a34..25d261c78c 100644 --- a/highlight-parentheses.el +++ b/highlight-parentheses.el @@ -233,9 +233,11 @@ overlays in it instead." (throw 'no-change t)) (setq first-iteration nil))))) (highlight-parentheses--delete-overlays overlays)) - (setq highlight-parentheses--last-pair - (cons (overlay-start (car highlight-parentheses--overlays)) - (overlay-start (cadr highlight-parentheses--overlays))))))) + (let ((o1 (car highlight-parentheses--overlays)) + (o2 (cadr highlight-parentheses--overlays))) + (setq highlight-parentheses--last-pair + (cons (and o1 (overlay-start o1)) + (and o2 (overlay-start o2)))))))) (define-obsolete-function-alias 'hl-paren-initiate-highlight 'highlight-parentheses--initiate-highlight "2.0.0")