aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2021-01-30 00:40:21 -0500
committerStefan Monnier2021-01-30 12:29:58 -0500
commit9e96fca53dbd9f52b69341dbb5d9849fd2b5a16c (patch)
tree64fe3d0bca876bd8cc4710020b64f162d6089592
parentd6f8bce6d4595bc1af53772fa0f302e16adcbf23 (diff)
downloademacs-9e96fca53dbd9f52b69341dbb5d9849fd2b5a16c.tar.gz
emacs-9e96fca53dbd9f52b69341dbb5d9849fd2b5a16c.zip
* lisp/gnus/mm-encode.el (mm-default-file-type): New name
Rename from misleading `mm-default-file-encoding`. (mm-default-file-encoding): Redefine as obsolete alias. * lisp/mail/sendmail.el (mail-add-attachment): * lisp/mh-e/mh-mime.el (mh-minibuffer-read-type): * lisp/gnus/gnus-art.el (gnus-mime-view-part-as-type-internal): * lisp/gnus/gnus-dired.el (gnus-dired-attach): * lisp/gnus/mml.el (mml-generate-mime-1, mml-minibuffer-read-type) (mml-attach-file): Use the new name.
-rw-r--r--lisp/gnus/gnus-art.el2
-rw-r--r--lisp/gnus/gnus-dired.el6
-rw-r--r--lisp/gnus/mm-encode.el9
-rw-r--r--lisp/gnus/mml.el8
-rw-r--r--lisp/mail/sendmail.el6
-rw-r--r--lisp/mh-e/mh-mime.el4
6 files changed, 19 insertions, 16 deletions
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index ca24e6f251f..7ae4e5836a4 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -5206,7 +5206,7 @@ Use CMD as the process."
5206 (mail-content-type-get (mm-handle-type handle) 'name) 5206 (mail-content-type-get (mm-handle-type handle) 'name)
5207 ;; Content-Disposition: attachment; filename=... 5207 ;; Content-Disposition: attachment; filename=...
5208 (cdr (assq 'filename (cdr (mm-handle-disposition handle)))))) 5208 (cdr (assq 'filename (cdr (mm-handle-disposition handle))))))
5209 (def-type (and name (mm-default-file-encoding name)))) 5209 (def-type (and name (mm-default-file-type name))))
5210 (or (and def-type (cons def-type 0)) 5210 (or (and def-type (cons def-type 0))
5211 (and handle 5211 (and handle
5212 (equal (mm-handle-media-supertype handle) "text") 5212 (equal (mm-handle-media-supertype handle) "text")
diff --git a/lisp/gnus/gnus-dired.el b/lisp/gnus/gnus-dired.el
index e78163afe28..e412dd01a28 100644
--- a/lisp/gnus/gnus-dired.el
+++ b/lisp/gnus/gnus-dired.el
@@ -40,7 +40,6 @@
40 40
41(require 'dired) 41(require 'dired)
42(autoload 'mml-attach-file "mml") 42(autoload 'mml-attach-file "mml")
43(autoload 'mm-default-file-encoding "mm-decode");; Shift this to `mailcap.el'?
44(autoload 'mailcap-extension-to-mime "mailcap") 43(autoload 'mailcap-extension-to-mime "mailcap")
45(autoload 'mailcap-mime-info "mailcap") 44(autoload 'mailcap-mime-info "mailcap")
46 45
@@ -166,8 +165,9 @@ filenames."
166 (goto-char (point-max)) ;attach at end of buffer 165 (goto-char (point-max)) ;attach at end of buffer
167 (while files-to-attach 166 (while files-to-attach
168 (mml-attach-file (car files-to-attach) 167 (mml-attach-file (car files-to-attach)
169 (or (mm-default-file-encoding (car files-to-attach)) 168 (or (mm-default-file-type (car files-to-attach))
170 "application/octet-stream") nil) 169 "application/octet-stream")
170 nil)
171 (setq files-to-attach (cdr files-to-attach))) 171 (setq files-to-attach (cdr files-to-attach)))
172 (message "Attached file(s) %s" files-str)))) 172 (message "Attached file(s) %s" files-str))))
173 173
diff --git a/lisp/gnus/mm-encode.el b/lisp/gnus/mm-encode.el
index 8bd3e0b3d2d..31d613146b3 100644
--- a/lisp/gnus/mm-encode.el
+++ b/lisp/gnus/mm-encode.el
@@ -98,9 +98,12 @@ This variable should never be set directly, but bound before a call to
98 boundary)) 98 boundary))
99 99
100;;;###autoload 100;;;###autoload
101(defun mm-default-file-encoding (file) 101(define-obsolete-function-alias 'mm-default-file-encoding
102 "Return a default encoding for FILE." 102 #'mm-default-file-type "future") ;Old bad name.
103 (if (not (string-match "\\.[^.]+$" file)) 103;;;###autoload
104(defun mm-default-file-type (file)
105 "Return a default content type for FILE."
106 (if (not (string-match "\\.[^.]+\\'" file))
104 "application/octet-stream" 107 "application/octet-stream"
105 (mailcap-extension-to-mime (match-string 0 file)))) 108 (mailcap-extension-to-mime (match-string 0 file))))
106 109
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 752dede8d01..acde958c05b 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -617,7 +617,7 @@ type detected."
617 (filename (cdr (assq 'filename cont))) 617 (filename (cdr (assq 'filename cont)))
618 (type (or (cdr (assq 'type cont)) 618 (type (or (cdr (assq 'type cont))
619 (if filename 619 (if filename
620 (or (mm-default-file-encoding filename) 620 (or (mm-default-file-type filename)
621 "application/octet-stream") 621 "application/octet-stream")
622 "text/plain"))) 622 "text/plain")))
623 (charset (cdr (assq 'charset cont))) 623 (charset (cdr (assq 'charset cont)))
@@ -775,7 +775,7 @@ type detected."
775 (insert "Content-Type: " 775 (insert "Content-Type: "
776 (or (cdr (assq 'type cont)) 776 (or (cdr (assq 'type cont))
777 (if name 777 (if name
778 (or (mm-default-file-encoding name) 778 (or (mm-default-file-type name)
779 "application/octet-stream") 779 "application/octet-stream")
780 "text/plain")) 780 "text/plain"))
781 "\n") 781 "\n")
@@ -1304,7 +1304,7 @@ If not set, `default-directory' will be used."
1304 (require 'mailcap) 1304 (require 'mailcap)
1305 (mailcap-parse-mimetypes) 1305 (mailcap-parse-mimetypes)
1306 (let* ((default (or default 1306 (let* ((default (or default
1307 (mm-default-file-encoding name) 1307 (mm-default-file-type name)
1308 ;; Perhaps here we should check what the file 1308 ;; Perhaps here we should check what the file
1309 ;; looks like, and offer text/plain if it looks 1309 ;; looks like, and offer text/plain if it looks
1310 ;; like text/plain. 1310 ;; like text/plain.
@@ -1426,7 +1426,7 @@ will be computed and used."
1426 (interactive 1426 (interactive
1427 (let* ((file (mml-minibuffer-read-file "Attach file: ")) 1427 (let* ((file (mml-minibuffer-read-file "Attach file: "))
1428 (type (if current-prefix-arg 1428 (type (if current-prefix-arg
1429 (or (mm-default-file-encoding file) 1429 (or (mm-default-file-type file)
1430 "application/octet-stream") 1430 "application/octet-stream")
1431 (mml-minibuffer-read-type file))) 1431 (mml-minibuffer-read-type file)))
1432 (description (if current-prefix-arg 1432 (description (if current-prefix-arg
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index d2601c35e8d..cd071667562 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -1800,14 +1800,14 @@ If the current line has `mail-yank-prefix', insert it on the new line."
1800 1800
1801(declare-function mml-attach-file "mml" 1801(declare-function mml-attach-file "mml"
1802 (file &optional type description disposition)) 1802 (file &optional type description disposition))
1803(declare-function mm-default-file-encoding "mm-encode" (file))
1804 1803
1805(defun mail-add-attachment (file) 1804(defun mail-add-attachment (file)
1806 "Add FILE as a MIME attachment to the end of the mail message being composed." 1805 "Add FILE as a MIME attachment to the end of the mail message being composed."
1807 (interactive "fAttach file: ") 1806 (interactive "fAttach file: ")
1808 (mml-attach-file file 1807 (mml-attach-file file
1809 (or (mm-default-file-encoding file) 1808 (or (mm-default-file-type file)
1810 "application/octet-stream") nil) 1809 "application/octet-stream")
1810 nil)
1811 (setq mail-encode-mml t)) 1811 (setq mail-encode-mml t))
1812 1812
1813 1813
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index 7bdf743fc42..70df9e6b0f2 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -1725,14 +1725,14 @@ a type (see `mailcap-mime-types').
1725Optional argument DEFAULT is returned if a type isn't entered." 1725Optional argument DEFAULT is returned if a type isn't entered."
1726 (mailcap-parse-mimetypes) 1726 (mailcap-parse-mimetypes)
1727 (let* ((default (or default 1727 (let* ((default (or default
1728 (mm-default-file-encoding filename) 1728 (mm-default-file-type filename)
1729 "application/octet-stream")) 1729 "application/octet-stream"))
1730 (probed-type (mh-file-mime-type filename)) 1730 (probed-type (mh-file-mime-type filename))
1731 (type (or (and (not (equal probed-type "application/octet-stream")) 1731 (type (or (and (not (equal probed-type "application/octet-stream"))
1732 probed-type) 1732 probed-type)
1733 (completing-read 1733 (completing-read
1734 (format "Content type (default %s): " default) 1734 (format "Content type (default %s): " default)
1735 (mapcar 'list (mailcap-mime-types)))))) 1735 (mapcar #'list (mailcap-mime-types))))))
1736 (if (not (equal type "")) 1736 (if (not (equal type ""))
1737 type 1737 type
1738 default))) 1738 default)))