emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r101510: * lisp/simple.el (blink-matc


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101510: * lisp/simple.el (blink-matching-open): Use syntax-class.
Date: Mon, 20 Sep 2010 23:45:09 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101510
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2010-09-20 23:45:09 +0200
message:
  * lisp/simple.el (blink-matching-open): Use syntax-class.
  * lisp/emacs-lisp/lisp.el (up-list): Don't do nothing silently.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/lisp.el
  lisp/simple.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-09-20 14:57:01 +0000
+++ b/lisp/ChangeLog    2010-09-20 21:45:09 +0000
@@ -1,5 +1,9 @@
 2010-09-20  Stefan Monnier  <address@hidden>
 
+       * emacs-lisp/lisp.el (up-list): Don't do nothing silently.
+
+       * simple.el (blink-matching-open): Use syntax-class.
+
        * progmodes/pascal.el (pascal-mode): Use define-derived-mode.
        Set invisibility spec for pascal's outline mode.
        (pascal-outline-change): Clean up calling convention.

=== modified file 'lisp/emacs-lisp/lisp.el'
--- a/lisp/emacs-lisp/lisp.el   2010-08-29 16:17:13 +0000
+++ b/lisp/emacs-lisp/lisp.el   2010-09-20 21:45:09 +0000
@@ -141,15 +141,19 @@
 This command assumes point is not in a string or comment."
   (interactive "^p")
   (or arg (setq arg 1))
-  (let ((inc (if (> arg 0) 1 -1)))
+  (let ((inc (if (> arg 0) 1 -1))
+        pos)
     (while (/= arg 0)
-      (if forward-sexp-function
+      (if (null forward-sexp-function)
+          (goto-char (or (scan-lists (point) inc 1) (buffer-end arg)))
           (condition-case err
-              (while (let ((pos (point)))
+              (while (progn (setq pos (point))
                        (forward-sexp inc)
                        (/= (point) pos)))
             (scan-error (goto-char (nth 2 err))))
-        (goto-char (or (scan-lists (point) inc 1) (buffer-end arg))))
+        (if (= (point) pos)
+            (signal 'scan-error
+                    (list "Unbalanced parentheses" (point) (point)))))
       (setq arg (- arg inc)))))
 
 (defun kill-sexp (&optional arg)

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2010-09-14 14:41:53 +0000
+++ b/lisp/simple.el    2010-09-20 21:45:09 +0000
@@ -5525,9 +5525,10 @@
                         ;; backward-sexp skips backward over prefix chars,
                         ;; so move back to the matching paren.
                         (while (and (< (point) (1- oldpos))
-                                    (let ((code (car (syntax-after (point)))))
-                                      (or (eq (logand 65536 code) 6)
-                                          (eq (logand 1048576 code) 1048576))))
+                                    (let ((code (syntax-after (point))))
+                                      (or (eq (syntax-class code) 6)
+                                          (eq (logand 1048576 (car code))
+                                              1048576))))
                           (forward-char 1))
                         (point))
                     (error nil))))))


reply via email to

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