unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kelly Dean <kelly@prtime.org>
To: 19068@debbugs.gnu.org
Subject: bug#19068: [PATCH] Mail file vars aren't derived from customized message-directory
Date: Wed, 28 Jan 2015 10:17:40 +0000	[thread overview]
Message-ID: <9G2noUuGwxG6KgMQVvwySB1lREG65wCckfFtcCmFoFQ@local> (raw)
In-Reply-To: <sNW7R7LZDoqLi4TXhe3Lz9DrjUhQYeboIbO5R5REIY2@local>

[-- Attachment #1: Type: text/plain, Size: 166 bytes --]

The attached patch fixes this bug.

This patch relies on the varhook feature. For details, see:
https://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00974.html


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: message-directory-bug.patch --]
[-- Type: text/x-diff, Size: 1000 bytes --]

--- emacs-24.4/lisp/gnus/message.el
+++ emacs-24.4/lisp/gnus/message.el
@@ -120,6 +120,9 @@
   :group 'message-various
   :type 'directory)
 
+(defvar message-directory-varhook nil)
+(put 'message-directory 'varhook 'message-directory-varhook)
+
 (defcustom message-max-buffers 10
   "*How many buffers to keep before starting to kill them off."
   :group 'message-buffers
@@ -1326,6 +1329,16 @@
   :link '(custom-manual "(message)Various Message Variables")
   :type '(choice directory (const :tag "Don't auto-save" nil)))
 
+;; Update message-auto-save-directory when message-directory changes.
+;; Fixes bug #19068.
+(add-hook 'message-directory-varhook
+	  (lambda (_sym _env)
+	    (setq message-auto-save-directory
+		  (if (file-writable-p message-directory)
+		      (file-name-as-directory
+		       (expand-file-name "drafts" message-directory))
+		    "~/"))))
+
 (defcustom message-default-charset
   (and (not (mm-multibyte-p)) 'iso-8859-1)
   "Default charset used in non-MULE Emacsen.

  parent reply	other threads:[~2015-01-28 10:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-16 11:27 bug#19068: Mail file vars aren't derived from customized message-directory Kelly Dean
2015-01-23  3:31 ` Kelly Dean
2015-01-28 10:17 ` Kelly Dean [this message]
2015-01-29  8:27 ` Lars Ingebrigtsen
     [not found]   ` <4HEgHd24tKVHJkFYvKryLuxc8K21mIEO6gzZl9psynt@local>
2015-01-29 11:36     ` Ivan Shmakov
2015-01-29 16:09 ` Eli Zaretskii
2015-01-30  7:11   ` Kelly Dean
2015-01-30  7:35     ` Ivan Shmakov
2015-01-30 13:45       ` Ivan Shmakov
2015-01-30  9:06     ` Eli Zaretskii
2015-02-14  5:37 ` Lars Ingebrigtsen
2015-02-14  6:54   ` Ivan Shmakov

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=9G2noUuGwxG6KgMQVvwySB1lREG65wCckfFtcCmFoFQ@local \
    --to=kelly@prtime.org \
    --cc=19068@debbugs.gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).