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: Mail file vars aren't derived from customized message-directory
Date: Sun, 16 Nov 2014 11:27:23 +0000	[thread overview]
Message-ID: <sNW7R7LZDoqLi4TXhe3Lz9DrjUhQYeboIbO5R5REIY2@local> (raw)

Delete your ~/Mail directory (uppercase ⌜M⌝).
Make a ~/mail directory (lowercase ⌜m⌝).

Put in your init file just:
(require 'message)
(setq message-directory "~/mail/")

Start Emacs 24.4.
Notice that message-auto-save-directory is now ⌜~/⌝.
The default value of message-auto-save-directory is
  (if (file-writable-p message-directory)
      (file-name-as-directory (expand-file-name "drafts" message-directory))
    "~/")
but that fails to work as intended, because message-directory still has its default value of ⌜~/Mail/⌝, because message.el hasn't been loaded yet.

The docstring for message-directory says ⌜Directory from which all other mail file variables are derived⌝, which is misleading because it implies that if you customize that variable, all other mail file variables will be changed to match your customization.

You could avoid the problem by ensuring that the setq comes not only before the require of message, but also before the require of anything else that might require message, but that defeats the point of require (which is supposed to avoid the brittleness of load).

Fixing this requires either the other vars to be changed into functions that dynamically derive pathnames from message-directory, or something like a set-message-directory function to be made as a replacement for the message-directory var, to update all the other vars when it's called.

Also,
grep -r "~/Mail/" emacs-24.4/lisp/ | grep 'el:'
gives 19 hits, all of which are inappropriate if ~/Mail isn't supposed to be hardcoded. If ~/Mail is supposed to be hardcoded, then the message-directory variable should be removed, to avoid misleading users.





             reply	other threads:[~2014-11-16 11:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-16 11:27 Kelly Dean [this message]
2015-01-23  3:31 ` bug#19068: Mail file vars aren't derived from customized message-directory Kelly Dean
2015-01-28 10:17 ` bug#19068: [PATCH] " Kelly Dean
2015-01-29  8:27 ` bug#19068: " 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=sNW7R7LZDoqLi4TXhe3Lz9DrjUhQYeboIbO5R5REIY2@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).