all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "Mattias Engdegård" <mattiase@acm.org>, emacs-devel@gnu.org
Subject: Re: CPP indentation bikeshed (was: Emacs master build failing on RHEL 6.8)
Date: Wed, 8 May 2019 21:25:22 -0700	[thread overview]
Message-ID: <5415dddf-325e-52ae-f05a-9d952933738d@cs.ucla.edu> (raw)
In-Reply-To: <jwva7fwho6z.fsf-monnier+emacs@gnu.org>

Stefan Monnier wrote:
> CPP doesn't know anything about C's
> syntactic structure (such as {...} nesting)

That's going a bit too far, as cpp does knows about C's comments and about C's 
parentheses and commas. True, cpp pays no special attention to { and }.

My own feeling is that in cases like these, utility trumps philosophical 
consistency. When an '#if' is required but otherwise has the function of a plain 
'if', the code is clearer when indented consistently with plain 'if' as this 
gives the reader a simple and helpful visual cue: an indented "#" means that the 
preprocessor code is following the normal C syntactic structure, whereas an 
unindented "#" means the preprocessor code is unusual and is breaking the normal 
C structure. Always shoving the "#" to the left loses this useful information 
and forces the reader to work harder.



  reply	other threads:[~2019-05-09  4:25 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07 12:00 Emacs master build failing on RHEL 6.8 Kaushal Modi
2019-05-07 14:34 ` Eli Zaretskii
2019-05-07 14:41   ` Kaushal Modi
2019-05-07 15:13     ` Eli Zaretskii
2019-05-07 15:30       ` Stefan Monnier
2019-05-07 15:52         ` Eli Zaretskii
2019-05-07 16:01           ` Kaushal Modi
2019-05-07 18:22             ` Eli Zaretskii
2019-05-07 19:46               ` Kaushal Modi
2019-05-08  5:47                 ` Eli Zaretskii
2019-05-08  8:03                   ` Andreas Schwab
2019-05-08 11:42                   ` Kaushal Modi
2019-05-08 12:27                     ` Eli Zaretskii
2019-05-08 12:49                       ` Kaushal Modi
2019-05-08 13:05                         ` Eli Zaretskii
2019-05-08 15:07                           ` Kaushal Modi
2019-05-08 15:41                             ` Paul Eggert
2019-05-08 15:50                               ` Kaushal Modi
2020-02-14 19:49                                 ` WilliamKF
2020-02-14 20:44                                   ` Paul Eggert
2019-05-07 18:49         ` Mattias Engdegård
2019-05-08 15:57           ` Paul Eggert
2019-05-08 17:16             ` CPP indentation bikeshed (was: Emacs master build failing on RHEL 6.8) Stefan Monnier
2019-05-09  4:25               ` Paul Eggert [this message]
2019-05-07 17:37 ` Emacs master build failing on RHEL 6.8 martin rudalics
2019-05-07 18:20   ` Eli Zaretskii

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=5415dddf-325e-52ae-f05a-9d952933738d@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=mattiase@acm.org \
    --cc=monnier@iro.umontreal.ca \
    /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.