From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kelly Dean Newsgroups: gmane.emacs.bugs Subject: bug#19068: [PATCH] Mail file vars aren't derived from customized message-directory Date: Wed, 28 Jan 2015 10:17:40 +0000 Message-ID: <9G2noUuGwxG6KgMQVvwySB1lREG65wCckfFtcCmFoFQ@local> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1422440358 8910 80.91.229.3 (28 Jan 2015 10:19:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 Jan 2015 10:19:18 +0000 (UTC) To: 19068@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 28 11:19:17 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YGPiJ-0007be-1D for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Jan 2015 11:19:11 +0100 Original-Received: from localhost ([::1]:52371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGPiI-0006h1-CQ for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Jan 2015 05:19:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGPiE-0006fT-FK for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2015 05:19:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGPiB-0006qd-51 for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2015 05:19:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGPiB-0006qZ-2P for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2015 05:19:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YGPiA-0004xz-Gv; Wed, 28 Jan 2015 05:19:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Kelly Dean Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Wed, 28 Jan 2015 10:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19068 X-GNU-PR-Package: emacs,gnus X-GNU-PR-Keywords: Original-Received: via spool by 19068-submit@debbugs.gnu.org id=B19068.142244033419078 (code B ref 19068); Wed, 28 Jan 2015 10:19:02 +0000 Original-Received: (at 19068) by debbugs.gnu.org; 28 Jan 2015 10:18:54 +0000 Original-Received: from localhost ([127.0.0.1]:58493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YGPi2-0004xd-GT for submit@debbugs.gnu.org; Wed, 28 Jan 2015 05:18:54 -0500 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:35601) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YGPhz-0004xU-Pi for 19068@debbugs.gnu.org; Wed, 28 Jan 2015 05:18:52 -0500 Original-Received: from mfilter41-d.gandi.net (mfilter41-d.gandi.net [217.70.178.173]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id B400DFB86E for <19068@debbugs.gnu.org>; Wed, 28 Jan 2015 11:18:50 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter41-d.gandi.net Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by mfilter41-d.gandi.net (mfilter41-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id zqpyiJswDDXM for <19068@debbugs.gnu.org>; Wed, 28 Jan 2015 11:18:49 +0100 (CET) X-Originating-IP: 66.220.3.179 Original-Received: from localhost (gm179.geneticmail.com [66.220.3.179]) (Authenticated sender: kelly@prtime.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id BC898FB8E0 for <19068@debbugs.gnu.org>; Wed, 28 Jan 2015 11:18:47 +0100 (CET) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:98828 Archived-At: --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=message-directory-bug.patch --- 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. --=-=-=--