all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Keith Ponting" <k.ponting@aurix.com>
To: <bug-gnu-emacs@gnu.org>
Subject: bug#2205: electric-perl-terminator leaves point at beginning of line on error
Date: Thu, 5 Feb 2009 06:11:20 -0500	[thread overview]
Message-ID: <0368DB7855FE094FBFF313BE6BC5A810D485A1@BE02.exg3.exghost.com> (raw)


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) = @_;
	my $line="";
	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. 

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=/usr'
'--infodir=/usr/share/info' '--mandir=/usr/share/man'
'--localstatedir=/var' '--sharedstatedir=/var/lib'
'--libexecdir=/usr/lib' '--with-x=no' '--with-sound=no'
'--build=x86_64-suse-linux-gnu' 'build_alias=x86_64-suse-linux-gnu'
'CC=gcc' 'CFLAGS=-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2
-fstack-protector -funwind-tables -fasynchronous-unwind-tables -g
-D_GNU_SOURCE -std=gnu89 -pipe -fno-strict-aliasing -Wno-pointer-sign
-Wno-unused-variable -Wno-unused-label -Wno-unprototyped-calls
-DSYSTEM_PURESIZE_EXTRA=25000 	 -DSITELOAD_PURESIZE_EXTRA=10000 '
'LDFLAGS=''

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









             reply	other threads:[~2009-02-05 11:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-05 11:11 Keith Ponting [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-02-05 13:12 bug#2205: My fix does not quite work Keith Ponting
2011-10-05  5:30 ` bug#2205: electric-perl-terminator leaves point at beginning of line on error Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0368DB7855FE094FBFF313BE6BC5A810D485A1@BE02.exg3.exghost.com \
    --to=k.ponting@aurix.com \
    --cc=2205@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.