From: shipmints <shipmints@gmail.com>
Date: Thu, 13 Feb 2025 13:10:45 +0000 (-0500)
Subject: Inhibit "Wrote" message in saveplace.el when non-interactive
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=75a1f8d3bee55d34232cb63b263b07140d756f97;p=emacs.git

Inhibit "Wrote" message in saveplace.el when non-interactive

* lisp/saveplace.el (save-place-alist-to-file): Tell 'write-region'
to be quiet when called non-interactively.  This is in harmony with
'savehist-save'.  (Bug#76267)

(cherry picked from commit 8f45cbdee45317faa978732fa5311c3c056b559f)
---

diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index d188de29144..1b99387ef5f 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -401,7 +401,8 @@ may have changed) back to `save-place-alist'."
                t))))
 	(condition-case nil
 	    ;; Don't use write-file; we don't want this buffer to visit it.
-            (write-region (point-min) (point-max) file)
+            (write-region (point-min) (point-max) file nil
+			  (unless (called-interactively-p 'interactive) 'quiet))
 	  (file-error (message "Saving places: can't write %s" file)))))))
 
 (defun save-places-to-alist ()