From: Eli Zaretskii <eliz@gnu.org>
To: Morgan Willcock <morgan@ice9.digital>
Cc: emacs-devel@gnu.org
Subject: Re: Accidental change of behaviour for electric-layout-mode?
Date: Wed, 25 Sep 2024 14:27:47 +0300 [thread overview]
Message-ID: <86jzf0c6rw.fsf@gnu.org> (raw)
In-Reply-To: <87r098n8n5.fsf@ice9.digital> (message from Morgan Willcock on Tue, 24 Sep 2024 20:39:42 +0100)
> From: Morgan Willcock <morgan@ice9.digital>
> Cc: emacs-devel@gnu.org
> Date: Tue, 24 Sep 2024 20:39:42 +0100
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> Patch is attached.
> >
> > Thanks, but shouldn't the new variable be a defcustom, i.e. a user
> > option? AFAIU, the preference is on the user level.
>
> I am following the lead of electric-layout-allow-duplicate-newlines
> which is not a user option.
Which ironically has the following comment:
;; TODO: Make this a defcustom?
(defvar electric-layout-allow-duplicate-newlines nil
So I think this new variable should be a defcustom, and maybe we
should also make electric-layout-allow-duplicate-newlines a defcustom.
> For my use case, electric-layout-rules is being set by a major-mode and
> the functions in those rules would need to be paired with the ability to
> insert a newline within a comment.
If you are saying that it never makes sense to modify the value of
this variable given specific rules, i.e. that any set of rules will
either always support embedded newlines or be unable to support them,
but will never be able to sensibly support both alternatives, then I
agree. (But in that case, why do we need a variable at all? why not
let the rules specify this directly?)
> If you needed another example of a major-mode configuring it,
> python-mode is also setting rules at the mode level:
>
> https://git.savannah.gnu.org/cgit/emacs.git/commit/lisp/progmodes/python.el?id=dfecd6037d5ebe5778c40ff7b38bfcbaa3ef779e
The way to let modes control this behavior to introduce an internal
variable which the mode could set and whose initial default value is
taken from the user option.
>
> If there is any doubt about the usage of the new variable I am happy to
> just put the original behaviour back and omit the new option for the
> moment.
Do you really have such strong feelings about this not being a user
option that you'd rather forget the whole issue? Why are you so
convinced that no user will ever want to customize this behavior, when
you are the first example of such users?
> > Also, this needs a NEWS entry.
>
> Does it need a NEWS entry if it is not a user option and the default
> behaviour is the same as Emacs 29?
Let's first agree about the option issue, and then get back to NEWS.
Thanks.
next prev parent reply other threads:[~2024-09-25 11:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-23 20:58 Accidental change of behaviour for electric-layout-mode? Morgan Willcock
2024-09-24 11:23 ` Eli Zaretskii
2024-09-24 12:12 ` João Távora
2024-09-24 12:59 ` Eli Zaretskii
2024-09-24 18:59 ` Morgan Willcock
2024-09-24 19:03 ` Eli Zaretskii
2024-09-24 19:39 ` Morgan Willcock
2024-09-25 11:27 ` Eli Zaretskii [this message]
2024-09-25 13:50 ` Morgan Willcock
2024-09-25 15:57 ` Eli Zaretskii
2024-10-03 16:22 ` Morgan Willcock
2024-10-03 18:06 ` Eli Zaretskii
2024-10-05 10:13 ` 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
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=86jzf0c6rw.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=morgan@ice9.digital \
/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).