comparison lisp/simple.el @ 79094:a28250ba40a4

Re-fill copyright header. (blink-matching-open): Don't report false errors with the `$' syntax class.
author Glenn Morris <rgm@gnu.org>
date Tue, 16 Oct 2007 02:05:55 +0000
parents d7d95ec4c3f0
children 8c54d4a5d25a
comparison
equal deleted inserted replaced
79093:cc9515f436e3 79094:a28250ba40a4
1 ;;; simple.el --- basic editing commands for Emacs 1 ;;; simple.el --- basic editing commands for Emacs
2 2
3 ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3 ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4 ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 4 ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
5 ;; Free Software Foundation, Inc.
5 6
6 ;; Maintainer: FSF 7 ;; Maintainer: FSF
7 ;; Keywords: internal 8 ;; Keywords: internal
8 9
9 ;; This file is part of GNU Emacs. 10 ;; This file is part of GNU Emacs.
4483 blinkpos 4484 blinkpos
4484 message-log-max ; Don't log messages about paren matching. 4485 message-log-max ; Don't log messages about paren matching.
4485 matching-paren 4486 matching-paren
4486 open-paren-line-string 4487 open-paren-line-string
4487 old-start 4488 old-start
4488 new-start) 4489 new-start
4490 isdollar)
4489 (save-excursion 4491 (save-excursion
4490 (save-restriction 4492 (save-restriction
4491 ;; Don't search for matching paren within minibuffer prompt. 4493 ;; Don't search for matching paren within minibuffer prompt.
4492 (setq old-start (minibuffer-prompt-end)) 4494 (setq old-start (minibuffer-prompt-end))
4493 (setq new-start 4495 (setq new-start
4501 (not blink-matching-paren-dont-ignore-comments)))) 4503 (not blink-matching-paren-dont-ignore-comments))))
4502 (setq blinkpos (scan-sexps oldpos -1))) 4504 (setq blinkpos (scan-sexps oldpos -1)))
4503 (error nil))) 4505 (error nil)))
4504 (and blinkpos 4506 (and blinkpos
4505 ;; Not syntax '$'. 4507 ;; Not syntax '$'.
4506 (not (eq (syntax-class (syntax-after blinkpos)) 8)) 4508 (not (setq isdollar (eq (syntax-class (syntax-after blinkpos)) 8)))
4507 (setq matching-paren 4509 (setq matching-paren
4508 (let ((syntax (syntax-after blinkpos))) 4510 (let ((syntax (syntax-after blinkpos)))
4509 (and (consp syntax) 4511 (and (consp syntax)
4510 (eq (syntax-class syntax) 4) 4512 (eq (syntax-class syntax) 4)
4511 (cdr syntax))))) 4513 (cdr syntax)))))
4512 (cond 4514 (cond
4513 ((not blinkpos) 4515 ((not blinkpos)
4514 (unless (and blink-matching-paren-distance (> new-start old-start)) 4516 ;; Don't complain when `$' with no blinkpos, because it
4517 ;; could just be the first one in the buffer.
4518 (unless (or (eq (syntax-class (syntax-after (1- oldpos))) 8)
4519 (and blink-matching-paren-distance
4520 (> new-start old-start))
4515 ;; When `blink-matching-paren-distance' is non-nil and we 4521 ;; When `blink-matching-paren-distance' is non-nil and we
4516 ;; didn't find a matching paren within that many characters 4522 ;; didn't find a matching paren within that many characters
4517 ;; don't display a message. 4523 ;; don't display a message.
4518 (message "Unmatched parenthesis"))) 4524 (message "Unmatched parenthesis"))))
4519 ((not (or (eq matching-paren (char-before oldpos)) 4525 ;; isdollar is for:
4526 ;; http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00871.html
4527 ((not (or isdollar
4528 (eq matching-paren (char-before oldpos))
4520 ;; The cdr might hold a new paren-class info rather than 4529 ;; The cdr might hold a new paren-class info rather than
4521 ;; a matching-char info, in which case the two CDRs 4530 ;; a matching-char info, in which case the two CDRs
4522 ;; should match. 4531 ;; should match.
4523 (eq matching-paren (cdr (syntax-after (1- oldpos)))))) 4532 (eq matching-paren (cdr (syntax-after (1- oldpos))))))
4524 (message "Mismatched parentheses")) 4533 (message "Mismatched parentheses"))