From 95507dd4038ea9c704c155c81759f3fc0c568717 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 2 May 2022 11:02:01 +0200 Subject: [PATCH] Allow show-paren to show matching parentheses inside comments * lisp/paren.el (show-paren--default): Improve blinking when inside a comment (bug#5410). --- lisp/paren.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/paren.el b/lisp/paren.el index 4e67a4ea4f7..4c268dbf771 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -225,6 +225,13 @@ It is the default value of `show-paren-data-function'." (let* ((temp (show-paren--locate-near-paren)) (dir (car temp)) (outside (cdr temp)) + ;; If we're inside a comment, then we probably want to blink + ;; a matching parentheses in the comment. So don't ignore + ;; comments in that case. + (parse-sexp-ignore-comments + (if (ppss-comment-depth (syntax-ppss)) + nil + parse-sexp-ignore-comments)) pos mismatch here-beg here-end) ;; ;; Find the other end of the sexp. -- 2.39.5