]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow show-paren to show matching parentheses inside comments
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 2 May 2022 09:02:01 +0000 (11:02 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 2 May 2022 09:02:54 +0000 (11:02 +0200)
* lisp/paren.el (show-paren--default): Improve blinking when
inside a comment (bug#5410).

lisp/paren.el

index 4e67a4ea4f7bbd11e193ff247437a17f210256b8..4c268dbf771eff6fcd54aef9b2be29eabcb044c8 100644 (file)
@@ -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.