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: Wed, 22 Jan 2014 18:08:48 +0100 Message-ID: References: <87k3dte17j.fsf@fleche.redhat.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1390410533 28967 80.91.229.3 (22 Jan 2014 17:08:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Jan 2014 17:08:53 +0000 (UTC) Cc: Tom Tromey , Emacs-Devel devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 22 18:09:00 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 1W61IR-0001nN-7G for ged-emacs-devel@m.gmane.org; Wed, 22 Jan 2014 18:08:59 +0100 Original-Received: from localhost ([::1]:36625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W61IQ-0002E9-O7 for ged-emacs-devel@m.gmane.org; Wed, 22 Jan 2014 12:08:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W61IM-0002Da-EL for emacs-devel@gnu.org; Wed, 22 Jan 2014 12:08:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W61IK-0005Z6-RB for emacs-devel@gnu.org; Wed, 22 Jan 2014 12:08:54 -0500 Original-Received: from mail-wg0-x22a.google.com ([2a00:1450:400c:c00::22a]:65432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W61IK-0005Yx-Em for emacs-devel@gnu.org; Wed, 22 Jan 2014 12:08:52 -0500 Original-Received: by mail-wg0-f42.google.com with SMTP id l18so6197306wgh.1 for ; Wed, 22 Jan 2014 09:08:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-type; bh=vjjCTTHOfSY14roqTVlmwA9xLLX4nCWK7/s1sQKVPKU=; b=s8WdwGGCZDUPW/VdDVUh7/E9Za6bjDD7BDgCC6qJ58xeFxgV9T7IiTLBAfKsW2EJoB s2AYF6qJhY8J1AIhVzDieX5Vys5TcIMwfImMnaglsSKLW26KaUc+INM+psjuiCmREdII rTQ7P4AsWteKDhwEIXp58dFn72G735o5B/tr/q1OW947A8VoaPmxopw+gqxql/3eTbjm G5Hv3gnysx5qwKM5UUIZNgVFddOko+5agAdj/sYtNKkmnJyX5hE/g6a8e/ncyrSsZzB9 3c9Oq9PhfiGQTBUsMtkfgH4Qmd6Ku1eW/b+FUNTVNJ/yBLzDgafiHan1fjuSl7bPCd17 jYHg== X-Received: by 10.194.187.101 with SMTP id fr5mr2899413wjc.76.1390410531592; Wed, 22 Jan 2014 09:08:51 -0800 (PST) Original-Received: from lunaryorn-air.fritz.box ([2001:a60:115e:f601:804b:bbca:b51d:c3c8]) by mx.google.com with ESMTPSA id w1sm43547644wix.1.2014.01.22.09.08.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jan 2014 09:08:50 -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: 2a00:1450:400c:c00::22a 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:168905 Archived-At: monnier@iro.umontreal.ca writes: > In the case at hand, I think that package.el should never need to say > "write file ". What do you think of the patch below? There is a typo ("ni" -> "nil"), and I don't exactly understand what the other changes unrelated to write-region are for. Other than that, looks good. Just out of curiosity: What is the rationale behind these messages? Why does write-region even print these messages? > > > Stefan > > > === modified file 'lisp/emacs-lisp/package.el' > --- lisp/emacs-lisp/package.el 2014-01-22 01:50:40 +0000 > +++ lisp/emacs-lisp/package.el 2014-01-22 15:08:04 +0000 > @@ -641,7 +641,7 @@ > ";; End:\n" > ";;; " (file-name-nondirectory file) > " ends here\n") > - nil file)) > + nil file nil 'silent)) > file) > > (defvar generated-autoload-file) > @@ -710,7 +710,7 @@ > (package-desc-extras pkg-desc)))) > "\n") > nil > - pkg-file)))) > + pkg-file nil 'silent)))) > > (defun package--alist-to-plist (alist) > (apply #'nconc (mapcar (lambda (pair) (list (car pair) (cdr pair))) alist))) > @@ -759,7 +759,7 @@ > > (defun package--write-file-no-coding (file-name) > (let ((buffer-file-coding-system 'no-conversion)) > - (write-region (point-min) (point-max) file-name))) > + (write-region (point-min) (point-max) file-name nil 'silent))) > > (defmacro package--with-work-buffer (location file &rest body) > "Run BODY in a buffer containing the contents of FILE at LOCATION. > @@ -874,7 +874,8 @@ > (expand-file-name > (concat (package-desc-full-name pkg-desc) > ".signed") > - package-user-dir)) > + package-user-dir) > + ni 'silent) > ;; Update the old pkg-desc which will be shown on the description buffer. > (setf (package-desc-signed pkg-desc) t) > ;; Update the new (activated) pkg-desc as well. > @@ -1280,7 +1281,8 @@ > ;; Write out good signatures into archive-contents.signed file. > (write-region (mapconcat #'epg-signature-to-string good-signatures "\n") > nil > - (expand-file-name (concat file ".signed") dir))))) > + (expand-file-name (concat file ".signed") dir) > + nil 'silent)))) > > (declare-function epg-check-configuration "epg-config" > (config &optional minimum-version)) > @@ -1636,10 +1638,12 @@ > Letters do not insert themselves; instead, they are commands. > \\ > \\{package-menu-mode-map}" > - (setq tabulated-list-format [("Package" 18 package-menu--name-predicate) > + (setq tabulated-list-format > + `[("Package" 18 package-menu--name-predicate) > ("Version" 12 nil) > ("Status" 10 package-menu--status-predicate) > - ("Archive" 10 package-menu--archive-predicate) > + ,@(if (cdr package-archives) > + '(("Archive" 10 package-menu--archive-predicate))) > ("Description" 0 nil)]) > (setq tabulated-list-padding 2) > (setq tabulated-list-sort-key (cons "Status" nil)) > @@ -1825,19 +1829,20 @@ > (`"unsigned" 'font-lock-warning-face) > (_ 'font-lock-warning-face)))) ; obsolete. > (list pkg-desc > - (vector (list (symbol-name (package-desc-name pkg-desc)) > + `[,(list (symbol-name (package-desc-name pkg-desc)) > 'face 'link > 'follow-link t > 'package-desc pkg-desc > 'action 'package-menu-describe-package) > - (propertize (package-version-join > + ,(propertize (package-version-join > (package-desc-version pkg-desc)) > 'font-lock-face face) > - (propertize status 'font-lock-face face) > - (propertize (or (package-desc-archive pkg-desc) "") > - 'font-lock-face face) > - (propertize (package-desc-summary pkg-desc) > - 'font-lock-face face))))) > + ,(propertize status 'font-lock-face face) > + ,@(if (cdr package-archives) > + (list (propertize (or (package-desc-archive pkg-desc) "") > + 'font-lock-face face))) > + ,(propertize (package-desc-summary pkg-desc) > + 'font-lock-face face)]))) > > (defun package-menu-refresh () > "Download the Emacs Lisp package archive.