unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Michael Heerdegen <michael_heerdegen@web.de>,
	33301@debbugs.gnu.org, Noam Postavsky <npostavs@gmail.com>
Subject: bug#33301: 27.0.50; broken elisp indentation for non-definition symbols starting with "def.."
Date: Sun, 23 Aug 2020 14:39:50 +0100	[thread overview]
Message-ID: <871rjxbhw9.fsf@gmail.com> (raw)
In-Reply-To: <87o8n1fszd.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 23 Aug 2020 14:26:46 +0200")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> João Távora <joaotavora@gmail.com> writes:
>
>> I wouldn't count 34 as "oodles" and don't think a new line for each
>> occurrence of what is essentially a breach of convention is a high
>> price to pay. Even converting some of those to macros or "make-foo"
>> could be worth it if it would enable non-surprising indentation.
>
> Changing functions to macros, or renaming functions from def* to make*,
> just because we have a slightly odd heuristic in Emacs Lisp mode doesn't
> sound quite right to me.

This wouldn't be the only reason to do that.  As I explained
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33301#51 this convention
is good in itself.

>> As for the problem of needing to load macros before indenting forms
>> where they appears, that's already very much a thing. We wouldn't be
>> creating new problems there, it's just the way it is.
>
> That's true, but it would exacerbate the problem.

Really doubt that. I think regular use of macros (like, say with-foo) is
prevalent enough that people already know not to mass-reindent existing
code anyway.

> But the main problem is that it would indent the code differently than
> it does now, and that leads to whitespace churn in the vc, which we
> should avoid unless we have a very, very good reason not to.

What exactly do you mean "whitespace churn"?  Can you illustrate this
hypothetical scenario?  I don't expect whitespace/indentation beyond
fixing the akward cases, at least that's the entire point of this
report.

> good enough reason...

It is a somewhat infrequent but annoying bug when one decides to use a
variable name that happens to start with "def".  I use "default" and
"deferred" a lot, for instance.  In Common Lisp mode, I don't have this
problem.

>> As for out-of-tree definitions, we could be lenient and have this
>> saner indentation be controlled by a variable which we would default
>> to 'insane, but to 'sane inside Emacs's source, via directory local
>> variables.
>
> I'd be against that -- again, because it leads to whitespace VC churn.

Again, I'm missing something: this option wouldn't lead to that, I think

João

PS: another entirely different approach would just limit the current
hacky heuristic to calls/expansions that happen at top-level, i.e. at
"column 0".  I believe this to be the vast majority (though not the
entirety) of cases.





  reply	other threads:[~2020-08-23 13:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 13:21 bug#33301: 27.0.50; broken elisp indentation for non-definition symbols starting with "def.." João Távora
2018-11-08  0:05 ` Noam Postavsky
2018-11-08  0:35   ` Michael Heerdegen
2018-11-08  9:52     ` João Távora
2018-11-09  0:13       ` Michael Heerdegen
2018-11-09  0:41         ` João Távora
2018-11-09  1:45           ` Michael Heerdegen
2018-11-09  9:04             ` João Távora
2018-11-09  9:51               ` Michael Heerdegen
2018-11-09 12:28                 ` Noam Postavsky
2018-11-09 19:39                   ` João Távora
2018-11-10  4:48                     ` Michael Heerdegen
2018-11-10 10:28                       ` João Távora
2018-11-10 10:54                     ` Andreas Schwab
2018-11-10 12:46                       ` João Távora
2018-11-10 12:53                         ` Andreas Schwab
2018-11-10 16:05                           ` João Távora
2018-11-10 16:18                             ` João Távora
2020-08-22 14:58                     ` Lars Ingebrigtsen
2020-08-22 16:19                       ` João Távora
2020-08-23 12:26                         ` Lars Ingebrigtsen
2020-08-23 13:39                           ` João Távora [this message]
2020-08-24 13:12                             ` Lars Ingebrigtsen
2020-08-25 19:59                               ` João Távora

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=871rjxbhw9.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=33301@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=michael_heerdegen@web.de \
    --cc=npostavs@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).