unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Drew Adams <drew.adams@oracle.com>
Cc: "51041@debbugs.gnu.org" <51041@debbugs.gnu.org>,
	Tyler Grinn <tylergrinn@gmail.com>
Subject: bug#51041: 28.0.60; toggle-truncate-lines should not print message
Date: Tue, 5 Oct 2021 17:39:00 -0400	[thread overview]
Message-ID: <CADwFkmn5p3B2o4mmVnAmLQBbGLdMWg03Zy2C83T_n2R8EEv=eA@mail.gmail.com> (raw)
In-Reply-To: <SJ0PR10MB5488F1494F93C1BF65A2BA0CF3AF9@SJ0PR10MB5488.namprd10.prod.outlook.com> (Drew Adams's message of "Tue, 5 Oct 2021 18:34:39 +0000")

Drew Adams <drew.adams@oracle.com> writes:

>> (toggle-truncate-lines t)
>>
>> Prints the message "Truncate long lines enabled". When called from
>> elisp, this message should be ignored. If called interactively, the
>> message should be displayed.
>
> Yes.
>
> But the right fix is to add "&optional msg",
> use (interactive "P\np"), and test for non-nil
> MSG as the condition for showing the message.
>
> Lisp code for a command can use that toggle
> function, and when _that_ command is invoked
> interactively it too might make sense to show
> the message (that can depend on the command
> and when the toggling occurs as part of it).
>
> The same kind of fix is no doubt appropriate
> for some other existing commands that instead
> just test `called-interactively-p'.  Surely
> we shouldn't perpetuate such design by adding
> more such.

I don't think it's worth making the call signature of
`toggle-truncate-lines' more complicated just for the purpose of showing
a message.

Why should a different command want to show this message?  Why can't
that calling Lisp code just show an appropriate message itself?
Do we have a concrete use-case for it, or is it just a "maybe nice to
have"?





  parent reply	other threads:[~2021-10-05 21:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05 17:39 bug#51041: 28.0.60; toggle-truncate-lines should not print message Tyler Grinn
2021-10-05 18:34 ` bug#51041: [External] : " Drew Adams
2021-10-05 20:01   ` Tyler Grinn
2021-10-05 21:39   ` Stefan Kangas [this message]
2021-10-05 23:41     ` bug#51041: [External] : " Drew Adams
2021-10-06  0:28       ` Stefan Kangas
2021-10-06  9:23         ` Lars Ingebrigtsen
2021-10-06 14:28           ` bug#51041: [External] : " Drew Adams
2021-10-06 18:11             ` Stefan Kangas
2021-10-06 20:45               ` Drew Adams
2021-10-06 21:09                 ` Stefan Kangas
2021-10-06 22:12                   ` Drew Adams
2021-10-07 12:41                     ` Tyler Grinn
2021-10-07 17:42                       ` Lars Ingebrigtsen

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='CADwFkmn5p3B2o4mmVnAmLQBbGLdMWg03Zy2C83T_n2R8EEv=eA@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=51041@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=tylergrinn@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).