From unknown Fri Jun 20 19:45:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8708: 24.0.50; up-list broken with custom forward-sexp-function Resent-From: Alan Malloy Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 May 2011 19:58:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8708 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 8708@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13059214313716 (code B ref -1); Fri, 20 May 2011 19:58:03 +0000 Received: (at submit) by debbugs.gnu.org; 20 May 2011 19:57:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QNVos-0000xt-HN for submit@debbugs.gnu.org; Fri, 20 May 2011 15:57:10 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QNVoq-0000xh-Tc for submit@debbugs.gnu.org; Fri, 20 May 2011 15:57:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNVok-00061C-Vc for submit@debbugs.gnu.org; Fri, 20 May 2011 15:57:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:58277) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNVok-000618-UH for submit@debbugs.gnu.org; Fri, 20 May 2011 15:57:02 -0400 Received: from eggs.gnu.org ([140.186.70.92]:56917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNVoj-0002dq-OU for bug-gnu-emacs@gnu.org; Fri, 20 May 2011 15:57:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNVoi-00060t-Ki for bug-gnu-emacs@gnu.org; Fri, 20 May 2011 15:57:01 -0400 Received: from mail-pz0-f41.google.com ([209.85.210.41]:34964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNVoi-00060a-Cl for bug-gnu-emacs@gnu.org; Fri, 20 May 2011 15:57:00 -0400 Received: by pzk4 with SMTP id 4so2476940pzk.0 for ; Fri, 20 May 2011 12:56:58 -0700 (PDT) Received: by 10.68.36.199 with SMTP id s7mr17468pbj.131.1305921418384; Fri, 20 May 2011 12:56:58 -0700 (PDT) Received: from [192.168.1.18] ([38.111.148.242]) by mx.google.com with ESMTPS id h4sm2637066pbj.2.2011.05.20.12.56.56 (version=SSLv3 cipher=OTHER); Fri, 20 May 2011 12:56:57 -0700 (PDT) Message-ID: <4DD6C85E.7020103@malloys.org> Date: Fri, 20 May 2011 13:00:30 -0700 From: Alan Malloy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) 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) From unknown Fri Jun 20 19:45:15 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Alan Malloy Subject: bug#8708: closed (Re: bug#8708: 24.0.50; up-list broken with custom forward-sexp-function) Message-ID: References: <4DD6C85E.7020103@malloys.org> X-Gnu-PR-Message: they-closed 8708 X-Gnu-PR-Package: emacs Reply-To: 8708@debbugs.gnu.org Date: Mon, 23 May 2011 16:42:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1306168922-23180-1" This is a multi-part message in MIME format... ------------=_1306168922-23180-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #8708: 24.0.50; up-list broken with custom forward-sexp-function which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 8708@debbugs.gnu.org. --=20 8708: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D8708 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1306168922-23180-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 8708-done) by debbugs.gnu.org; 23 May 2011 16:41:30 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QOYCA-000615-Jr for submit@debbugs.gnu.org; Mon, 23 May 2011 12:41:30 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QOYC8-00060q-DG for 8708-done@debbugs.gnu.org; Mon, 23 May 2011 12:41:29 -0400 Received: from 213-159-126-200.fibertel.com.ar ([200.126.159.213]:51836 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QOYC3-0007Yr-1w; Mon, 23 May 2011 12:41:23 -0400 Received: by ceviche.home (Postfix, from userid 20848) id BF00566131; Mon, 23 May 2011 13:41:19 -0300 (ART) From: Stefan Monnier To: Alan Malloy Subject: Re: bug#8708: 24.0.50; up-list broken with custom forward-sexp-function Message-ID: References: <4DD6C85E.7020103@malloys.org> Date: Mon, 23 May 2011 13:41:19 -0300 In-Reply-To: <4DD6C85E.7020103@malloys.org> (Alan Malloy's message of "Fri, 20 May 2011 13:00:30 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: 8708-done Cc: 8708-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) >>>>> "Alan" == Alan Malloy 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 + + * 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 === 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))))) ------------=_1306168922-23180-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 20 May 2011 19:57:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QNVos-0000xt-HN for submit@debbugs.gnu.org; Fri, 20 May 2011 15:57:10 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QNVoq-0000xh-Tc for submit@debbugs.gnu.org; Fri, 20 May 2011 15:57:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNVok-00061C-Vc for submit@debbugs.gnu.org; Fri, 20 May 2011 15:57:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:58277) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNVok-000618-UH for submit@debbugs.gnu.org; Fri, 20 May 2011 15:57:02 -0400 Received: from eggs.gnu.org ([140.186.70.92]:56917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNVoj-0002dq-OU for bug-gnu-emacs@gnu.org; Fri, 20 May 2011 15:57:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNVoi-00060t-Ki for bug-gnu-emacs@gnu.org; Fri, 20 May 2011 15:57:01 -0400 Received: from mail-pz0-f41.google.com ([209.85.210.41]:34964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNVoi-00060a-Cl for bug-gnu-emacs@gnu.org; Fri, 20 May 2011 15:57:00 -0400 Received: by pzk4 with SMTP id 4so2476940pzk.0 for ; Fri, 20 May 2011 12:56:58 -0700 (PDT) Received: by 10.68.36.199 with SMTP id s7mr17468pbj.131.1305921418384; Fri, 20 May 2011 12:56:58 -0700 (PDT) Received: from [192.168.1.18] ([38.111.148.242]) by mx.google.com with ESMTPS id h4sm2637066pbj.2.2011.05.20.12.56.56 (version=SSLv3 cipher=OTHER); Fri, 20 May 2011 12:56:57 -0700 (PDT) Message-ID: <4DD6C85E.7020103@malloys.org> Date: Fri, 20 May 2011 13:00:30 -0700 From: Alan Malloy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: 24.0.50; up-list broken with custom forward-sexp-function Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) 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) ------------=_1306168922-23180-1--