info-gnus-english
[Top][All Lists]
Advanced

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

Patch to message.el to allow saving multiple message buffers when Gnus n


From: Francis Litterio
Subject: Patch to message.el to allow saving multiple message buffers when Gnus not running
Date: Sat, 06 Sep 2008 13:58:49 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (windows-nt)

In Gnus in CVS Emacs, function message-set-auto-save-file-name (in
message.el) arranges for all message composition buffers to be saved to
the same disk file when Gnus has not been started.  If two messages are
being composed at the same time, both will be saved to the same file.

This is at odds with how the same function saves multiple drafts of
outgoing messages in the drafts folder when Gnus has been started.  The
below patch fixes this by changing message-set-auto-save-file to append
a unique timestamp to the name of the disk file for the message
composition buffer.

I hope this helps.
--
Francis Litterio


--- message.el~ 2008-09-03 12:14:37.000000000 -0400
+++ message.el  2008-09-06 13:29:49.912406400 -0400
@@ -6286,13 +6286,22 @@
     (if (gnus-alive-p)
        (setq message-draft-article
              (nndraft-request-associate-buffer "drafts"))
+
+      ;; If Gnus were alive, draft messages would be saved in the drafts 
folder.
+      ;; But Gnus is not alive, so arrange to save the draft message in a
+      ;; regular file in message-auto-save-directory.  Append a unique
+      ;; time-based suffix to the filename to allow multiple drafts to be saved
+      ;; simultaneously without overwriting each other (which mimics the
+      ;; functionality of the Gnus drafts folder).
       (setq buffer-file-name (expand-file-name
+                             (concat
                              (if (memq system-type
                                        '(ms-dos ms-windows windows-nt
                                                 cygwin cygwin32 win32 w32
                                                 mswindows))
                                  "message"
                                "*message*")
+                              (format-time-string "-%Y%m%d-%H%M%S"))
                              message-auto-save-directory))
       (setq buffer-auto-save-file-name (make-auto-save-file-name)))
     (clear-visited-file-modtime)


reply via email to

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