Subject: Re: [External] : Re: bug#51041: 28.0.60; toggle-truncate-lines should not print message

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 07 Oct 2021 19:42:58 +0200

Tyler Grinn <[email-masked]> writes:

> My understanding is that if some functionality or minor mode provides a
> function to toggle it, it is a best practice to use that function rather
> than re-implement it, such that if the behavior of the toggle function
> changes my code doesn't have to change.

We have a number of commands that are meant to be used for interactive
use only (and will give a warning if used from code).  We also have some
commands that are OK to use from code, but only if that code is
user-oriented, and `toggle-truncate-lines' seems very much like that.

Normal code that needs to change truncate-lines should just set the
variable -- which is what happens already.  There's about a hundred
instances of "setq.*truncate-lines" in the Emacs tree, while there's
three calls to `toggle-truncate-lines' (and all are from code that are
user oriented and should message).

So I agree with Stefan -- altering `toggle-truncate-lines' like
suggested isn't appropriate, and I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no