1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

; migrate MH-E to mail-parse library

Move MH-E from low-level libraries to the high-level mail-parse library.

* lisp/mh-e/mh-comp.el: replace ietf-drums-parse-address with
mail-header-parse-address.
* lisp/mh-e/mh-junk.el: replace ietf-drums-parse-address with
mail-header-parse-address; remove mh-funcall-if-exists wrapper.
* lisp/mh-e/mh-xface.el: replace ietf-drums-parse-address with
mail-header-parse-address; remove fboundp wrapper.
* lisp/mh-e/mh-mime.el: replace rfc2047-decode-region with
mail-decode-encoded-word-region.
This commit is contained in:
Stephen Gildea 2021-08-23 19:58:13 -07:00
parent a849b56410
commit 120b2bb67b
4 changed files with 12 additions and 12 deletions

View file

@ -38,6 +38,7 @@
(require 'sendmail)
(autoload 'easy-menu-add "easymenu")
(autoload 'mail-header-parse-address "mail-parse")
(autoload 'mml-insert-tag "mml")
@ -452,7 +453,7 @@ See also `mh-send'."
;; Header field exists and we have a value
(let (address mailbox (alias (mh-alias-expand value)))
(and alias
(setq address (ietf-drums-parse-address alias))
(setq address (mail-header-parse-address alias))
(setq mailbox (car address)))
;; XXX - Need to parse all addresses out of field
(if (and

View file

@ -31,6 +31,8 @@
(require 'mh-e)
(require 'mh-scan)
(autoload 'mail-header-parse-address "mail-parse")
;;;###mh-autoload
(defun mh-junk-blocklist (range)
"Blocklist RANGE as spam.
@ -312,8 +314,7 @@ See `mh-spamassassin-blocklist' for more information."
"--ham" "--local" "--no-sync")))
(message "Allowlisting sender of message %d..." msg)
(setq from
(car (mh-funcall-if-exists
ietf-drums-parse-address (mh-get-header-field "From:"))))
(car (mail-header-parse-address (mh-get-header-field "From:"))))
(kill-buffer nil)
(if (or (null from) (equal from ""))
(message "Allowlisting sender of message %d...%s"

View file

@ -51,6 +51,7 @@
(autoload 'article-emphasize "gnus-art")
(autoload 'gnus-eval-format "gnus-spec")
(autoload 'mail-content-type-get "mail-parse")
(autoload 'mail-decode-encoded-word-region "mail-parse")
(autoload 'mail-decode-encoded-word-string "mail-parse")
(autoload 'mail-header-parse-content-type "mail-parse")
(autoload 'mail-header-strip-cte "mail-parse")
@ -61,7 +62,6 @@
(autoload 'mm-decode-body "mm-bodies")
(autoload 'mm-uu-dissect "mm-uu")
(autoload 'mml-unsecure-message "mml-sec")
(autoload 'rfc2047-decode-region "rfc2047")
(autoload 'widget-convert-button "wid-edit")
@ -496,7 +496,7 @@ decoding the same message multiple times."
"Decode RFC2047 encoded message header fields."
(when mh-decode-mime-flag
(let ((buffer-read-only nil))
(rfc2047-decode-region (point-min) (mh-mail-header-end)))))
(mail-decode-encoded-word-region (point-min) (mh-mail-header-end)))))
;;;###mh-autoload
(defun mh-decode-message-subject ()
@ -504,8 +504,9 @@ decoding the same message multiple times."
(when mh-decode-mime-flag
(save-excursion
(let ((buffer-read-only nil))
(rfc2047-decode-region (progn (mh-goto-header-field "Subject:") (point))
(progn (mh-header-field-end) (point)))))))
(mail-decode-encoded-word-region
(progn (mh-goto-header-field "Subject:") (point))
(progn (mh-header-field-end) (point)))))))
;;;###mh-autoload
(defun mh-mime-display (&optional pre-dissected-handles)

View file

@ -27,6 +27,7 @@
(require 'mh-e)
(autoload 'mail-header-parse-address "mail-parse")
(autoload 'message-fetch-field "message")
(defvar mh-show-xface-function
@ -190,11 +191,7 @@ The directories are searched for in the order they appear in the list.")
(let* ((from-field (ignore-errors (car (message-tokenize-header
(mh-get-header-field "from:")))))
(from (car (ignore-errors
;; Don't use mh-funcall-if-exists because
;; ietf-drums-parse-address might exist at run-time but
;; not at compile-time.
(when (fboundp 'ietf-drums-parse-address)
(ietf-drums-parse-address from-field)))))
(mail-header-parse-address from-field))))
(host (and from
(string-match "\\([^+]*\\)\\(\\+.*\\)?@\\(.*\\)" from)
(downcase (match-string 3 from))))