diff options
| author | Juri Linkov | 2011-09-10 14:28:19 +0300 |
|---|---|---|
| committer | Juri Linkov | 2011-09-10 14:28:19 +0300 |
| commit | 056e44efe83c4740668f631372a2a87169ea0133 (patch) | |
| tree | cbe200e76449b8cf1ae1717691a8cae0814c1cfa | |
| parent | c3760c17bd1d2b81a05c50c1b1f7236fc34adb33 (diff) | |
| download | emacs-056e44efe83c4740668f631372a2a87169ea0133.tar.gz emacs-056e44efe83c4740668f631372a2a87169ea0133.zip | |
* lisp/paren.el (show-paren-function): Don't show escaped parens.
Let-bind `unescaped' to `t' when paren is not escaped.
Fixes: debbugs:9461
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/paren.el | 20 |
2 files changed, 20 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d1a219dfb8d..311c02e64b3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-09-10 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * paren.el (show-paren-function): Don't show escaped parens. | ||
| 4 | Let-bind `unescaped' to `t' when paren is not escaped. (Bug#9461) | ||
| 5 | |||
| 1 | 2011-09-10 Eli Zaretskii <eliz@gnu.org> | 6 | 2011-09-10 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * mail/sendmail.el (mml-to-mime, mml-attach-file) | 8 | * mail/sendmail.el (mml-to-mime, mml-attach-file) |
diff --git a/lisp/paren.el b/lisp/paren.el index 8bd96b9317a..fb5c0bf36e9 100644 --- a/lisp/paren.el +++ b/lisp/paren.el | |||
| @@ -135,13 +135,23 @@ in `show-paren-style' after `show-paren-delay' seconds of Emacs idle time." | |||
| 135 | ;; and show it until input arrives. | 135 | ;; and show it until input arrives. |
| 136 | (defun show-paren-function () | 136 | (defun show-paren-function () |
| 137 | (if show-paren-mode | 137 | (if show-paren-mode |
| 138 | (let ((oldpos (point)) | 138 | (let* ((oldpos (point)) |
| 139 | (dir (cond ((eq (syntax-class (syntax-after (1- (point)))) 5) -1) | 139 | (dir (cond ((eq (syntax-class (syntax-after (1- (point)))) 5) -1) |
| 140 | ((eq (syntax-class (syntax-after (point))) 4) 1))) | 140 | ((eq (syntax-class (syntax-after (point))) 4) 1))) |
| 141 | pos mismatch face) | 141 | (unescaped |
| 142 | (when dir | ||
| 143 | ;; Verify an even number of quoting characters precede the paren. | ||
| 144 | ;; Follow the same logic as in `blink-matching-open'. | ||
| 145 | (= (if (= dir -1) 1 0) | ||
| 146 | (logand 1 (- (point) | ||
| 147 | (save-excursion | ||
| 148 | (if (= dir -1) (forward-char -1)) | ||
| 149 | (skip-syntax-backward "/\\") | ||
| 150 | (point))))))) | ||
| 151 | pos mismatch face) | ||
| 142 | ;; | 152 | ;; |
| 143 | ;; Find the other end of the sexp. | 153 | ;; Find the other end of the sexp. |
| 144 | (when dir | 154 | (when unescaped |
| 145 | (save-excursion | 155 | (save-excursion |
| 146 | (save-restriction | 156 | (save-restriction |
| 147 | ;; Determine the range within which to look for a match. | 157 | ;; Determine the range within which to look for a match. |