bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#28566: 25.2; show-paren error


From: Eli Zaretskii
Subject: bug#28566: 25.2; show-paren error
Date: Sat, 23 Sep 2017 14:09:55 +0300

> From: Live System User <address@hidden>
> Cc: address@hidden
> Date: Sat, 23 Sep 2017 06:43:10 -0400
> 
> ;; Show offscreen paren matches in the minibuffer
> (defadvice show-paren-function
>  (after show-matching-paren-offscreen activate)
>  "If the matching paren is offscreen, show the matching line in the
>    echo area. Has no effect if the character before point is not of
>    the syntax class ')'."
>  (interactive)
>  (let ((matching-text nil))
>    ;; Only call `blink-matching-open' if the character before point is a close
>    ;; parentheses type character. Otherwise, there's not really any point, and
>    ;; `blink-matching-open' would just echo "Mismatched parentheses", which 
> gets
>    ;; really annoying.
>    ;; (or ...) is a hack to handle (bobp, eobp) conditions under 24.x.
>    (if (char-equal (char-syntax
>                      (or (or (char-before (point)) (char-after (point))) ?0)
>                      ) ?\))
>        (setq matching-text (blink-matching-open)))
>    (if (not (null matching-text))
>        (message matching-text))))

The return value of blink-matching-open is not documented, so it could
be anything.  I'd suggest to replace the last 2 lines with

   (if (stringp matching-text)
       (message "%s" matching-text))

OK to close this bug report?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]