emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/assess eb56d9627d 07/95: String diff file save is now s


From: ELPA Syncer
Subject: [elpa] externals/assess eb56d9627d 07/95: String diff file save is now silent.
Date: Tue, 19 Jul 2022 15:57:28 -0400 (EDT)

branch: externals/assess
commit eb56d9627d830b8d0a19cd90932c12078a0ee738
Author: Phillip Lord <phillip.lord@newcastle.ac.uk>
Commit: Phillip Lord <phillip.lord@newcastle.ac.uk>

    String diff file save is now silent.
    
    Previously, the string= explainer was noisy while saving the contents of
    the string to file. We now bypass the messages.
---
 sisyphus.el | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/sisyphus.el b/sisyphus.el
index 198d02670d..5daf94f548 100644
--- a/sisyphus.el
+++ b/sisyphus.el
@@ -84,6 +84,15 @@
 ;; *** String Comparision
 
 ;; #+begin_src emacs-lisp
+(defun sisyphus--write-file-silently (filename)
+  "Write current buffer into FILENAME.
+Unlike most other ways of saving a file, this should not
+print any messages!."
+  (write-region
+   (point-min) (point-max)
+   filename nil
+   'dont-display-wrote-file-message))
+
 (defun sisyphus--explainer-diff-string= (a b)
   "Compare strings using diff output."
   (let* ((diff
@@ -101,11 +110,11 @@
     (with-current-buffer
         a-buffer
       (insert a)
-      (write-file a-file))
+      (sisyphus--write-file-silently a-file))
     (with-current-buffer
         b-buffer
       (insert b)
-      (write-file b-file))
+      (sisyphus--write-file-silently b-file))
     (prog1
         (format "Strings:\n%s\nand\n%s\nDiffer at:%s\n"
                 a b



reply via email to

[Prev in Thread] Current Thread [Next in Thread]