]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/lisp.el (up-list): Obey forward-sexp-function if set.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 17 Aug 2010 20:18:40 +0000 (22:18 +0200)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 17 Aug 2010 20:18:40 +0000 (22:18 +0200)
lisp/ChangeLog
lisp/emacs-lisp/lisp.el

index db60b546e6d72294963fb18bf660bb64425a0cbd..2803ec0a488fb656dfb5b633ef15546fb4152a7b 100644 (file)
@@ -1,5 +1,7 @@
 2010-08-17  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * emacs-lisp/lisp.el (up-list): Obey forward-sexp-function if set.
+
        Font-lock '...' strings, plus various simplifications and fixes.
        * progmodes/octave-mod.el (octave-font-lock-keywords): Use regexp-opt.
        (octave-font-lock-close-quotes): New function.
index 4ef6dab89682df583ca2b2a371a3cc2eae52b974..c728abab49697e927bdc8d36d34e4df7fea26cbe 100644 (file)
@@ -142,7 +142,13 @@ This command assumes point is not in a string or comment."
   (or arg (setq arg 1))
   (let ((inc (if (> arg 0) 1 -1)))
     (while (/= arg 0)
-      (goto-char (or (scan-lists (point) inc 1) (buffer-end arg)))
+      (if forward-sexp-function
+          (condition-case err
+              (while (let ((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))))
       (setq arg (- arg inc)))))
 
 (defun kill-sexp (&optional arg)