* write-region & visit flag to shut the chatiness?
@ 2020-12-03 19:52 Arthur Miller
2020-12-03 20:26 ` Eli Zaretskii
2020-12-03 20:35 ` Vasilij Schneidermann
0 siblings, 2 replies; 3+ messages in thread
From: Arthur Miller @ 2020-12-03 19:52 UTC (permalink / raw)
To: emacs-devel
I am building a file by appending lots of data to it. Write-region was
literally flooding the message buffer, slowing down Emacs and making
message buffer itself unuseful due to load of data.
When I looked into info about write-region, it says I can set 'visit'
option to something else then nil or t but not string to turn it off? :D :-)
"Normally, ‘write-region’ displays the message ‘Wrote FILENAME’ in
the echo area. This message is inhibited if VISIT is neither ‘t’
nor ‘nil’ nor a string, or if Emacs is operating in batch mode
(*note Batch Mode::). This feature is useful for programs that use
files for internal purposes, files that the user does not need to
know about."
I tried and it works; but is that really a proper design? :-)
What if someone would like to use visit flag for something else? Mybe it
is never used for something else; i don't know :-).
I don't even understand why write-region has to echo everything to
message buffer by default? I don't expect a function to explicitly tell
me "Hey look, I did what I am suppose to do!". I mean (+ x y) does not
tell me "Added x and y!" Why that befaviour by default?
If it is of interest I can send in a patch and add an optional flag like
noverbose or similar; it is not über important, but I think it is ugly
and unnecessary convoluted design as it is now.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: write-region & visit flag to shut the chatiness?
2020-12-03 19:52 write-region & visit flag to shut the chatiness? Arthur Miller
@ 2020-12-03 20:26 ` Eli Zaretskii
2020-12-03 20:35 ` Vasilij Schneidermann
1 sibling, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2020-12-03 20:26 UTC (permalink / raw)
To: Arthur Miller; +Cc: emacs-devel
> From: Arthur Miller <arthur.miller@live.com>
> Date: Thu, 03 Dec 2020 20:52:53 +0100
>
> I don't even understand why write-region has to echo everything to
> message buffer by default? I don't expect a function to explicitly tell
> me "Hey look, I did what I am suppose to do!". I mean (+ x y) does not
> tell me "Added x and y!" Why that befaviour by default?
Because writing to a file is something we want the user to be aware
of. And because Emacs behaved like that forever.
> If it is of interest I can send in a patch and add an optional flag like
> noverbose or similar; it is not über important, but I think it is ugly
> and unnecessary convoluted design as it is now.
We already have message-log-max which you can bind to nil to disable
logging a message.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: write-region & visit flag to shut the chatiness?
2020-12-03 19:52 write-region & visit flag to shut the chatiness? Arthur Miller
2020-12-03 20:26 ` Eli Zaretskii
@ 2020-12-03 20:35 ` Vasilij Schneidermann
1 sibling, 0 replies; 3+ messages in thread
From: Vasilij Schneidermann @ 2020-12-03 20:35 UTC (permalink / raw)
To: Arthur Miller; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 452 bytes --]
> If it is of interest I can send in a patch and add an optional flag like
> noverbose or similar; it is not über important, but I think it is ugly
> and unnecessary convoluted design as it is now.
That would break compatibility though. A common pattern with such
optional arguments is to use a descriptive symbol, from a quick search
silent, no-message, nomessage, no-msg, nomesg, quiet and quietly have
been used in the Emacs Lisp sources.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-03 20:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-03 19:52 write-region & visit flag to shut the chatiness? Arthur Miller
2020-12-03 20:26 ` Eli Zaretskii
2020-12-03 20:35 ` Vasilij Schneidermann
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).