Subject: Re: bug#8708: 24.0.50; up-list broken with custom forward-sexp-function

From: Stefan Monnier <[email-masked]>
Date: Mon, 23 May 2011 13:41:19 -0300

>>>>> "Alan" == Alan Malloy <[email-masked]> writes:
> Move point back inside parens
> M-: (setq forward-sexp-function
>       (lambda (n)
>         (let ((forward-sexp-function nil))
>           (forward-sexp n))))
> M-x up-list

> Actual behavior:

> Point does not move, signal is raised, and error message is printed:
>       up-list: Scan error: "Unbalanced parentheses", 193, 193

Oops, indeed.  I installed the patch below into trunk, which should
fix it.  Thank you,

        Stefan

=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2011-05-23 15:03:04 +0000
+++ lisp/ChangeLog	2011-05-23 16:39:13 +0000
@@ -1,3 +1,7 @@
+2011-05-23  Stefan Monnier  <[email-masked]>
+
+	* emacs-lisp/lisp.el (up-list): Fix forward movement (bug#8708).
+
 2011-05-23  Ken Manheimer  <[email-masked]>
 
 	* allout.el (allout-inhibit-auto-fill-on-headline): Create new

=== modified file 'lisp/emacs-lisp/lisp.el'
--- lisp/emacs-lisp/lisp.el	2011-05-12 07:07:06 +0000
+++ lisp/emacs-lisp/lisp.el	2011-05-23 16:37:30 +0000
@@ -149,7 +149,7 @@
               (while (progn (setq pos (point))
                        (forward-sexp inc)
                        (/= (point) pos)))
-            (scan-error (goto-char (nth 2 err))))
+	  (scan-error (goto-char (nth (if (> arg 0) 3 2) err))))
         (if (= (point) pos)
             (signal 'scan-error
                     (list "Unbalanced parentheses" (point) (point)))))