From: Lars Ingebrigtsen Date: Mon, 2 May 2022 09:02:01 +0000 (+0200) Subject: Allow show-paren to show matching parentheses inside comments X-Git-Tag: emacs-29.0.90~1931^2~136 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=95507dd4038ea9c704c155c81759f3fc0c568717;p=emacs.git Allow show-paren to show matching parentheses inside comments * lisp/paren.el (show-paren--default): Improve blinking when inside a comment (bug#5410). --- 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.