unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34940: [PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over $HOME/Mail as notmuch prefix
@ 2019-03-21 20:49 Philip K
  2019-03-22  9:18 ` Robert Pluim
  2019-05-31  7:13 ` Philip K.
  0 siblings, 2 replies; 6+ messages in thread
From: Philip K @ 2019-03-21 20:49 UTC (permalink / raw)
  To: 34940

---
 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






^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#34940: [PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over $HOME/Mail as notmuch prefix
  2019-03-21 20:49 bug#34940: [PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over $HOME/Mail as notmuch prefix Philip K
@ 2019-03-22  9:18 ` Robert Pluim
  2019-05-31  7:13 ` Philip K.
  1 sibling, 0 replies; 6+ messages in thread
From: Robert Pluim @ 2019-03-22  9:18 UTC (permalink / raw)
  To: Philip K; +Cc: 34940

>>>>> On Thu, 21 Mar 2019 21:49:17 +0100, Philip K <philip@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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#34940: [PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over $HOME/Mail as notmuch prefix
  2019-03-21 20:49 bug#34940: [PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over $HOME/Mail as notmuch prefix Philip K
  2019-03-22  9:18 ` Robert Pluim
@ 2019-05-31  7:13 ` Philip K.
  2019-06-01 18:09   ` Basil L. Contovounesios
  1 sibling, 1 reply; 6+ messages in thread
From: Philip K. @ 2019-05-31  7:13 UTC (permalink / raw)
  To: 34940


[-- Attachment #1.1: Type: text/plain, Size: 107 bytes --]


You're right, something was messed up. I hope this is better.

-- 
	With kind regards,
	Philip K.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-lisp-gnus-nnir.el-prefer-MAILDIR-over-HOME-Mail-as-n.patch --]
[-- Type: text/x-diff, Size: 943 bytes --]

From 09de2282a0c9dc2e74c61d2dc1b5b2abf64319bf Mon Sep 17 00:00:00 2001
From: Philip K <philip@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/")
   "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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#34940: [PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over $HOME/Mail as notmuch prefix
  2019-05-31  7:13 ` Philip K.
@ 2019-06-01 18:09   ` Basil L. Contovounesios
  2019-06-01 18:45     ` Andreas Schwab
  0 siblings, 1 reply; 6+ messages in thread
From: Basil L. Contovounesios @ 2019-06-01 18:09 UTC (permalink / raw)
  To: Philip K.; +Cc: 34940

> From 09de2282a0c9dc2e74c61d2dc1b5b2abf64319bf Mon Sep 17 00:00:00 2001
> From: Philip K <philip@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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#34940: [PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over $HOME/Mail as notmuch prefix
  2019-06-01 18:09   ` Basil L. Contovounesios
@ 2019-06-01 18:45     ` Andreas Schwab
  2019-06-22 12:55       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2019-06-01 18:45 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: Philip K., 34940

On Jun 01 2019, "Basil L. Contovounesios" <contovob@tcd.ie> wrote:

>> From 09de2282a0c9dc2e74c61d2dc1b5b2abf64319bf Mon Sep 17 00:00:00 2001
>> From: Philip K <philip@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@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#34940: [PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over $HOME/Mail as notmuch prefix
  2019-06-01 18:45     ` Andreas Schwab
@ 2019-06-22 12:55       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-22 12:55 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Basil L. Contovounesios, Philip K., 34940

Andreas Schwab <schwab@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





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-22 12:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-21 20:49 bug#34940: [PATCH 1/1] lisp/gnus/nnir.el: prefer $MAILDIR over $HOME/Mail as notmuch prefix Philip K
2019-03-22  9:18 ` Robert Pluim
2019-05-31  7:13 ` Philip K.
2019-06-01 18:09   ` Basil L. Contovounesios
2019-06-01 18:45     ` Andreas Schwab
2019-06-22 12:55       ` Lars Ingebrigtsen

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).