From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Inhibit "Wrote foo" from write-region Date: Wed, 22 Jan 2014 10:09:06 -0500 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 1390403384 31809 80.91.229.3 (22 Jan 2014 15:09:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Jan 2014 15:09:44 +0000 (UTC) Cc: Tom Tromey , Emacs-Devel devel To: Sebastian Wiesner Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 22 16:09:50 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 1W5zR7-0007fO-Un for ged-emacs-devel@m.gmane.org; Wed, 22 Jan 2014 16:09:50 +0100 Original-Received: from localhost ([::1]:35643 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5zR7-0005Zq-Dp for ged-emacs-devel@m.gmane.org; Wed, 22 Jan 2014 10:09:49 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5zQw-0005Zg-Rf for emacs-devel@gnu.org; Wed, 22 Jan 2014 10:09:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5zQo-0005q0-Oz for emacs-devel@gnu.org; Wed, 22 Jan 2014 10:09:38 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:47827) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5zQo-0005pR-JW for emacs-devel@gnu.org; Wed, 22 Jan 2014 10:09:30 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id C691C84D96; Wed, 22 Jan 2014 10:09:29 -0500 (EST) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 5ED6B1E5B74; Wed, 22 Jan 2014 10:09:06 -0500 (EST) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 325C7B40D4; Wed, 22 Jan 2014 10:09:06 -0500 (EST) In-Reply-To: (Sebastian Wiesner's message of "Wed, 22 Jan 2014 13:37:24 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 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:168893 Archived-At: 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? 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.