all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sam Steingold <sds@gnu.org>
Cc: Emacs Developers <emacs-devel@gnu.org>
Subject: Re: CC Mode 5.29 (); a recent incompatible identation change
Date: 26 May 2002 13:14:46 -0400	[thread overview]
Message-ID: <acr57t$8np$2@main.gmane.org> (raw)
In-Reply-To: <5bheku7wjm.fsf@lister.roxen.com>

> * In message <5bheku7wjm.fsf@lister.roxen.com>
> * On the subject of "Re: CC Mode 5.29 (); a recent incompatible identation change"
> * Sent on 26 May 2002 17:34:21 +0200
> * Honorable Martin Stjernholm <mast@lysator.liu.se> writes:
>
> Sam Steingold <sds@gnu.org> wrote:
> 
> > The identation of the following form has changed from
> > 
> >         foo(bar,baz, {
> >           zot;
> >         });
> > 
> > to
> > 
> >         foo(bar,baz, {
> >               zot;
> >             });
> > 
> > recently in the CVS emacs.
> > was it an intentional change?
> 
> Yes. It is to achieve better consistency with cases like this:
> 
>     foo(bar,baz,
> 	{
> 	    zot;
> 	});
>     foo(bar, {
> 	    zot;
> 	},
> 	baz);
> 
> where the latter previously was indented as:
> 
>     foo(bar, {
> 	zot;
>     },
> 	baz);
> 
> which imo looks odd, especially if "foo" is a long identifier or
> expression.

the new method gives _much_ larger indentation resulting in less
readable code, expecially when "foo" is _really_ long.

> > how to I revert it in my .emacs.el?
> 
> With something like this:
> 
>     (defun indent-to-boi (langelem)
>       (save-excursion
>         (goto-char (cdr langelem))
>         (back-to-indentation)
>         (vector (current-column))))
> 
>     (defun indent-to-boi+offset (langelem)
>       (save-excursion
>         (goto-char (cdr langelem))
>         (back-to-indentation)
>         (vector (+ (current-column) c-basic-offset))))
> 
>     (c-set-offset 'block-close 'indent-to-boi)
>     (c-set-offset 'statement-block-intro 'indent-to-boi+offset)

thanks.
it would be nice if there were a customization option, e.g.
`cc-mode-indent-statement-block', with-values 'boi (old) and
'statement+boi (new).

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.2 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Trespassers will be shot.  Survivors will be prosecuted.

  parent reply	other threads:[~2002-05-26 17:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <sa0sn4r7rdm.fsf@glip.premonitia.com>
2002-05-26 15:34 ` CC Mode 5.29 (); a recent incompatible identation change Martin Stjernholm
     [not found] ` <5bheku7wjm.fsf@lister.roxen.com>
2002-05-26 17:14   ` Sam Steingold [this message]
2002-05-26 17:15   ` Sam Steingold
     [not found]   ` <m38z66omp5.fsf@loiso.podval.org>
2002-05-26 17:40     ` Martin Stjernholm
2002-05-16 20:46 Sam Steingold

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='acr57t$8np$2@main.gmane.org' \
    --to=sds@gnu.org \
    --cc=emacs-devel@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.