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

* Re: Patch to message.el to allow saving multiple message buffers when Gnus not running
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2008-09-15 17:41 UTC (permalink / raw)
  To: ding

On Fri, 12 Sep 2008 12:26:37 -0400 Francis Litterio <flitterio@gmail.com> wrote: 

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

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

Hi Francis,

the patch looks good and I think using the time is reasonable to
guarantee uniqueness.  I'll use it for a few days and report if I have
problems; have you been using it?  I'd like to get at least one
successful tester besides myself before I commit the patch.

Also, do you have papers on file for Gnus?  It's a tiny patch so I'm not
sure of the procedure there; if you plan to contribute in the future it
would be great to have the assignment.

Ted




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

* Re: Patch to message.el to allow saving multiple message buffers when Gnus not running
  2008-09-15 17:41 ` Ted Zlatanov
@ 2008-09-23 18:05   ` Reiner Steib
  2008-09-25 13:04     ` Ted Zlatanov
  0 siblings, 1 reply; 6+ messages in thread
From: Reiner Steib @ 2008-09-23 18:05 UTC (permalink / raw)
  To: Francis Litterio; +Cc: ding

On Mon, Sep 15 2008, Ted Zlatanov wrote:

> On Fri, 12 Sep 2008 12:26:37 -0400 Francis Litterio <flitterio@gmail.com> wrote: 
>
> FL> In Gnus in CVS Emacs, function message-set-auto-save-file-name (in
> FL> message.el) arranges for all message composition buffers to be saved to
> FL> the same disk file when Gnus has not been started.  If two messages are
> FL> being composed at the same time, both will be saved to the same file.
>
> FL> This is at odds with how the same function saves multiple drafts of
> FL> outgoing messages in the drafts folder when Gnus has been started.  The
> FL> below patch fixes this by changing message-set-auto-save-file to append
> FL> a unique timestamp to the name of the disk file for the message
> FL> composition buffer.

I'm not sure about the purpose of the current implementation.  How is
the user supposed to recover the file(s) (without and with your
patch)?

> the patch looks good and I think using the time is reasonable to
> guarantee uniqueness.  I'll use it for a few days and report if I have
> problems; have you been using it?  I'd like to get at least one
> successful tester besides myself before I commit the patch.
>
> Also, do you have papers on file for Gnus?  

He has.

> It's a tiny patch so I'm not sure of the procedure there; 

Install it as a "tiny change", see the ChangeLogs for examples.

> if you plan to contribute in the future it would be great to have
> the assignment.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



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

* Re: Patch to message.el to allow saving multiple message buffers when Gnus not running
  2008-09-23 18:05   ` Reiner Steib
@ 2008-09-25 13:04     ` Ted Zlatanov
  2008-09-25 16:58       ` Reiner Steib
  0 siblings, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2008-09-25 13:04 UTC (permalink / raw)
  To: ding

On Tue, 23 Sep 2008 20:05:53 +0200 Reiner Steib <reinersteib+gmane@imap.cc> wrote: 

RS> On Mon, Sep 15 2008, Ted Zlatanov wrote:
>> On Fri, 12 Sep 2008 12:26:37 -0400 Francis Litterio <flitterio@gmail.com> wrote: 
>> 
FL> In Gnus in CVS Emacs, function message-set-auto-save-file-name (in
FL> message.el) arranges for all message composition buffers to be saved to
FL> the same disk file when Gnus has not been started.  If two messages are
FL> being composed at the same time, both will be saved to the same file.
>> 
FL> This is at odds with how the same function saves multiple drafts of
FL> outgoing messages in the drafts folder when Gnus has been started.  The
FL> below patch fixes this by changing message-set-auto-save-file to append
FL> a unique timestamp to the name of the disk file for the message
FL> composition buffer.

RS> I'm not sure about the purpose of the current implementation.  How is
RS> the user supposed to recover the file(s) (without and with your
RS> patch)?

