From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Keith Ponting" Newsgroups: gmane.emacs.bugs Subject: bug#2205: electric-perl-terminator leaves point at beginning of line on error Date: Thu, 5 Feb 2009 06:11:20 -0500 Message-ID: <0368DB7855FE094FBFF313BE6BC5A810D485A1@BE02.exg3.exghost.com> Reply-To: Keith Ponting , 2205@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1233847106 31513 80.91.229.12 (5 Feb 2009 15:18:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Feb 2009 15:18:26 +0000 (UTC) To: Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 05 16:19:39 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LV60x-0002VN-2h for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Feb 2009 16:19:39 +0100 Original-Received: from localhost ([127.0.0.1]:51766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LV5zd-0005Yb-Vb for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Feb 2009 10:18:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LV3GZ-0004NJ-VF for bug-gnu-emacs@gnu.org; Thu, 05 Feb 2009 07:23:36 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LV3GZ-0004Mo-03 for bug-gnu-emacs@gnu.org; Thu, 05 Feb 2009 07:23:35 -0500 Original-Received: from [199.232.76.173] (port=60068 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LV3GY-0004Mi-PM for bug-gnu-emacs@gnu.org; Thu, 05 Feb 2009 07:23:34 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:59378) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LV3GY-0006Vb-69 for bug-gnu-emacs@gnu.org; Thu, 05 Feb 2009 07:23:34 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n15CNWhR012119; Thu, 5 Feb 2009 04:23:32 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n15CA46g008769; Thu, 5 Feb 2009 04:10:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: "Keith Ponting" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 05 Feb 2009 12:10:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 2205 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12338353056612 (code B ref -1); Thu, 05 Feb 2009 12:10:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 5 Feb 2009 12:01:45 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n15C1f5n006600 for ; Thu, 5 Feb 2009 04:01:43 -0800 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LV2vN-0004Xp-8a for bug-gnu-emacs@gnu.org; Thu, 05 Feb 2009 07:01:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LV2vK-0004Vd-5I for bug-gnu-emacs@gnu.org; Thu, 05 Feb 2009 07:01:40 -0500 Original-Received: from [199.232.76.173] (port=33902 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LV2vJ-0004VQ-TK for bug-gnu-emacs@gnu.org; Thu, 05 Feb 2009 07:01:37 -0500 Original-Received: from server107t.exghost.com ([69.20.26.51]:3725 helo=server107.appriver.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LV2vJ-0003Sd-CV for bug-gnu-emacs@gnu.org; Thu, 05 Feb 2009 07:01:37 -0500 Original-Received: by server107.appriver.com (CommuniGate Pro PIPE 5.2.0) with PIPE id 78311954; Thu, 05 Feb 2009 06:11:27 -0500 Original-Received: from [207.97.230.107] (HELO fe09.exg3.exghost.com) by server107.appriver.com (CommuniGate Pro SMTP 5.2.0) with ESMTP id 78311948 for bug-gnu-emacs@gnu.org; Thu, 05 Feb 2009 06:11:24 -0500 Original-Received: from BE02.exg3.exghost.com ([207.97.230.117]) by fe09.exg3.exghost.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 5 Feb 2009 06:09:13 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: electric-perl-terminator leaves point at beginning of line on error thread-index: AcmHgnlkwKA62ImDQCKcr4luRl3vYg== X-OriginalArrivalTime: 05 Feb 2009 11:09:13.0832 (UTC) FILETIME=[2DA90680:01C98782] X-Policy: GLOBAL - aurix.com X-Primary: k.ponting@aurix.com X-Note: This Email was scanned by AppRiver SecureTide X-ALLOW: k.ponting@aurix.com ALLOWED X-Virus-Scan: V- X-Note: Spam Tests Failed: X-Country-Path: UNITED STATES->UNITED STATES->UNITED STATES X-Note-Sending-IP: 207.97.230.107 X-Note-Reverse-DNS: fe09.exg3.exghost.com X-Note-WHTLIST: k.ponting@aurix.com X-Note: User Rule Hits: X-Note: Global Rule Hits: 94 95 96 97 101 102 170 X-Note: Mail Class: ALLOWEDSENDER X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ X-Greylist: delayed 2403 seconds by postgrey-1.27 at monty-python; Thu, 05 Feb 2009 07:01:36 EST X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Thu, 05 Feb 2009 07:23:35 -0500 X-Mailman-Approved-At: Thu, 05 Feb 2009 10:10:32 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:24970 Archived-At: Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: In perl mode, entering the line-end { at the point shown in the following closure: { sub tran { # start of transition my($e,%attrs) =3D @_; my $line=3D""; if ( "TURN" eq $attrs{level} ){ # typing the { at the end of the following line gives scan error # and leaves point at the beginning of line, which is a pain! # fixed by changing progn to save-excursion in electric-perl-terminator if ( exists($attrs{ } else if ($wantlevel eq $attrs{level}){ } } } causes the electric-perl-terminator function to stop with an error: forward-sexp: Scan error: "Unbalanced parentheses", 16, 410 but it leaves me at the _beginning_ of the line. This means that I cannot easily type in the line I want, which is: if ( exists($attrs{tag}) ){ instead when I type that sequence of characters without pausing I end up with: tag}) ){ if ( exists($attrs{ This also happens under emacs 21.3.1 on Linux and on a (modified) 22.3.1 on Windows.=20 It does not appear to happen in a number of simpler variants I tried of the above source, so I do not quite understand what is going on. A fix appears to be to replace the "progn" in electric-perl-terminator with "save-excursion", so that when perl-indent-line reports an error, the point remains where I want it. If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file /usr/share/emacs/22.3/etc/DEBUG for instructions. In GNU Emacs 22.3.1 (x86_64-suse-linux-gnu) of 2008-12-03 on build23 configured using `configure '--with-gcc' '--with-pop' '--without-hesiod' '--with-kerberos' '--with-kerberos5' '--with-leim' '--with-xim' '--with-system-malloc' '--prefix=3D/usr' '--infodir=3D/usr/share/info' '--mandir=3D/usr/share/man' '--localstatedir=3D/var' '--sharedstatedir=3D/var/lib' '--libexecdir=3D/usr/lib' '--with-x=3Dno' '--with-sound=3Dno' '--build=3Dx86_64-suse-linux-gnu' 'build_alias=3Dx86_64-suse-linux-gnu' 'CC=3Dgcc' 'CFLAGS=3D-fmessage-length=3D0 -O2 -Wall = -D_FORTIFY_SOURCE=3D2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -D_GNU_SOURCE -std=3Dgnu89 -pipe -fno-strict-aliasing -Wno-pointer-sign -Wno-unused-variable -Wno-unused-label -Wno-unprototyped-calls -DSYSTEM_PURESIZE_EXTRA=3D25000 -DSITELOAD_PURESIZE_EXTRA=3D10000 ' 'LDFLAGS=3D'' 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_GB.UTF-8 locale-coding-system: utf-8 default-enable-multibyte-characters: t Major mode: Perl Minor modes in effect: mouse-wheel-mode: t show-paren-mode: t encoded-kbd-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: ESC x r e p o r t - e m a c s - b u g RET Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. test.pl has auto save data; consider M-x recover-this-file Loading perl-mode...done Loading vc-cvs...done Loading mwheel...done Loading emacsbug... Loading regexp-opt...done Loading emacsbug...done Keith Ponting Aurix Ltd, Malvern WR14 3SZ UK