]> git.eshelyaron.com Git - emacs.git/commitdiff
Kill modified buffers silently when quitting (bug#26862)
authorKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 11 May 2017 05:49:45 +0000 (05:49 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 11 May 2017 05:49:45 +0000 (05:49 +0000)
* lisp/gnus/gnus-start.el (gnus-clear-system): Run do-auto-save to make
sure that latest drafts are saved, and kill modified buffers silently.

lisp/gnus/gnus-start.el

index 90f3cb48c277b448d6611b183f8792fa924707f5..aaa8ab9a888d3767f82e90c413cedc1e9b04fb5a 100644 (file)
@@ -731,7 +731,13 @@ the first newsgroup."
     (kill-buffer (get-file-buffer (gnus-newsgroup-kill-file nil))))
   (gnus-kill-buffer nntp-server-buffer)
   ;; Kill Gnus buffers.
+  (do-auto-save t)
   (dolist (buffer (gnus-buffers))
+    (when (gnus-buffer-exists-p buffer)
+      (with-current-buffer buffer
+       (set-buffer-modified-p nil)
+       (when (local-variable-p 'kill-buffer-hook)
+         (setq kill-buffer-hook nil))))
     (gnus-kill-buffer buffer))
   ;; Remove Gnus frames.
   (gnus-kill-gnus-frames))