all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#31651: 26.1.50; message-forward-included-headers should contain "^$"
@ 2018-05-30  3:07 Katsumi Yamaoka
  2018-05-30  7:56 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Katsumi Yamaoka @ 2018-05-30  3:07 UTC (permalink / raw
  To: 31651

Hi,

The docstring of `message-forward-included-headers' says:

  This variable should be a regexp or a list of regexps.

But if it is a regexp, it should contain "^$" like:

"^$\\|^\\(?:Cc\\|Date\\|From\\|In-Reply-To\\|Message-Id\\|References\\|Reply-To\\|Subject\\|To\\|User-Agent\\|X-Mailer\\):"

Or the header separator in a forward message will be removed
and the message will get malformed.

A better way to solve this issue would be to improve the
`message-remove-ignored-headers' code rather than adding a causion
to the docstring of `message-forward-included-headers', I think.

I use `message-forward-as-mime' with t as it was before.

Thanks.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#31651: 26.1.50; message-forward-included-headers should contain "^$"
  2018-05-30  3:07 bug#31651: 26.1.50; message-forward-included-headers should contain "^$" Katsumi Yamaoka
@ 2018-05-30  7:56 ` Andreas Schwab
  2018-05-30 23:30   ` Katsumi Yamaoka
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2018-05-30  7:56 UTC (permalink / raw
  To: Katsumi Yamaoka; +Cc: 31651

On Mai 30 2018, Katsumi Yamaoka <yamaoka@jpl.org> wrote:

> But if it is a regexp, it should contain "^$" like:
>
> "^$\\|^\\(?:Cc\\|Date\\|From\\|In-Reply-To\\|Message-Id\\|References\\|Reply-To\\|Subject\\|To\\|User-Agent\\|X-Mailer\\):"
>
> Or the header separator in a forward message will be removed
> and the message will get malformed.

I think this is a bug.  The empty line is not a header line, so it
should not be matched against.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#31651: 26.1.50; message-forward-included-headers should contain "^$"
  2018-05-30  7:56 ` Andreas Schwab
@ 2018-05-30 23:30   ` Katsumi Yamaoka
  0 siblings, 0 replies; 3+ messages in thread
From: Katsumi Yamaoka @ 2018-05-30 23:30 UTC (permalink / raw
  To: Andreas Schwab; +Cc: 31651

On Wed, 30 May 2018 09:56:11 +0200, Andreas Schwab wrote:
> I think this is a bug.  The empty line is not a header line, so it
> should not be matched against.

Though I was going to apply the following first change, I came
to think you are right and committed the second one.  Thanks.

1. Make `message-remove-ignored-headers' exclude header separator
   when narrowing.

--- message.el~	2018-01-12 03:53:45.394148600 +0000
+++ message.el	2018-05-30 22:49:55.198043700 +0000
@@ -7393,3 +7393,6 @@
       (narrow-to-region (point)
-			(or (search-forward "\n\n" nil t) (point)))
+			(if (search-forward "\n\n" nil t)
+			    ;; Exclude header separator.
+			    (1- (match-end 0))
+			  (point)))
       (when message-forward-ignored-headers

2. Make `message-remove-header' not remove things not looking
   like header ("[!-9;-~]+:" comes from RFC2822 section 2.2).

--- message.el~	2018-01-12 03:53:45.394148600 +0000
+++ message.el	2018-05-30 22:49:55.198043700 +0000
@@ -2433,3 +2433,5 @@
       (if (if reverse
-	      (not (looking-at regexp))
+	      (and (not (looking-at regexp))
+		   ;; Don't remove things not looking like header.
+		   (looking-at "[!-9;-~]+:"))
 	    (looking-at regexp))





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-30 23:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-30  3:07 bug#31651: 26.1.50; message-forward-included-headers should contain "^$" Katsumi Yamaoka
2018-05-30  7:56 ` Andreas Schwab
2018-05-30 23:30   ` Katsumi Yamaoka

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.