From afa22f7ce71a818dd61cf3dc4c21b0c01b2e63fe Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 17 Aug 2010 22:18:40 +0200 Subject: [PATCH] * lisp/emacs-lisp/lisp.el (up-list): Obey forward-sexp-function if set. --- lisp/ChangeLog | 2 ++ lisp/emacs-lisp/lisp.el | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index db60b546e6d..2803ec0a488 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2010-08-17 Stefan Monnier + * 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. diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 4ef6dab8968..c728abab496 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -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) -- 2.39.2