From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sebastian Wiesner Newsgroups: gmane.emacs.devel Subject: Re: Inhibit "Wrote foo" from write-region Date: Tue, 21 Jan 2014 13:38:32 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1390307918 24192 80.91.229.3 (21 Jan 2014 12:38:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jan 2014 12:38:38 +0000 (UTC) To: Emacs-Devel devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 21 13:38:46 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W5abL-0008Ey-Bh for ged-emacs-devel@m.gmane.org; Tue, 21 Jan 2014 13:38:43 +0100 Original-Received: from localhost ([::1]:57920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5abK-0007Cd-N6 for ged-emacs-devel@m.gmane.org; Tue, 21 Jan 2014 07:38:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5abG-0007CT-E8 for emacs-devel@gnu.org; Tue, 21 Jan 2014 07:38:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5abD-0001gk-Hu for emacs-devel@gnu.org; Tue, 21 Jan 2014 07:38:38 -0500 Original-Received: from mail-qa0-x234.google.com ([2607:f8b0:400d:c00::234]:64622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5abD-0001gg-DQ for emacs-devel@gnu.org; Tue, 21 Jan 2014 07:38:35 -0500 Original-Received: by mail-qa0-f52.google.com with SMTP id j15so6495828qaq.39 for ; Tue, 21 Jan 2014 04:38:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:user-agent:from:to:subject:in-reply-to:date:message-id :mime-version:content-type:content-transfer-encoding; bh=7kdvHFBAOsUpxhq9az1Mj+Vh9LV40xsa2l4DseqnfHM=; b=VtdkXw/tjPPeUifJy2ltDDT6Ld/cY8+ymN8vUjVNy6tCu9n9mcyx9e+qpJQJGcggj3 p/gtw/SMGlkwKuvDddSdWpvkmhDpREoiYzrn2GRIF1GVkLuyJ25S+QtgiIeSHI9JgNsC L6hNi3JSoe4Zqoe12hoMjaQfqNJeCrAOLcYyTZ22YwmCbEpjoJa7io4cL+IH6cw9hmto N7JHlX0pxeSei2l5eOsdz59XpAHc8xRBOE17EhjfyaYRPXWo59i6TI/X5667cejDgBId 4CnOjO0nENZQB2VfNWNqjDi8FY5IOnaHmzQwWlc2NFKa04+DH18Sdqn8100wRxCEChHB rKyA== X-Received: by 10.140.101.162 with SMTP id u31mr34898135qge.107.1390307914873; Tue, 21 Jan 2014 04:38:34 -0800 (PST) Original-Received: from lunaryorn-air.fritz.box ([2001:a60:13a5:1:8170:498e:1618:c993]) by mx.google.com with ESMTPSA id 67sm2380404qgr.15.2014.01.21.04.38.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jan 2014 04:38:34 -0800 (PST) User-agent: mu4e 0.9.9.6pre2; emacs 24.3.50.1 In-reply-to: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c00::234 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:168822 Archived-At: lunaryorn@gmail.com writes: > 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 Monkey-patching "message"… sorry > 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"?