GNU bug report logs - #34940
[PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over $HOME/Mail as notmuch prefix

Previous Next

Package: emacs;

Reported by: Philip K <philip <at> warpmail.net>

Date: Thu, 21 Mar 2019 20:54:02 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34940 in the body.
You can then email your comments to 34940 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#34940; Package emacs. (Thu, 21 Mar 2019 20:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Philip K <philip <at> warpmail.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 21 Mar 2019 20:54:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Philip K <philip <at> warpmail.net>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over $HOME/Mail as
 notmuch prefix
Date: Thu, 21 Mar 2019 21:49:17 +0100
---
 lisp/gnus/nnir.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
index 37a38a58d4..34f741bb60 100644
--- a/lisp/gnus/nnir.el
+++ b/lisp/gnus/nnir.el
@@ -507,7 +507,8 @@ nnir-notmuch-additional-switches
   :type '(repeat (string))
   :group 'nnir)
 
-(defcustom nnir-notmuch-remove-prefix (concat (getenv "HOME") "/Mail/")
+(defcustom nnir-notmuch-remove-prefix (or (getenv "MAILDIR")
+										  (concat (getenv "HOME") "/Mail/"))
   "The prefix to remove from each file name returned by notmuch
 in order to get a group name (albeit with / instead of .).  This is a
 regular expression.
-- 
2.20.1





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34940; Package emacs. (Fri, 22 Mar 2019 09:19:01 GMT) Full text and rfc822 format available.

Message #8 received at 34940 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Philip K <philip <at> warpmail.net>
Cc: 34940 <at> debbugs.gnu.org
Subject: Re: bug#34940: [PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over
 $HOME/Mail as notmuch prefix
Date: Fri, 22 Mar 2019 10:18:34 +0100
>>>>> On Thu, 21 Mar 2019 21:49:17 +0100, Philip K <philip <at> warpmail.net> said:

-(defcustom nnir-notmuch-remove-prefix (concat (getenv "HOME") "/Mail/")
+(defcustom nnir-notmuch-remove-prefix (or (getenv "MAILDIR")
+										  (concat (getenv "HOME") "/Mail/"))

Iʼm guessing you have 'indent-tabs-mode t' and 'tab-width 4' and
youʼre overriding .dir-locals.el

Robert




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34940; Package emacs. (Fri, 31 May 2019 07:14:02 GMT) Full text and rfc822 format available.

Message #11 received at 34940 <at> debbugs.gnu.org (full text, mbox):

From: philip <at> warpmail.net (Philip K.)
To: 34940 <at> debbugs.gnu.org
Subject: Re: bug#34940: [PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over
 $HOME/Mail as notmuch prefix
Date: Fri, 31 May 2019 09:13:38 +0200
[Message part 1 (text/plain, inline)]
You're right, something was messed up. I hope this is better.

-- 
	With kind regards,
	Philip K.

[0001-lisp-gnus-nnir.el-prefer-MAILDIR-over-HOME-Mail-as-n.patch (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34940; Package emacs. (Sat, 01 Jun 2019 18:10:01 GMT) Full text and rfc822 format available.

Message #14 received at 34940 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: philip <at> warpmail.net (Philip K.)
Cc: 34940 <at> debbugs.gnu.org
Subject: Re: bug#34940: [PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over
 $HOME/Mail as notmuch prefix
Date: Sat, 01 Jun 2019 19:09:09 +0100
> From 09de2282a0c9dc2e74c61d2dc1b5b2abf64319bf Mon Sep 17 00:00:00 2001
> From: Philip K <philip <at> warpmail.net>
> Date: Fri, 31 May 2019 09:10:18 +0200
> Subject: [PATCH] lisp/gnus/nnir.el: prefer $MAILDIR over $HOME/Mail as notmuch
>  prefix
>
> ---
>  lisp/gnus/nnir.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
> index 9d59a4db0d..b07390ec81 100644
> --- a/lisp/gnus/nnir.el
> +++ b/lisp/gnus/nnir.el
> @@ -507,7 +507,8 @@ Instead, use this:
>    :type '(repeat (string))
>    :group 'nnir)
>  
> -(defcustom nnir-notmuch-remove-prefix (concat (getenv "HOME") "/Mail/")
> +(defcustom nnir-notmuch-remove-prefix (concat (getenv "MAILDIR")
> +                                              (getenv "HOME") "/Mail/")

Shouldn't this be:

  (or (getenv "MAILDIR")
      (concat (getenv "HOME") "/Mail/"))

which BTW I think is better as:

  (or (getenv "MAILDIR")
      (expand-file-name "Mail/" (getenv "HOME")))

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34940; Package emacs. (Sat, 01 Jun 2019 18:46:02 GMT) Full text and rfc822 format available.

Message #17 received at 34940 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: "Philip K." <philip <at> warpmail.net>, 34940 <at> debbugs.gnu.org
Subject: Re: bug#34940: [PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over
 $HOME/Mail as notmuch prefix
Date: Sat, 01 Jun 2019 20:45:00 +0200
On Jun 01 2019, "Basil L. Contovounesios" <contovob <at> tcd.ie> wrote:

>> From 09de2282a0c9dc2e74c61d2dc1b5b2abf64319bf Mon Sep 17 00:00:00 2001
>> From: Philip K <philip <at> warpmail.net>
>> Date: Fri, 31 May 2019 09:10:18 +0200
>> Subject: [PATCH] lisp/gnus/nnir.el: prefer $MAILDIR over $HOME/Mail as notmuch
>>  prefix
>>
>> ---
>>  lisp/gnus/nnir.el | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
>> index 9d59a4db0d..b07390ec81 100644
>> --- a/lisp/gnus/nnir.el
>> +++ b/lisp/gnus/nnir.el
>> @@ -507,7 +507,8 @@ Instead, use this:
>>    :type '(repeat (string))
>>    :group 'nnir)
>>  
>> -(defcustom nnir-notmuch-remove-prefix (concat (getenv "HOME") "/Mail/")
>> +(defcustom nnir-notmuch-remove-prefix (concat (getenv "MAILDIR")
>> +                                              (getenv "HOME") "/Mail/")
>
> Shouldn't this be:
>
>   (or (getenv "MAILDIR")
>       (concat (getenv "HOME") "/Mail/"))
>
> which BTW I think is better as:
>
>   (or (getenv "MAILDIR")
>       (expand-file-name "Mail/" (getenv "HOME")))

That needs to quote regexp meta characters, and (getenv "HOME") is "~".

    (regexp-quote (or (getenv "MAILDIR") (expand-file-name "~/Mail)))

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34940; Package emacs. (Sat, 22 Jun 2019 12:56:01 GMT) Full text and rfc822 format available.

Message #20 received at 34940 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: "Basil L. Contovounesios" <contovob <at> tcd.ie>,
 "Philip K." <philip <at> warpmail.net>, 34940 <at> debbugs.gnu.org
Subject: Re: bug#34940: [PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over
 $HOME/Mail as notmuch prefix
Date: Sat, 22 Jun 2019 14:55:19 +0200
Andreas Schwab <schwab <at> linux-m68k.org> writes:

> That needs to quote regexp meta characters, and (getenv "HOME") is "~".
>
>     (regexp-quote (or (getenv "MAILDIR") (expand-file-name "~/Mail)))

Thanks; I've now installed this in Emacs 27.1.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 22 Jun 2019 12:56:03 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 34940 <at> debbugs.gnu.org and Philip K <philip <at> warpmail.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 22 Jun 2019 12:56:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 21 Jul 2019 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 273 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.