From e44e373d300c23adac9b2606aac4fc7e11138fde Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 23 May 2011 13:40:16 -0300 Subject: [PATCH] * lisp/emacs-lisp/lisp.el (up-list): Fix forward movement. Fixes: debbugs:8708 --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/lisp.el | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1098bdd8224..31444f9c234 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-05-23 Stefan Monnier + + * emacs-lisp/lisp.el (up-list): Fix forward movement (bug#8708). + 2011-05-23 Ken Manheimer * allout.el (allout-inhibit-auto-fill-on-headline): Create new diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index ef0c49b8616..ece96fe2515 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -145,12 +145,12 @@ This command assumes point is not in a string or comment." (while (/= arg 0) (if (null forward-sexp-function) (goto-char (or (scan-lists (point) inc 1) (buffer-end arg))) - (condition-case err - (while (progn (setq pos (point)) - (forward-sexp inc) - (/= (point) pos))) - (scan-error (goto-char (nth 2 err)))) - (if (= (point) pos) + (condition-case err + (while (progn (setq pos (point)) + (forward-sexp inc) + (/= (point) pos))) + (scan-error (goto-char (nth (if (> arg 0) 3 2) err)))) + (if (= (point) pos) (signal 'scan-error (list "Unbalanced parentheses" (point) (point))))) (setq arg (- arg inc))))) -- 2.39.2