Use ./ as the auto-save directory if the message directory isn't writable
authorLars Magne Ingebrigtsen <larsi@tmp-office.(none)>
Wed, 17 Aug 2011 21:39:15 +0000 (23:39 +0200)
committerLars Magne Ingebrigtsen <larsi@tmp-office.(none)>
Wed, 17 Aug 2011 21:39:15 +0000 (23:39 +0200)
lisp/ChangeLog
lisp/message.el

index 03b6808..fa78c59 100644 (file)
@@ -3,6 +3,8 @@
        * message.el (message-is-yours-p): Allow disabling canlock checking
        (bug#9295).
        (message-shoot-gnksa-feet): Add `canlock-verify'.
+       (message-auto-save-directory): Use ~/ as the auto-save directory if the
+       message directory isn't writable (bug#9304).
 
        * auth-source.el (auth-source-netrc-saver): Make the .authinfo file
        non-world-readable.
index 313ddb4..5e785c6 100644 (file)
@@ -1354,7 +1354,7 @@ text and it replaces `self-insert-command' with the other command, e.g.
   :type '(repeat function))
 
 (defcustom message-auto-save-directory
-  (if (file-exists-p message-directory)
+  (if (file-writable-p message-directory)
       (file-name-as-directory (expand-file-name "drafts" message-directory))
     "~/")
   "*Directory where Message auto-saves buffers if Gnus isn't running.