* bug#58630: [PATCH] Make `message-fill-yanked-message' ignore debbugs commands
@ 2022-10-19 11:32 Stefan Kangas
0 siblings, 0 replies; only message in thread
From: Stefan Kangas @ 2022-10-19 11:32 UTC (permalink / raw)
To: 58630
[-- Attachment #1: Type: text/plain, Size: 406 bytes --]
Severity: wishlish
I often use `message-fill-yanked-message', but it incorrectly reflows
debbugs control commands in the beginning of the mail.
So this
close 111
thanks
becomes
close 111 thanks
which means I have to manually edit them again to be on separate lines.
I think it would be more convenient if they were ignored, at least when
`debbugs' is installed. See the attached patch.
[-- Attachment #2: 0001-Make-message-fill-yanked-message-ignore-debbugs-comm.patch --]
[-- Type: text/x-diff, Size: 1235 bytes --]
From ec9c3d0a96f6aad20d05d23489baead14fc1222b Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Wed, 19 Oct 2022 13:19:48 +0200
Subject: [PATCH] Make message-fill-yanked-message ignore debbugs commands
* lisp/gnus/message.el (message-fill-yanked-message): Ignore debbugs
control commands when the `debbugs' package is installed.
---
lisp/gnus/message.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index a714e31876..9f4cddd078 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -3918,6 +3918,12 @@ message-fill-yanked-message
(save-excursion
(goto-char (point-min))
(search-forward (concat "\n" mail-header-separator "\n") nil t)
+ ;; Skip debbugs control commands.
+ (when (and (boundp 'debbugs-gnu-control-message-keywords)
+ (boundp 'debbugs-gnu-control-message-end-regexp))
+ (while (looking-at (rx (or (regexp debbugs-gnu-control-message-commands-regexp)
+ (regexp debbugs-gnu-control-message-end-regexp))))
+ (forward-line 1)))
(let ((fill-prefix message-yank-prefix))
(fill-individual-paragraphs (point) (point-max) justifyp))))
--
2.35.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-10-19 11:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19 11:32 bug#58630: [PATCH] Make `message-fill-yanked-message' ignore debbugs commands Stefan Kangas
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.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).