Re: Variable used to detect reply prefixes in Subject

2022-01-23 Thread David Bremner
Jonas Bernoulli  writes:

> Hello,
>
> Please tell me what variable I have to customize to recognize additional
> unusual prefixes that some people add to the subject when they send a
> reply.
>
> I searched using some strings I would expect to appear in the value of
> that variable but either got no results or way too many.

There is some simple (-minded?) processing in notmuch-reply.c, which
just adds Re: to the front of the subject if it is not already present.

The original headers are also returned, so in principle the emacs front
end could do something smarter.

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


Re: Variable used to detect reply prefixes in Subject

2022-01-23 Thread Teemu Likonen
* 2022-01-23 15:13:18+0100, Jonas Bernoulli wrote:

> Please tell me what variable I have to customize to recognize
> additional unusual prefixes that some people add to the subject when
> they send a reply.

There is message-subject-re-regexp. 

> Ps: Since (I assume) many notmuch users also frequent emacs-devel,
> where a frequent commentator uses the prefix "RE: [External] : ",
> maybe notmuch could even recognize that by default? (I asked him
> to consider not doing that anymore, but even if he agrees, that
> would not affect his numerous past replies.)

Yes. That is annoying. I have written a custom Subject cleaner for my
replies:


(add-hook 'message-setup-hook 'my-message-subject-clean)

(defun my-message-subject-clean ()
  ;; Delete first \( ... \) group from Subject header.
  (my-with-message-headers
(let ((case-fold-search nil))
  (dolist (re '(".*\\(\\[ ?SPAM\\(?: UNSURE\\|\\?\\)? ?\\] \\(?:Re: \\)?\\)"
".*\\(\\(?:Re: \\)* *\\[External\\][ :]*\\(?:Re: *\\)*\\)"))
(goto-char (point-min))
(when (re-search-forward (concat "^Subject: " re) nil t)
  (delete-region (match-beginning 1) (match-end 1)))

(defmacro my-with-message-headers (&rest body)
  (declare (indent 0))
  `(save-excursion
 (save-restriction
   (save-match-data
 (message-narrow-to-head)
 ,@body

-- 
/// Teemu Likonen - .-.. https://www.iki.fi/tlikonen/
// OpenPGP: 6965F03973F0D4CA22B9410F0F2CAE0E07608462


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Variable used to detect reply prefixes in Subject

2022-01-23 Thread Jonas Bernoulli
Hello,

Please tell me what variable I have to customize to recognize additional
unusual prefixes that some people add to the subject when they send a
reply.

I searched using some strings I would expect to appear in the value of
that variable but either got no results or way too many.

 Thanks!
 Jonas


Ps: Since (I assume) many notmuch users also frequent emacs-devel,
where a frequent commentator uses the prefix "RE: [External] : ",
maybe notmuch could even recognize that by default? (I asked him
to consider not doing that anymore, but even if he agrees, that
would not affect his numerous past replies.)
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org