[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs 26.1 release branch created
From: |
Paul Eggert |
Subject: |
Re: Emacs 26.1 release branch created |
Date: |
Mon, 25 Sep 2017 15:25:11 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 09/25/2017 01:24 PM, John Wiegley wrote:
Why not mention both ways of resolving the matter in the documentation?
(message "%s") for all the simple cases (which should be most of them), and
let-binding text-quoting-style for the complex cases.
Because the complex cases are where the let-binding style falls down.
For example, this plausible-looking code:
(let ((text-quoting-style 'grave))
(message "(setq coding-system '%S)"
(find-operation-coding-system 'write-region "x")))
is incorrect, because it changes the quoting style not just for the
message, but also for the internals of find-operation-coding-system,
internals that are unrelated to the message and which will behave
contrary to user preference. In contrast, this:
(message "%s" (format "(setq coding-system '%S)"
(find-operation-coding-system 'write-region "x")))
limits the style override to just the format, which is what is typically
wanted for messages.As the size of the 'let' increases, this sort of
error becomes more likely.
The let-binding approach is appropriate only for simple cases where you
know all the code that will be executed inside the 'let', and know that
you want to override user preference for all of the code. It is
inflexible and error-prone compared to the easier-to-use '(message "%s"
...)' style that Emacs has used for decades.This is not a close call: we
should document what has worked rather than try to promote an
experimental alternative that has no significant technical advantages.
- Re: Emacs 26.1 release branch created, (continued)
- Re: Emacs 26.1 release branch created, Alan Mackenzie, 2017/09/22
- Re: Emacs 26.1 release branch created, Alan Mackenzie, 2017/09/24
- Re: Emacs 26.1 release branch created, Paul Eggert, 2017/09/24
- Re: Emacs 26.1 release branch created, Alan Mackenzie, 2017/09/24
- Re: Emacs 26.1 release branch created, John Wiegley, 2017/09/24
- Re: Emacs 26.1 release branch created, Paul Eggert, 2017/09/24
- Re: Emacs 26.1 release branch created, John Wiegley, 2017/09/25
- Re: Emacs 26.1 release branch created, Alan Mackenzie, 2017/09/25
- RE: Emacs 26.1 release branch created, Drew Adams, 2017/09/25
- Re: Emacs 26.1 release branch created, John Wiegley, 2017/09/25
- Re: Emacs 26.1 release branch created,
Paul Eggert <=
- RE: Emacs 26.1 release branch created, Drew Adams, 2017/09/25
- Re: Emacs 26.1 release branch created, Paul Eggert, 2017/09/25
- Re: Emacs 26.1 release branch created, Philipp Stephani, 2017/09/26
- RE: Emacs 26.1 release branch created, Drew Adams, 2017/09/26
- Re: Emacs 26.1 release branch created, Alan Mackenzie, 2017/09/26
- Re: Emacs 26.1 release branch created, Alexis, 2017/09/27
- Re: Emacs 26.1 release branch created, Richard Stallman, 2017/09/27
- Re: Emacs 26.1 release branch created, Alexis, 2017/09/27
- Re: Emacs 26.1 release branch created, Óscar Fuentes, 2017/09/27
- Re: Emacs 26.1 release branch created, Alexis, 2017/09/27