mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
* lisp/paren.el (show-paren-function): Don't show escaped parens.
Let-bind `unescaped' to `t' when paren is not escaped. Fixes: debbugs:9461
This commit is contained in:
parent
c3760c17bd
commit
056e44efe8
2 changed files with 20 additions and 5 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2011-09-10 Juri Linkov <juri@jurta.org>
|
||||
|
||||
* paren.el (show-paren-function): Don't show escaped parens.
|
||||
Let-bind `unescaped' to `t' when paren is not escaped. (Bug#9461)
|
||||
|
||||
2011-09-10 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* mail/sendmail.el (mml-to-mime, mml-attach-file)
|
||||
|
|
|
|||
|
|
@ -135,13 +135,23 @@ in `show-paren-style' after `show-paren-delay' seconds of Emacs idle time."
|
|||
;; and show it until input arrives.
|
||||
(defun show-paren-function ()
|
||||
(if show-paren-mode
|
||||
(let ((oldpos (point))
|
||||
(dir (cond ((eq (syntax-class (syntax-after (1- (point)))) 5) -1)
|
||||
((eq (syntax-class (syntax-after (point))) 4) 1)))
|
||||
pos mismatch face)
|
||||
(let* ((oldpos (point))
|
||||
(dir (cond ((eq (syntax-class (syntax-after (1- (point)))) 5) -1)
|
||||
((eq (syntax-class (syntax-after (point))) 4) 1)))
|
||||
(unescaped
|
||||
(when dir
|
||||
;; Verify an even number of quoting characters precede the paren.
|
||||
;; Follow the same logic as in `blink-matching-open'.
|
||||
(= (if (= dir -1) 1 0)
|
||||
(logand 1 (- (point)
|
||||
(save-excursion
|
||||
(if (= dir -1) (forward-char -1))
|
||||
(skip-syntax-backward "/\\")
|
||||
(point)))))))
|
||||
pos mismatch face)
|
||||
;;
|
||||
;; Find the other end of the sexp.
|
||||
(when dir
|
||||
(when unescaped
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
;; Determine the range within which to look for a match.
|
||||
|
|
|
|||
Loading…
Reference in a new issue