From: "Björn Bidar" <bjorn.bidar@thaodan.de>
To: "Bjørn Mork" <bjorn@mork.no>
Cc: ding@gnus.org
Subject: Re: What's the best way to auto-sign some emails but not all?
Date: Tue, 03 Dec 2024 22:38:04 +0200 [thread overview]
Message-ID: <877c8gh58z.fsf@> (raw)
In-Reply-To: <87zfldc82a.fsf@miraculix.mork.no> (=?utf-8?Q?=22Bj=C3=B8rn?= Mork"'s message of "Tue, 03 Dec 2024 12:36:13 +0100")
Bjørn Mork <bjorn@mork.no> writes:
> 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?
I was talking of the builtin message-signature function which can be
called automatically or manually using C-c C-w. From what I read it did
look like that these look to not insert into the yanked article but at
the signature marker at the end of the article where the don't conflict
with the yanked article/message.
> 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.
From what I read the message-mode yank functions took account of not
interfering with the signature. To me it does sound like a bug if
gnus-inews-yank-articles would break the signature.
Looking at comment in message.el:4037
at (message--yank-original-internal (arg)):
;; Add a `message-setup-very-last-hook' here?
It does appear like this a known possible issue.
I assume gnus-message-setup-hook doesn't work either.
Maybe it's worth to look for an existing bug report for possible context
or open a new one.
Anway good that you found a solution.
next prev parent reply other threads:[~2024-12-03 20:38 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
2024-12-03 20:38 ` Björn Bidar [this message]
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=877c8gh58z.fsf@ \
--to=bjorn.bidar@thaodan.de \
--cc=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).