Gnus development mailing list
 help / color / mirror / Atom feed
* Patch to message.el to allow saving multiple message buffers when Gnus not running
@ 2008-09-12 16:26 Francis Litterio
  2008-09-15 17:41 ` Ted Zlatanov
  0 siblings, 1 reply; 6+ messages in thread
From: Francis Litterio @ 2008-09-12 16:26 UTC (permalink / raw)
  To: ding

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)






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-09-25 19:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-12 16:26 Patch to message.el to allow saving multiple message buffers when Gnus not running Francis Litterio
2008-09-15 17:41 ` Ted Zlatanov
2008-09-23 18:05   ` Reiner Steib
2008-09-25 13:04     ` Ted Zlatanov
2008-09-25 16:58       ` Reiner Steib
2008-09-25 19:08         ` Francis Litterio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).