all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bizarre indentation behaviour (nonurgent)
@ 2002-09-16 11:09 Edward Welbourne
  0 siblings, 0 replies; only message in thread
From: Edward Welbourne @ 2002-09-16 11:09 UTC (permalink / raw)


This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers 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.

In GNU Emacs 21.2.1 (i386-debian-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2002-03-22 on raven, modified by Debian
configured using `configure  i386-debian-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --with-x=yes --with-x-toolkit=athena --without-gif'
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: C
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

In a C++ buffer, insert: <code>

class Foo {
	const int a, b, c;
public:
	Foo(int u, int v, int w)
		: a(u),
		  b(v),
		  c(w) {}
};

</code> and indent it all suitably for your C++ settings (e.g. run
M-x indent-region on it).

Now, position your cursor *on* the comma following b(v).
Hit tab and watch that line dedent itself.
Position the cursor anywhere else on the line, tab will put it back as
above.  You can get similarly surprising results from the above with

		: a(u)
		, b(v)
		, c(w) {}

but somehow they seem more excusable with this odd punctuation style !
[Which arises when the last few members needing initialised are only
conditionally compiled in; the last item before them mustn't end with
a comma, for when they're compiled out, so at least the first of the
extras needs its own pre-comma.]  This time, hitting tab with the
cursor to the left of (or on) the comma on b's line indents it as
shown; but to the right it's indented further (comma under a).

Note: this buglet is of negligible priority or importance, unless it
reveals other issues with the indentation code.  The work-around is
obvious and M-x indent-region Does The Right Thing in all cases. :^)
It's just weird behaviour you might benefit from knowing about ...

Recent input:
c : C-j F o o ( i n t SPC u , SPC i n t SPC v , SPC 
i n t SPC w ) C-j : SPC a ( u ) C-j C-/ , C-j b ( v 
) , C-j c ( s <backspace> w ) SPC { } C-n C-p C-p C-M-f 
TAB C-e TAB C-a TAB C-M-f C-M-f TAB C-a TAB C-x C-s 
M-> } ; C-n C-x o M-x e m a c s - b u g <tab> <M-backspace> 
r e <tab> <M-backspace> <M-backspace> r e p o <tab> 
r <tab> <return>

Recent messages:
Auto-saving...done
Auto-saving...done
Wrote /usr/local/home/eddy/qt-embed/doc/doc_man.h
Quit
(New file)
Undo! [2 times]
Wrote /usr/local/home/eddy/dummy.cpp
Mark set
Making completion list...
Loading emacsbug...done

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-09-16 11:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-16 11:09 bizarre indentation behaviour (nonurgent) Edward Welbourne

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.