From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Francis Litterio Newsgroups: gmane.emacs.devel Subject: Patch to message.el to allow saving multiple message buffers when Gnus not running Date: Sat, 06 Sep 2008 13:58:49 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1220729662 17688 80.91.229.12 (6 Sep 2008 19:34:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Sep 2008 19:34:22 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 06 21:35:18 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kc3Yy-0000S5-QB for ged-emacs-devel@m.gmane.org; Sat, 06 Sep 2008 21:35:17 +0200 Original-Received: from localhost ([127.0.0.1]:39244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kc3Xz-0002Zh-24 for ged-emacs-devel@m.gmane.org; Sat, 06 Sep 2008 15:34:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kc3Xv-0002ZS-33 for emacs-devel@gnu.org; Sat, 06 Sep 2008 15:34:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kc3Xt-0002Z4-GA for emacs-devel@gnu.org; Sat, 06 Sep 2008 15:34:10 -0400 Original-Received: from [199.232.76.173] (port=44153 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kc3Xt-0002Z1-Bq for emacs-devel@gnu.org; Sat, 06 Sep 2008 15:34:09 -0400 Original-Received: from pcls4.std.com ([192.74.137.84]:56099 helo=TheWorld.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kc3Xt-0005B7-35 for emacs-devel@gnu.org; Sat, 06 Sep 2008 15:34:09 -0400 Original-Received: from usenlittefl1c.theworld.com (monk@shell01.TheWorld.com [192.74.137.71]) by TheWorld.com (8.13.6/8.13.6) with ESMTP id m86JXdFb003718 for ; Sat, 6 Sep 2008 15:33:42 -0400 X-Random-Quote: Rather than love, than money, than fame, give me truth. I sat at a table where were rich food and wine in abundance, and obsequious attendance, but sincerity and truth were not; and I went away hungry from the inhospitable board. -- Henry David Thoreau (1817 - 1862), Walden User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (windows-nt) X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:103600 Archived-At: 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)