discussion and development of piem
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: piem@inbox.kyleam.com
Subject: [PATCH] Prefer mail-decode-encoded-word-string to rfc2047-decode-string
Date: Wed, 22 Sep 2021 21:23:53 -0400	[thread overview]
Message-ID: <20210923012353.256964-1-kyle@kyleam.com> (raw)

mail-parse.el defines mail-decode-encoded-word-string as an alias for
rfc2047-decode-string.  Use the higher-level wrapper for the reasons
described in (emacs-mime)Interface.
---
 piem-gnus.el | 4 ++--
 piem.el      | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/piem-gnus.el b/piem-gnus.el
index 3fb8c7d5..98e67c92 100644
--- a/piem-gnus.el
+++ b/piem-gnus.el
@@ -30,9 +30,9 @@
 (require 'gnus)
 (require 'gnus-art)
 (require 'gnus-sum)
+(require 'mail-parse)
 (require 'message)
 (require 'piem)
-(require 'rfc2047)
 
 (defgroup piem-gnus nil
   "Gnus integration for piem."
@@ -109,7 +109,7 @@ (defun piem-gnus-am-ready-mbox ()
                             (widen)
                             (and (string-match-p
                                   piem-patch-subject-re
-                                  (rfc2047-decode-string
+                                  (mail-decode-encoded-word-string
                                    (message-field-value "subject")))
                                  (buffer-substring-no-properties
                                   (point-min) (point-max)))))))
diff --git a/piem.el b/piem.el
index 0c5f9cf3..16ccdfc5 100644
--- a/piem.el
+++ b/piem.el
@@ -40,10 +40,10 @@
 (require 'browse-url)
 (require 'cl-lib)
 (require 'mail-extr)
+(require 'mail-parse)
 (require 'message)
 (require 'mm-decode)
 (require 'piem-maildir)
-(require 'rfc2047)
 (require 'subr-x)
 (require 'transient)
 (require 'url)
@@ -472,7 +472,7 @@ (defun piem--message-fetch-decoded-fields (headers)
       (message-narrow-to-head)
       (mapcar (lambda (header)
                 (when-let ((val (message-fetch-field header)))
-                  (rfc2047-decode-string val)))
+                  (mail-decode-encoded-word-string val)))
               headers))))
 
 (defun piem-inbox-by-header-match ()

base-commit: c901d3ec025773c8eae04257099fcdfe704085ac
-- 
2.33.0


                 reply	other threads:[~2021-09-23  1:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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://git.kyleam.com/

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

  git send-email \
    --in-reply-to=20210923012353.256964-1-kyle@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=piem@inbox.kyleam.com \
    /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://git.kyleam.com/piem/

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).