Re: [PATCH v2 2/2] Replace `delete-line` with its definition

2024-06-17 Thread Marc Fargas
Hi,

El lun. 17 de jun. 2024, David escribió:
>
>> From: Michael J Gruber 
>>
>> 37c022ae ("Use `without-restriction` in 
>> `with-temporary-notmuch-message-buffer`", 2024-03-14)
>> introduced `delete-line` in a test, but this is Emacs 29 and above only.
>> Replace it with its (almost) definition.
>
> The changes look reasonable to me. But so did the last ones ;P. Any
> feedback Marc?

Ok for me! And sorry for not considering backwards compatibility on my
patch :(

marc
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: desktop file to open mailto URLs in Emacs notmuch-message-mode

2024-06-17 Thread Arun Isaac


Hi David,

> There is emacs/notmuch-mua-mail.desktop in the source. This seems to do
> what you ask for?

Lovely! This is exactly what I am looking for. But, in addition, we also
need another desktop file that uses emacsclient instead of emacs. It
would be great if notmuch provided that.

Thanks,
Arun
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH v2 2/2] Replace `delete-line` with its definition

2024-06-17 Thread David Bremner
michaeljgruber+grubix+...@gmail.com writes:

> From: Michael J Gruber 
>
> 37c022ae ("Use `without-restriction` in 
> `with-temporary-notmuch-message-buffer`", 2024-03-14)
> introduced `delete-line` in a test, but this is Emacs 29 and above only.
> Replace it with its (almost) definition.

The changes look reasonable to me. But so did the last ones ;P. Any
feedback Marc?
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[PATCH v2 2/2] Replace `delete-line` with its definition

2024-06-17 Thread michaeljgruber+grubix+git
From: Michael J Gruber 

37c022ae ("Use `without-restriction` in 
`with-temporary-notmuch-message-buffer`", 2024-03-14)
introduced `delete-line` in a test, but this is Emacs 29 and above only.
Replace it with its (almost) definition.
---
With this one, all my reported chroots build again.

 test/T630-emacs-draft.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/T630-emacs-draft.sh b/test/T630-emacs-draft.sh
index 1fad58a8..7d0da21a 100755
--- a/test/T630-emacs-draft.sh
+++ b/test/T630-emacs-draft.sh
@@ -76,7 +76,7 @@ add_email_corpus attachment
 test_begin_subtest "Saving a draft keeps hidden headers"
 test_emacs '(notmuch-mua-new-reply "id:874llc2bkp@curie.anarc.at")
 (message-goto-subject)
-(delete-line)
+(delete-region (line-beginning-position) (line-beginning-position 
2))
 (insert "Subject: draft-test-reply\n")
(test-output "DRAFT")
(notmuch-draft-postpone)
-- 
2.45.2.749.g54362de8d7

___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[PATCH v2 1/2] Replace `without-restriction` with `save-restriction`

2024-06-17 Thread michaeljgruber+grubix+git
From: Michael J Gruber 

37c022ae ("Use `without-restriction` in 
`with-temporary-notmuch-message-buffer`", 2024-03-14)
introduced a fix for draft saving in a way which is supported on Emacs
29 and above only. Replace this with a construct which we have used
before, so that we keep the same compatibility level.
---
unchanged

 emacs/notmuch-maildir-fcc.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index cf50e855..c7b403cf 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -145,7 +145,8 @@ Otherwise set it according to `notmuch-fcc-dirs'."
 
 (defmacro with-temporary-notmuch-message-buffer (&rest body)
   "Set-up a temporary copy of the current message-mode buffer."
-  `(without-restriction
+  `(save-restriction
+ (widen)
  (let ((case-fold-search t)
   (buf (current-buffer))
   (mml-externalize-attachments message-fcc-externalize-attachments))
-- 
2.45.2.749.g54362de8d7

___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: notmuch.el, needs without-restriction to properly save draft

2024-06-17 Thread David Bremner
Marc Fargas  writes:

> Hi,
>
> El lun. 17 de jun. 2024, Marc escribió:
>>
>> El lun. 17 de jun. 2024, Michael escribió:
 (...)
>>>
>>> Does this depend on emacs version by any chance, i.e. is
>>> `without-restriction` defined on all emacsen? In Fedora's copr
>>> infrastructure, all builds succeed but some tests fail with
>>> `Symbol'€™s function definition is void: without-restriction`. The
>>> picture is the following:
>
> So, I will have to update the patch in order to make the use of
> `without-restriction` conditional on its availability.
>
> I asked on Emacs chat @ Matrix on how to do this nicely and yantar92
> (org contributor) proposed the following macro:
>
>(defmacro notmuch--without-restriction (&rest body)
>  "Run BODY within `without-restriction', when it is available."
>  (declare (debug (body)))
>  (if (fboundp 'without-restriction)
>  `(without-restriction ,@body)
>`(progn ,@body)))

Assuming fboundp works for macros (without-restriction is a macro), then
sure
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[PATCH] Replace `without-restriction` with `save-restriction`

2024-06-17 Thread michaeljgruber+grubix+git
From: Michael J Gruber 

37c022ae ("Use `without-restriction` in 
`with-temporary-notmuch-message-buffer`", 2024-03-14)
introduced a fix for draft saving in a way which is supported on Emacs
29 and above only. Replace this with a construct which we have used
before, so that we keep the same compatibility level.
---
So, this fixes one incompatibility, and as per the emacs docs, those
should be equivalent.

Alas: T630-emacs-draft introduced another incompatibility by using
`delete-line`, it seems. I haven't checked versions nor substitutes
yet.

 emacs/notmuch-maildir-fcc.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index cf50e855..c7b403cf 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -145,7 +145,8 @@ Otherwise set it according to `notmuch-fcc-dirs'."
 
 (defmacro with-temporary-notmuch-message-buffer (&rest body)
   "Set-up a temporary copy of the current message-mode buffer."
-  `(without-restriction
+  `(save-restriction
+ (widen)
  (let ((case-fold-search t)
   (buf (current-buffer))
   (mml-externalize-attachments message-fcc-externalize-attachments))
-- 
2.45.2.749.g54362de8d7

___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: notmuch.el, needs without-restriction to properly save draft

2024-06-17 Thread Marc Fargas
Hi,

El lun. 17 de jun. 2024, Marc escribió:
>
> El lun. 17 de jun. 2024, Michael escribió:
>>> (...)
>>
>> Does this depend on emacs version by any chance, i.e. is
>> `without-restriction` defined on all emacsen? In Fedora's copr
>> infrastructure, all builds succeed but some tests fail with
>> `Symbol'€™s function definition is void: without-restriction`. The
>> picture is the following:

So, I will have to update the patch in order to make the use of
`without-restriction` conditional on its availability.

I asked on Emacs chat @ Matrix on how to do this nicely and yantar92
(org contributor) proposed the following macro:

   (defmacro notmuch--without-restriction (&rest body)
 "Run BODY within `without-restriction', when it is available."
 (declare (debug (body)))
 (if (fboundp 'without-restriction)
 `(without-restriction ,@body)
   `(progn ,@body)))

David, would such solution be OK? If so I'll prepare a new patch.

Marc
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: notmuch.el, needs without-restriction to properly save draft

2024-06-17 Thread Marc Fargas
Hi,

El lun. 17 de jun. 2024, Michael escribió:
>> (...)
>
> Does this depend on emacs version by any chance, i.e. is
> `without-restriction` defined on all emacsen? In Fedora's copr
> infrastructure, all builds succeed but some tests fail with
> `Symbol'€™s function definition is void: without-restriction`. The
> picture is the following:

Apparently it was introduced in Emacs 29[1]. Strange that tests pass at
all on previous versions.

What is the earliest Emacs version supported by notmuch? I can't find
any specific version in notmuch documentation.

The patch could be updated to only use without-restriction when
available, of course.

marc

[1]: 
https://github.com/emacs-mirror/emacs/blob/7be66d8223e49489b2803c0ff027f1824d774441/etc/NEWS.29#L3512
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: notmuch.el, needs without-restriction to properly save draft

2024-06-17 Thread David Bremner
David Bremner  writes:

> Marc Fargas  writes:
>
>> Hi,
>>
>> El lun. 17 de jun. 2024, Michael escribió:
 (...)
>>>
>>> Does this depend on emacs version by any chance, i.e. is
>>> `without-restriction` defined on all emacsen? In Fedora's copr
>>> infrastructure, all builds succeed but some tests fail with
>>> `Symbol'€™s function definition is void: without-restriction`. The
>>> picture is the following:
>>
>> Apparently it was introduced in Emacs 29[1]. Strange that tests pass at
>> all on previous versions.
>>
>> What is the earliest Emacs version supported by notmuch? I can't find
>> any specific version in notmuch documentation.
>
> According to the docs, it is supposed to work with 25.1. Personally I
> would be fine updating this to 26.x or 27.x, but of course that won't
> help you here.

Using "docs", loosly here. This is the most recent announcement in NEWS,
which matches emacs/notmuch-pkg.el.tmpl
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: notmuch.el, needs without-restriction to properly save draft

2024-06-17 Thread David Bremner
Marc Fargas  writes:

> Hi,
>
> El lun. 17 de jun. 2024, Michael escribió:
>>> (...)
>>
>> Does this depend on emacs version by any chance, i.e. is
>> `without-restriction` defined on all emacsen? In Fedora's copr
>> infrastructure, all builds succeed but some tests fail with
>> `Symbol'€™s function definition is void: without-restriction`. The
>> picture is the following:
>
> Apparently it was introduced in Emacs 29[1]. Strange that tests pass at
> all on previous versions.
>
> What is the earliest Emacs version supported by notmuch? I can't find
> any specific version in notmuch documentation.

According to the docs, it is supposed to work with 25.1. Personally I
would be fine updating this to 26.x or 27.x, but of course that won't
help you here.
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: notmuch.el, needs without-restriction to properly save draft

2024-06-17 Thread Michael J Gruber
Am Sa., 15. Juni 2024 um 19:57 Uhr schrieb David Bremner :
>
> Marc Fargas  writes:
>
> > Hi again,
> >
> > El dom. 24 de mar. 2024, Marc escribió:
> >> El mié. 13 de mar. 2024, Carl escribió:
> >>> (...)
> >>> Could you put your fix together in the form of a git-appliable patch?
> >>> Such as by applying it to the notmuch source, running `git commit` and
> >>> then `git format-patch HEAD~` or similar.
> >>
> >> Please disregard the previous patch, consider the one attached
> >> here. Hope I did the "format-patch" thing properly.
> >>
> >> I had to move the `without-restriction` call to the top of the
> >> `with-temporary-notmuch-message-buffer` defmacro. It does work properly
> >> now.
>
> Applied to master. Sorry for the long-ish silence.
>

Does this depend on emacs version by any chance, i.e. is
`without-restriction` defined on all emacsen? In Fedora's copr
infrastructure, all builds succeed but some tests fail with
`Symbol'€™s function definition is void: without-restriction`. The
picture is the following:

PASS:
centos-stream+epel-next-8 with emacs 26.1-11.el8
rhel+epel-8 with emacs 26.1-11.el8
fedora-39 with emacs 29.3-1.fc39
(plus all newer fedoras)

FAIL:
centos-stream+epel-next-9 with emacs 27.2-9.el9
rhel+epel-9 with emacs 27.2-9.el9

Yes, RHEL 8 is EOled.

I find it strange that tests pass on both emacs 26 and 29 but not
27.2. But said code path is not executed on emacs 26 at all?

The failing 42 tests are mostly around json and crypto, but not all.

Cheers
Michael
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org