-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
guile: Fix the mu:body message method #2801
Conversation
It's stated to be US-ASCII with 7-bit encoding, but it contains the UTF-8 character '—'. Fixing the encoding very slightly changes the average size of messages reported by mu:average, so adjust the new expected value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, with a few changes.
@@ -38,8 +38,7 @@ | |||
mu:header | |||
;; message accessors | |||
mu:field:bcc | |||
mu:field:body-html | |||
mu:field:body-txt | |||
mu:field:body | |||
mu:field:cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although the Mu Guile API is deprecated, people may depend on it, so wouldn't want to add backward-incompatibilities if it can be avoided.
So, it's okay to remove body-txt/body-html from the documentation, but keep the functions around; the former as a synonym for body
and the latter always returning #f
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I'll send an updated version with that change.
Is it ok if I force-push to this branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just force-pushed a version implementing the change.
Content-type: text/plain; charset=us-ascii | ||
Content-transfer-encoding: 7BIT | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
Precedence: high | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, otherwise the msg:body
test fails, because with the wrong charset the em dash is skipped.
There are two alternatives:
- Substitute the em dash with a regular hyphen.
- Change the test to expect the wrong text, with the em dash omitted.
Is the charset wrong on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't change this part in the new version.
Somewhere along the way, the body-txt and body-html fields were merged into a single body field. Later, commit 8eac392 ("guile: re-enable the guile support") finally removed support for Field::Id::BodyHtml from mu:c:get-field. Unfortunately mu.scm and the documentation are still stuck in the past, so update them. mu:body-txt is now a synonym for mu:body, and mu:body-html always returns #f. I wanted to add a mu:body test also for the rfc822.1 message, but there's currently a bug where its body text is is duplicated (issue djcb#2802), so the test would fail.
Most are in comments, but one is in code.
d4ff7c7
to
5113799
Compare
Thanks, looks good! Merged. |
Hello,
I wanted to use the
mu:body-txt
method mentioned in the mu-guile documentation, but it didn't work.This branch renames it to
mu:body
, removesmu:body-html
(since theBodyHtml
field doesn't exist anymore) and updates the test and documentation.Please let me know if there are any changes or improvements that should be made.