Gnus development mailing list
 help / color / mirror / Atom feed
From: Francis Litterio <flitterio@gmail.com>
To: ding@gnus.org
Subject: Patch to message.el to allow saving multiple message buffers when Gnus not running
Date: Fri, 12 Sep 2008 12:26:37 -0400	[thread overview]
Message-ID: <i5i6myidmiru.fsf@gmail.com> (raw)

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	other threads:[~2008-09-12 16:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-12 16:26 Francis Litterio [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=i5i6myidmiru.fsf@gmail.com \
    --to=flitterio@gmail.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).