From: "Bjørn Mork" <bjorn@mork.no>
To: ding@gnus.org
Subject: Re: What's the best way to auto-sign some emails but not all?
Date: Tue, 03 Dec 2024 12:36:13 +0100 [thread overview]
Message-ID: <87zfldc82a.fsf@miraculix.mork.no> (raw)
In-Reply-To: <871pypjbp0.fsf@> (=?utf-8?Q?=22Bj=C3=B6rn?= Bidar"'s message of "Tue, 03 Dec 2024 12:35:55 +0200")
Björn Bidar <bjorn.bidar@thaodan.de> writes:
> Bjørn Mork <bjorn@mork.no> writes:
>
>> Most of the suggestions depend on message-setup-hook in some way, making
>> them work and fail similar to my existing gnus-posting-styles setup. One
>> exception is gnus-alias which AFAIU can apply a new identity to an
>> existing message buffer. But that's an interactive choice, which is
>> what I'm trying to avoid.
>
> That is not true. gnus-alias has rules which make it possible to
> automatically apply an identity. Check C-h v gnus-alias-identity-rules RET.
Yes, I know, and I didn't mean to say anything else.
But AFAICS, the result of the gnus-alias automatic identity mapping is
limited by what is possible in a message-setup-hook. That's what I tried
to express.
> Message-signature manual or automatically should also take into account
> a yanked article AFAIU.
Sorry if I've misunderstood something, but I really don't understand how
that could work. Not sure where the authoritative source of gnus-alias
is. Doesn't look like it is part of emacs. Google gave me a github
repo, but I don't know if that's correct?
Anyway, that version seems to do automatic identity mapping by adding a
hook to message-setup-hook - which makes sense:
https://github.com/altruizine/gnus-alias/blob/master/gnus-alias.el#L666
I understand that you can insert anything into the message buffer here.
But Gnus has not yet inserted the yanked text, so you cannot position
your inserts relative to that text. Anything you place at the beginning
of the body will be moved around later.
There's a lot of code spread over many functions, but I believe
gnus-summary-reply() is the best place to start looking at the problem:
https://github.com/emacs-mirror/emacs/blob/master/lisp/gnus/gnus-msg.el#L1061
It ends with:
(message-reply nil wide)
(when yank
(gnus-inews-yank-articles yank))
(gnus-summary-handle-replysign)))))
Where message-reply() will call message-setup() as its final step, which
in turn will run all the message-setup-hook hooks. See
https://github.com/emacs-mirror/emacs/blob/master/lisp/gnus/message.el#L7314
https://github.com/emacs-mirror/emacs/blob/master/lisp/gnus/message.el#L6823
This means that gnus-inews-yank-articles() runs after any automatic
message setup by gnus-posting-styles, gnus-alias or my own personal
setup hook.
gnus-inews-yank-articles() can be configured to insert the quoted text
above or below the message, but I can't see any obvious way to allow it
to insert the text between any existing mml tag and the rest of the
message body. Which is where I'd like it to end up.
One could also have imagined a solution where it was possible to control
gnus-summary-handle-replysign() by a buffer local variable. But it
depends on the sign/encrypt status of the message being replied to, using
the variables
gnus-message-replyencrypt
gnus-message-replysign
And that is not exactly what I want either. I want to sign *all*
replies from a specific address, whether the original was sined or not.
Bjørn
next prev parent reply other threads:[~2024-12-03 11:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-29 14:49 Bjørn Mork
2024-11-30 18:29 ` Trevor Arjeski
2024-11-30 19:28 ` Bjørn Mork
2024-11-30 20:17 ` Trevor Arjeski
2024-12-02 15:11 ` Bjørn Mork
2024-12-03 10:35 ` Björn Bidar
2024-12-03 11:36 ` Bjørn Mork [this message]
2024-12-03 20:38 ` Björn Bidar
2024-12-01 3:58 ` Sean Whitton
2024-12-01 23:04 ` Björn Bidar
2024-12-01 23:43 ` Bob Newell
2024-12-08 5:05 ` James Thomas
2024-12-08 13:22 ` Bjørn Mork
2024-12-08 21:03 ` James Thomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zfldc82a.fsf@miraculix.mork.no \
--to=bjorn@mork.no \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).