~rjarry/aerc-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[PATCH aerc] commands/msg: use selected message part for quote-reply

Sebastien Binet <binet@cern.ch>
Details
Message ID
<20240108160450.198227-1-binet@cern.ch>
DKIM signature
missing
Download raw message
Patch: +18 -5
From: Sebastien Binet <s@sbinet.org>

use the currently selected message part (if any) as the original message for quote-reply.
honor viewer::alternatives if no message part was selected.

Signed-off-by: Sebastien Binet <s@sbinet.org>
---
 commands/msg/reply.go | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index 4b3e7c8..3b02ca1 100644
--- a/commands/msg/reply.go
+++ b/commands/msg/reply.go
@@ -222,11 +222,24 @@ func (r reply) Execute(args []string) error {
			return nil
		}

		var part []int
		for _, mime := range config.Viewer.Alternatives {
			part = lib.FindMIMEPart(mime, msg.BodyStructure, nil)
			if part != nil {
				break
		part := func() []int {
			provider, ok := app.SelectedTabContent().(app.ProvidesMessage)
			if !ok {
				return nil
			}
			p := provider.SelectedMessagePart()
			if p == nil {
				return nil
			}
			return p.Index
		}()

		if part == nil {
			for _, mime := range config.Viewer.Alternatives {
				part = lib.FindMIMEPart(mime, msg.BodyStructure, nil)
				if part != nil {
					break
				}
			}
		}

-- 
2.43.0

[aerc/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CY9GFK5JR85Q.GXKHMRD7UWDZ@cirno2>
In-Reply-To
<20240108160450.198227-1-binet@cern.ch> (view parent)
DKIM signature
missing
Download raw message
aerc/patches: SUCCESS in 5m17s

[commands/msg: use selected message part for quote-reply][0] from [Sebastien Binet][1]

[0]: https://lists.sr.ht/~rjarry/aerc-devel/patches/48397
[1]: binet@cern.ch

✓ #1129508 SUCCESS aerc/patches/openbsd.yml     https://builds.sr.ht/~rjarry/job/1129508
✓ #1129507 SUCCESS aerc/patches/alpine-edge.yml https://builds.sr.ht/~rjarry/job/1129507
Details
Message ID
<CY9ZTR8LCOM1.QBX97QI5G91L@gmail.com>
In-Reply-To
<20240108160450.198227-1-binet@cern.ch> (view parent)
DKIM signature
missing
Download raw message
On Mon Jan 8, 2024 at 5:04 PM CET, Sebastien Binet wrote:
> From: Sebastien Binet <s@sbinet.org>
>
> use the currently selected message part (if any) as the original message for quote-reply.
> honor viewer::alternatives if no message part was selected.
>
> Signed-off-by: Sebastien Binet <s@sbinet.org>
> ---

Hi Sebastien, thanks for the patch. Looks good to me.

Do you think it would make sense to add the same logic to the :forward
command [1] as well (for equivalence)?

[1]: https://git.sr.ht/~rjarry/aerc/tree/master/item/commands/msg/forward.go#L146-150
Details
Message ID
<CYA807Q28UVP.2A412XPU9K32M@sbinet.org>
In-Reply-To
<CY9ZTR8LCOM1.QBX97QI5G91L@gmail.com> (view parent)
DKIM signature
missing
Download raw message
On Tue Jan 9, 2024 at 08:22 CET, Koni Marti wrote:
> On Mon Jan 8, 2024 at 5:04 PM CET, Sebastien Binet wrote:
> > From: Sebastien Binet <s@sbinet.org>
> >
> > use the currently selected message part (if any) as the original message for quote-reply.
> > honor viewer::alternatives if no message part was selected.
> >
> > Signed-off-by: Sebastien Binet <s@sbinet.org>
> > ---
>
> Hi Sebastien, thanks for the patch. Looks good to me.
>
> Do you think it would make sense to add the same logic to the :forward
> command [1] as well (for equivalence)?

you're right.
I'll send a v2.

-s
Reply to thread Export thread (mbox)