unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Kristoffer Balintona <krisbalintona@gmail.com>
To: Pengji Zhang <me@pengjiz.com>, notmuch@notmuchmail.org
Subject: Re: Obey message-cite-reply-position from Emacs' message.el
Date: Mon, 4 Nov 2024 21:45:48 -0800	[thread overview]
Message-ID: <CANVbq5nsyA9vHj0kH9HPKB9XSsR5beXQfqixyE+4MeoDC=A3rQ@mail.gmail.com> (raw)
In-Reply-To: <87ttdbrpf6.fsf@pengjiz.com>

On Thu, Oct 17 2024, Pengji Zhang wrote:

> Kristoffer Balintona <krisbalintona@gmail.com> writes:
>
>> Hello,
>
> Hello!
>
>> The current behavior of notmuch accords with the user values of below
>> and traditional but not above.
>>
>> The notmuch function responsible for the position of the signature
>> (or, rather, the position of the citations) is notmuch-mua-reply. I
>> have attached a patch that adds a brief snippet which obeys
>> message-cite-reply-position when its value is above.
>
> This indeed seems reasonable. Thank you! I am not a maintainer, but here
> are some comments of mine.
>
>> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
>> index bf62b656..1d1a1591 100644
>> --- a/emacs/notmuch-mua.el
>> +++ b/emacs/notmuch-mua.el
>> @@ -295,6 +295,20 @@ Typically this is added to `notmuch-mua-send-hook'."
>>  	    (when message-signature-insert-empty-line
>>  	      (forward-line -1))
>>  	  (goto-char (point-max))))
>> +      ;; If `message-cite-reply-position' is `above', e.g., for Gmail-like
>> +      ;; email replies, then before inserting the citation, put the point
>> +      ;; after the signature and insert a newline for spacing. Also respects
>> +      ;; if `message-cite-reply-position' is set via `message-cite-style'.
>> +      (when (or (equal message-cite-reply-position 'above)
>
> Nit: I think it is slightly better to use 'eq' instead of 'equal' here.
>
>> +                (and message-cite-style
>> +                     (eq (eval (cadr
>> +                                (assoc 'message-cite-reply-position
>
> Likewise, here we may use 'assq'.
>
>> +                                       (if (symbolp message-cite-style)
>> +                                           (eval message-cite-style)
>
> Here I think it is better to use 'symbol-value' instead of 'eval'.
>
>> +                                         message-cite-style))))
>> +                         'above)))
>> +        (goto-char (point-max))
>> +        (insert "\n"))
>>        (let ((from (plist-get original-headers :From))
>>  	    (date (plist-get original-headers :Date))
>>  	    (start (point)))
>
> Regards,
> Pengji

Hi Pengji,

Thank you very much for your suggestions. I think they're valid. I've
incorporated them into my new patches.

-- 
In gratitude,
Kristoffer

      parent reply	other threads:[~2024-11-05  5:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-13  7:54 Obey message-cite-reply-position from Emacs' message.el Kristoffer Balintona
2024-10-17 10:31 ` Pengji Zhang
2024-10-17 11:34   ` David Bremner
2024-11-05  5:58     ` Kristoffer Balintona
2024-11-05  5:45   ` Kristoffer Balintona [this message]

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

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANVbq5nsyA9vHj0kH9HPKB9XSsR5beXQfqixyE+4MeoDC=A3rQ@mail.gmail.com' \
    --to=krisbalintona@gmail.com \
    --cc=me@pengjiz.com \
    --cc=notmuch@notmuchmail.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.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.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).