Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bug#11314: 24.1.50; Regression: incorrect Lisp indentation for `if' with `@@@@@@'

1 view
Skip to first unread message

Drew Adams

unread,
Apr 22, 2012, 8:56:10 PM4/22/12
to 11...@debbugs.gnu.org
emacs -Q

Type this into an Emacs Lisp buffer:

(if (alpha beta) C-j aaaaaa C-j bbbbbb

You get this:

(if (alpha beta)
aaaaaa
bbbbbb

That is correct. bbbbbb is indented correctly.

Now do the same thing, using @@@@@@ instead of aaaaaa. This is the
result - bbbbbb is indented incorrectly.

(if (alpha beta)
@@@@@@
bbbbbb

Yet @@@@@@ is a perfectly good symbol/variable name etc.

This regression was introduced in Emacs 22.


In GNU Emacs 24.1.50.1 (i386-mingw-nt5.1.2600)
of 2012-04-19 on MARVIN
Bzr revision: 107968 mon...@iro.umontreal.ca-20120419220225-gijdcbfxuiqy5dhb
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
`configure --with-gcc (4.6) --no-opt --enable-checking --cflags
-ID:/devel/emacs/libs/libXpm-3.5.8/include
-ID:/devel/emacs/libs/libXpm-3.5.8/src
-ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
-ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
-ID:/devel/emacs/libs/giflib-4.1.4-1/include
-ID:/devel/emacs/libs/jpeg-6b-4/include
-ID:/devel/emacs/libs/tiff-3.8.2-1/include
-ID:/devel/emacs/libs/gnutls-3.0.9/include
-ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include
-ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2'





Stefan Monnier

unread,
Apr 23, 2012, 8:58:58 PM4/23/12
to Drew Adams, 11...@debbugs.gnu.org
> Yet @@@@@@ is a perfectly good symbol/variable name etc.

FWIW, this is probably due to @ being special in the case of ,@, so if
we fix this, we should be careful not to reintroduce errors such as C-h v
trying to use "@foo" rather than "foo" when we're on ",@foo".


Stefan



Drew Adams

unread,
Apr 23, 2012, 9:21:22 PM4/23/12
to Stefan Monnier, 11...@debbugs.gnu.org
> > Yet @@@@@@ is a perfectly good symbol/variable name etc.
>
> FWIW, this is probably due to @ being special in the case of ,@,

That was my guess too.

> so if we fix this, we should be careful not to reintroduce
> errors

Yes. Except I hope you really mean "when", not "if".

> such as C-h v trying to use "@foo" rather than "foo" when
> we're on ",@foo".

Yes.

The fact that this is a regression might offer some hope (if you are the
optimistic sort): at one time it worked.

And `C-h v @foo' also works correctly in Emacs prior to Emacs 22. And `C-h v'
picks up `@foo' as the default value no matter where the cursor is on the chars
of `@foo'.




Drew Adams

unread,
Sep 16, 2012, 8:02:51 PM9/16/12
to Stefan Monnier, 11...@debbugs.gnu.org
ping




Stefan Kangas

unread,
Nov 1, 2019, 4:00:08 PM11/1/19
to Drew Adams, 11...@debbugs.gnu.org
found 11314 27.0.50
thanks

"Drew Adams" <drew....@oracle.com> writes:

> emacs -Q
>
> Type this into an Emacs Lisp buffer:
>
> (if (alpha beta) C-j aaaaaa C-j bbbbbb
>
> You get this:
>
> (if (alpha beta)
> aaaaaa
> bbbbbb
>
> That is correct. bbbbbb is indented correctly.
>
> Now do the same thing, using @@@@@@ instead of aaaaaa. This is the
> result - bbbbbb is indented incorrectly.
>
> (if (alpha beta)
> @@@@@@
> bbbbbb
>
> Yet @@@@@@ is a perfectly good symbol/variable name etc.
>
> This regression was introduced in Emacs 22.

I can reproduce this on current master.

Best regards,
Stefan Kangas



Andreas Schwab

unread,
Nov 1, 2019, 4:45:07 PM11/1/19
to Stefan Kangas, 11...@debbugs.gnu.org, Drew Adams
That's because @ has the prefix syntax flag (for ,@).

Andreas.

--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."



Drew Adams

unread,
Nov 1, 2019, 5:25:09 PM11/1/19
to Andreas Schwab, Stefan Kangas, 11...@debbugs.gnu.org
> >> (if (alpha beta)
> >> @@@@@@
> >> bbbbbb
> >>
> >> Yet @@@@@@ is a perfectly good symbol/variable name etc.
> >> This regression was introduced in Emacs 22.
> >
> > I can reproduce this on current master.
>
> That's because @ has the prefix syntax flag (for ,@).

That explains the implementation bug, I guess.

But there's no backquote or comma here.
And `@@@@@@' is just a normal symbol.

Just as we don't treat comma the same inside
and outside backquote (we raise an error for
the latter), ideally we shouldn't treat @ the
same inside and outside backquote (symbol
syntax for the latter).

And presumably the only uses of @ inside
backquote that should lead to different
indentation would only be when @ follows
comma.



0 new messages