Mercurial > emacs
comparison lisp/paren.el @ 58805:769c3bb23105
(show-paren-function): Fix last change (2004-12-02).
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 06 Dec 2004 19:04:58 +0000 |
parents | ffd48e9f6a57 |
children | d7252d4ac684 f2ebccfa87d4 |
comparison
equal
deleted
inserted
replaced
58804:9b0a547610a4 | 58805:769c3bb23105 |
---|---|
167 (setq pos nil))) | 167 (setq pos nil))) |
168 ;; If found a "matching" paren, see if it is the right | 168 ;; If found a "matching" paren, see if it is the right |
169 ;; kind of paren to match the one we started at. | 169 ;; kind of paren to match the one we started at. |
170 (when (integerp pos) | 170 (when (integerp pos) |
171 (let ((beg (min pos oldpos)) (end (max pos oldpos))) | 171 (let ((beg (min pos oldpos)) (end (max pos oldpos))) |
172 (when (/= (char-syntax (char-after beg)) ?\$) | 172 (unless (eq (car (syntax-after beg)) 8) ;Not syntax `$'. |
173 (setq mismatch | 173 (setq mismatch |
174 (not (eq (or (cdr (get-text-property (1- end) 'syntax-table)) | 174 (not (or (eq (char-before end) |
175 (char-before end)) | 175 ;; This can give nil. |
176 ;; This can give nil. | 176 (cdr (syntax-after beg))) |
177 (or (cdr (get-text-property beg 'syntax-table)) | 177 (eq (char-after beg) |
178 (matching-paren (char-after beg)))))))))))) | 178 ;; This can give nil. |
179 (cdr (syntax-after (1- end))))))))))))) | |
179 ;; | 180 ;; |
180 ;; Highlight the other end of the sexp, or unhighlight if none. | 181 ;; Highlight the other end of the sexp, or unhighlight if none. |
181 (if (not pos) | 182 (if (not pos) |
182 (progn | 183 (progn |
183 ;; If not at a paren that has a match, | 184 ;; If not at a paren that has a match, |