unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Inhibit "Wrote foo" from write-region
@ 2014-01-21 12:32 Sebastian Wiesner
  2014-01-21 12:38 ` Sebastian Wiesner
  2014-01-21 16:42 ` Tom Tromey
  0 siblings, 2 replies; 31+ messages in thread
From: Sebastian Wiesner @ 2014-01-21 12:32 UTC (permalink / raw)
  To: Emacs-Devel devel

Hello,

I'm writing a tool for non-interactive package installation.  Think of
it as apt-get for ELPA packages, e.g. you can point it do a directory
and then install packages from the command line.

It generally works fine, but the *huge* amount of output produced by
package.el is a major nuisance currently.  Even installing trivial
packages results in a lot of "Compiling …", "Extracting…",
etc. messages, which provide no real value to the user.

Following the old Unix philosophy of "no news is good news", I'm trying
to reduce the output, by catching it in a separate buffer, and only
printing it an error was signalled.

By let-binding "standard-output", and monkey-patching Emacs, I managed
to get rid of most messages, but one kind of messages so far has
resisted any attempt to get rid of it: The "Wrote foo" messages of
"write-region".

By default, write-region these messages for every file it's called with.
For individual calls to write-region, this behaviour can be inhibited by
passing a symbol as VISIT argument, e.g. (write-region "Hello world" nil
"foo" 'no-message), however package.el, url.el and other involved
packages do not make general use of this.  For instance,
"package--write-file-no-coding" is defined as follows:

(defun package--write-file-no-coding (file-name)
  (let ((buffer-file-coding-system 'no-conversion))
    (write-region (point-min) (point-max) file-name)))

As you can see, it doesn't pass something for VISIT, and thus
"write-region" emits a "Wrote foo" for *every* file contained in a
package.  Try that with a package with many files, such as Org or Helm.
It spills the terminal with literally dozens of these pointless
messages:

Wrote /Users/swiesner/.cask/.cask/24.3.50.1/elpa/archives/gnu/archive-contents
Wrote /Users/swiesner/.cask/.cask/24.3.50.1/elpa/archives/melpa/archive-contents
Wrote /Users/swiesner/.cask/.cask/24.3.50.1/elpa/helm-20140120.2307/helm-net.el
Wrote /Users/swiesner/.cask/.cask/24.3.50.1/elpa/helm-20140120.2307/helm-ring.el
Wrote /Users/swiesner/.cask/.cask/24.3.50.1/elpa/helm-20140120.2307/helm-command.el
…

Unfortunately, "write-region" does not seem to provide a way to
generally inhibit this message.  I looked at the C source: It calls
"message_with_string", which in turn directly "fprintf"s to stderr in a
non-interactive session.

Do I miss something?  If not, how could I silence "write-region"?



^ permalink raw reply	[flat|nested] 31+ messages in thread
[parent not found: <"<m2r481o6rh.fsf"@lunaryorn-air.fritz.box>]

end of thread, other threads:[~2014-01-24 20:14 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-21 12:32 Inhibit "Wrote foo" from write-region Sebastian Wiesner
2014-01-21 12:38 ` Sebastian Wiesner
2014-01-21 15:57   ` Eli Zaretskii
2014-01-21 16:31     ` Sebastian Wiesner
2014-01-21 16:47       ` Eli Zaretskii
2014-01-22 12:35         ` Sebastian Wiesner
2014-01-22 15:11           ` Stefan Monnier
2014-01-22 17:00             ` Sebastian Wiesner
     [not found]       ` <<834n4xgu3z.fsf@gnu.org>
2014-01-21 17:59         ` Drew Adams
2014-01-21 18:26           ` Eli Zaretskii
2014-01-22  8:05           ` Juri Linkov
2014-01-21 16:42 ` Tom Tromey
2014-01-22 12:37   ` Sebastian Wiesner
2014-01-22 15:09     ` Stefan Monnier
2014-01-22 17:08       ` Sebastian Wiesner
2014-01-22 19:20         ` Stefan Monnier
2014-01-23  9:35           ` Sebastian Wiesner
2014-01-23 13:50             ` Stefan Monnier
2014-01-23 14:24               ` Sebastian Wiesner
2014-01-23 15:18                 ` Stefan Monnier
2014-01-23 16:15                   ` Sebastian Wiesner
2014-01-23 16:29                 ` Eli Zaretskii
2014-01-23 17:31                   ` Sebastian Wiesner
2014-01-23 18:04                     ` Eli Zaretskii
2014-01-24 20:14                       ` Sebastian Wiesner
2014-01-23 16:25               ` Eli Zaretskii
2014-01-23 17:37                 ` Sebastian Wiesner
2014-01-23 18:07                   ` Eli Zaretskii
2014-01-24 13:34                     ` Johan Andersson
2014-01-24 13:48                       ` Stefan Monnier
2014-01-24 14:25                       ` Eli Zaretskii
     [not found] <"<m2r481o6rh.fsf"@lunaryorn-air.fritz.box>

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).