I think it simply provides a fallback in case of an emergency.  I don't
really know what a user-side function to recover from those files would
do.  Open the files in message-mode?  All of them?  Then what?

Ted




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

* Re: Patch to message.el to allow saving multiple message buffers when Gnus not running
  2008-09-25 13:04     ` Ted Zlatanov
@ 2008-09-25 16:58       ` Reiner Steib
  2008-09-25 19:08         ` Francis Litterio
  0 siblings, 1 reply; 6+ messages in thread
From: Reiner Steib @ 2008-09-25 16:58 UTC (permalink / raw)
  To: Francis Litterio; +Cc: ding

On Thu, Sep 25 2008, Ted Zlatanov wrote:

> On Tue, 23 Sep 2008 Reiner Steib <reinersteib+gmane@imap.cc> wrote: 
> RS> On Mon, Sep 15 2008, Ted Zlatanov wrote:
>>> On Fri, 12 Sep 2008 Francis Litterio <flitterio@gmail.com> wrote: 
> FL> This is at odds with how the same function saves multiple drafts of
> FL> outgoing messages in the drafts folder when Gnus has been started.  The
> FL> below patch fixes this by changing message-set-auto-save-file to append
> FL> a unique timestamp to the name of the disk file for the message
> FL> composition buffer.
>
> RS> I'm not sure about the purpose of the current implementation.  How is
> RS> the user supposed to recover the file(s) (without and with your
> RS> patch)?
>
> I think it simply provides a fallback in case of an emergency.  I don't
> really know what a user-side function to recover from those files would
> do.  Open the files in message-mode?  All of them?  Then what?

I never use message mode without Gnus (except for testing) so I'd like
to gather some information from users (like Francis maybe?) who do
this regularly.

[Moving this to the this thread:]

On Thu, Sep 25 2008, Ted Zlatanov wrote:
> RS> You also checked in an unrelated change: Francis Litterio's patch.
> I was testing with it for a while and missed it.  I added a ChangeLog
> entry but I can't disassociate the old commit.  

The other possibility would be to revert this part of the commit.

> I hope it's OK as it stands now.

Okay.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



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

* Re: Patch to message.el to allow saving multiple message buffers when Gnus not running
  2008-09-25 16:58       ` Reiner Steib
@ 2008-09-25 19:08         ` Francis Litterio
  0 siblings, 0 replies; 6+ messages in thread
From: Francis Litterio @ 2008-09-25 19:08 UTC (permalink / raw)
  To: ding; +Cc: Reiner Steib

Reiner Steib wrote:

> On Thu, Sep 25 2008, Ted Zlatanov wrote:
>
>> On Tue, 23 Sep 2008 Reiner Steib wrote: 
>> RS> On Mon, Sep 15 2008, Ted Zlatanov wrote:
>>>> On Fri, 12 Sep 2008 Francis Litterio wrote: 
>> FL> This is at odds with how the same function saves multiple drafts of
>> FL> outgoing messages in the drafts folder when Gnus has been started.  The
>> FL> below patch fixes this by changing message-set-auto-save-file to append
>> FL> a unique timestamp to the name of the disk file for the message
>> FL> composition buffer.
>>
>> RS> I'm not sure about the purpose of the current implementation.  How is
>> RS> the user supposed to recover the file(s) (without and with your
>> RS> patch)?
>>
>> I think it simply provides a fallback in case of an emergency.

That was my thinking.  I considered saving different buffers to the same
file to be a bug.  I wasn't architecting some grand solution -- just
trying to keep the user's on-disk copies of messages from being trashed.

>> I don't
>> really know what a user-side function to recover from those files would
>> do.  Open the files in message-mode?  All of them?  Then what?
>
> I never use message mode without Gnus (except for testing) so I'd like
> to gather some information from users (like Francis maybe?) who do
> this regularly.

I use Message mode to compose both mail messages and news postings.
It's simply that, if Gnus has not been started, Message mode has this
bug.
--
Fran



^ 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).