discussion and development of piem
 help / color / mirror / code / Atom feed
* [PATCH] Prefer mail-decode-encoded-word-string to rfc2047-decode-string
@ 2021-09-23  1:23 Kyle Meyer
  0 siblings, 0 replies; only message in thread
From: Kyle Meyer @ 2021-09-23  1:23 UTC (permalink / raw)
  To: piem

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-23  1:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23  1:23 [PATCH] Prefer mail-decode-encoded-word-string to rfc2047-decode-string Kyle Meyer

Code repositories for project(s) associated with this 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).