GNU bug report logs - #8708
24.0.50; up-list broken with custom forward-sexp-function

Previous Next

Package: emacs;

Reported by: Alan Malloy <alan.malloy <at> yieldbuild.com>

Date: Fri, 20 May 2011 19:58:03 UTC

Severity: normal

Found in version 24.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8708 in the body.
You can then email your comments to 8708 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8708; Package emacs. (Fri, 20 May 2011 19:58:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alan Malloy <alan.malloy <at> yieldbuild.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 20 May 2011 19:58:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alan Malloy <alan.malloy <at> yieldbuild.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; up-list broken with custom forward-sexp-function
Date: Fri, 20 May 2011 13:00:30 -0700
Steps to reproduce:

emacs -Q
Switch to *scratch* (or any buffer)
M-x lisp-mode

Enter text (), move point between parens
M-x up-list
Point successfully moves to after the close-paren

Move point back inside parens
M-: (setq forward-sexp-function
      (lambda (n)
        (let ((forward-sexp-function nil))
          (forward-sexp n))))
M-x up-list

Expected behavior:

Same as before, because this function has behavior identical to built-in
forward-sexp

Actual behavior:

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

Bug does not exist in 23.1.1; something in the 24 series adds special
handling in up-list that checks if forward-sexp-function is set and
causes it to behave differently if so. Apparently that different
behavior doesn't have the same net effect as the original behavior

In GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0)
 of 2011-05-18 on altair
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
d - s e x p - f u n c i o n t SPC DEL DEL DEL DEL DEL
t i o n SPC n i l ) ) C-b C-b C-b C-b C-b C-b C-b C-b
C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b
C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b
C-b C-b C-b C-f C-f n C-e C-b C-f DEL DEL ) ) DEL (
f o r w a r d - s e x p SPC n ) ) ) ) RET ESC x f o
TAB r TAB w TAB s e TAB x TAB RET ESC C-f ESC x u p
TAB l DEL - l i TAB RET ESC " DEL C-_ ESC : ESC p C-a
C-k C-_ C-g C-g C-f C-g ESC x v e r s i o n RET ESC
x l i s p SPC m o d e RET ESC x C-g ESC : ESC p RET
C-b C-b C-k C-_ ESC x p a r e d TAB RET m TAB o TAB
RET C-k ESC x u p SPC l i s t RET C-f ESC x ESC p RET
ESC x p a r e d TAB m TAB o TAB RET C-b ESC x u p -
l i TAB RET C-a ESC C-k C-_ C-f ESC C-k C-_ ESC C-k
ESC C-k ESC C-k ESC C-k C-_ C-_ ESC x ESC p RET DEL
DEL DEL ESC x u p TAB = - DEL DEL - l i TAB RET C-x
b * M e TAB RET C-a C-@ C-n C-e C-p C-e ESC w C-a C-f
C-f C-f ESC x r e p o TAB r TAB RET

Recent messages:
Paredit mode disabled
up-list: Scan error: "Unbalanced parentheses", 196, 196
Undo! [2 times]
forward-sexp: Scan error: "Containing expression ends prematurely", 193, 
194 [2 times]
Undo! [2 times]
up-list: Scan error: "Unbalanced parentheses", 196, 196
Making completion list...
up-list: Scan error: "Unbalanced parentheses", 193, 193
Mark set
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort mail-extr message sendmail rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums
mailabbrev mail-utils gmm-utils mailheader emacsbug url-util url-parse
auth-source eieio byte-opt bytecomp byte-compile assoc gnus-util
time-date password-cache url-vars mm-util mail-prsvr vc-git
multi-isearch jka-compr find-func help-fns two-column iso-transl
help-mode easymenu view paredit-autoloads package clojure-mode rx
regexp-opt cl paredit edmacro kmacro tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
loaddefs button minibuffer faces cus-face files text-properties overlay
md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)





Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Mon, 23 May 2011 16:42:02 GMT) Full text and rfc822 format available.

Notification sent to Alan Malloy <alan.malloy <at> yieldbuild.com>:
bug acknowledged by developer. (Mon, 23 May 2011 16:42:02 GMT) Full text and rfc822 format available.

Message #10 received at 8708-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alan Malloy <alan.malloy <at> yieldbuild.com>
Cc: 8708-done <at> debbugs.gnu.org
Subject: Re: bug#8708: 24.0.50;
	up-list broken with custom forward-sexp-function
Date: Mon, 23 May 2011 13:41:19 -0300
>>>>> "Alan" == Alan Malloy <alan.malloy <at> yieldbuild.com> 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  <monnier <at> iro.umontreal.ca>
+
+	* emacs-lisp/lisp.el (up-list): Fix forward movement (bug#8708).
+
 2011-05-23  Ken Manheimer  <ken.manheimer <at> gmail.com>
 
 	* 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)))))




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 21 Jun 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.