mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-17 03:10:58 -08:00
* 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.
This commit is contained in:
parent
d6f8bce6d4
commit
9e96fca53d
6 changed files with 19 additions and 16 deletions
|
|
@ -5206,7 +5206,7 @@ Use CMD as the process."
|
||||||
(mail-content-type-get (mm-handle-type handle) 'name)
|
(mail-content-type-get (mm-handle-type handle) 'name)
|
||||||
;; Content-Disposition: attachment; filename=...
|
;; Content-Disposition: attachment; filename=...
|
||||||
(cdr (assq 'filename (cdr (mm-handle-disposition handle))))))
|
(cdr (assq 'filename (cdr (mm-handle-disposition handle))))))
|
||||||
(def-type (and name (mm-default-file-encoding name))))
|
(def-type (and name (mm-default-file-type name))))
|
||||||
(or (and def-type (cons def-type 0))
|
(or (and def-type (cons def-type 0))
|
||||||
(and handle
|
(and handle
|
||||||
(equal (mm-handle-media-supertype handle) "text")
|
(equal (mm-handle-media-supertype handle) "text")
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@
|
||||||
|
|
||||||
(require 'dired)
|
(require 'dired)
|
||||||
(autoload 'mml-attach-file "mml")
|
(autoload 'mml-attach-file "mml")
|
||||||
(autoload 'mm-default-file-encoding "mm-decode");; Shift this to `mailcap.el'?
|
|
||||||
(autoload 'mailcap-extension-to-mime "mailcap")
|
(autoload 'mailcap-extension-to-mime "mailcap")
|
||||||
(autoload 'mailcap-mime-info "mailcap")
|
(autoload 'mailcap-mime-info "mailcap")
|
||||||
|
|
||||||
|
|
@ -166,8 +165,9 @@ filenames."
|
||||||
(goto-char (point-max)) ;attach at end of buffer
|
(goto-char (point-max)) ;attach at end of buffer
|
||||||
(while files-to-attach
|
(while files-to-attach
|
||||||
(mml-attach-file (car files-to-attach)
|
(mml-attach-file (car files-to-attach)
|
||||||
(or (mm-default-file-encoding (car files-to-attach))
|
(or (mm-default-file-type (car files-to-attach))
|
||||||
"application/octet-stream") nil)
|
"application/octet-stream")
|
||||||
|
nil)
|
||||||
(setq files-to-attach (cdr files-to-attach)))
|
(setq files-to-attach (cdr files-to-attach)))
|
||||||
(message "Attached file(s) %s" files-str))))
|
(message "Attached file(s) %s" files-str))))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,9 +98,12 @@ This variable should never be set directly, but bound before a call to
|
||||||
boundary))
|
boundary))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun mm-default-file-encoding (file)
|
(define-obsolete-function-alias 'mm-default-file-encoding
|
||||||
"Return a default encoding for FILE."
|
#'mm-default-file-type "future") ;Old bad name.
|
||||||
(if (not (string-match "\\.[^.]+$" file))
|
;;;###autoload
|
||||||
|
(defun mm-default-file-type (file)
|
||||||
|
"Return a default content type for FILE."
|
||||||
|
(if (not (string-match "\\.[^.]+\\'" file))
|
||||||
"application/octet-stream"
|
"application/octet-stream"
|
||||||
(mailcap-extension-to-mime (match-string 0 file))))
|
(mailcap-extension-to-mime (match-string 0 file))))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -617,7 +617,7 @@ type detected."
|
||||||
(filename (cdr (assq 'filename cont)))
|
(filename (cdr (assq 'filename cont)))
|
||||||
(type (or (cdr (assq 'type cont))
|
(type (or (cdr (assq 'type cont))
|
||||||
(if filename
|
(if filename
|
||||||
(or (mm-default-file-encoding filename)
|
(or (mm-default-file-type filename)
|
||||||
"application/octet-stream")
|
"application/octet-stream")
|
||||||
"text/plain")))
|
"text/plain")))
|
||||||
(charset (cdr (assq 'charset cont)))
|
(charset (cdr (assq 'charset cont)))
|
||||||
|
|
@ -775,7 +775,7 @@ type detected."
|
||||||
(insert "Content-Type: "
|
(insert "Content-Type: "
|
||||||
(or (cdr (assq 'type cont))
|
(or (cdr (assq 'type cont))
|
||||||
(if name
|
(if name
|
||||||
(or (mm-default-file-encoding name)
|
(or (mm-default-file-type name)
|
||||||
"application/octet-stream")
|
"application/octet-stream")
|
||||||
"text/plain"))
|
"text/plain"))
|
||||||
"\n")
|
"\n")
|
||||||
|
|
@ -1304,7 +1304,7 @@ If not set, `default-directory' will be used."
|
||||||
(require 'mailcap)
|
(require 'mailcap)
|
||||||
(mailcap-parse-mimetypes)
|
(mailcap-parse-mimetypes)
|
||||||
(let* ((default (or default
|
(let* ((default (or default
|
||||||
(mm-default-file-encoding name)
|
(mm-default-file-type name)
|
||||||
;; Perhaps here we should check what the file
|
;; Perhaps here we should check what the file
|
||||||
;; looks like, and offer text/plain if it looks
|
;; looks like, and offer text/plain if it looks
|
||||||
;; like text/plain.
|
;; like text/plain.
|
||||||
|
|
@ -1426,7 +1426,7 @@ will be computed and used."
|
||||||
(interactive
|
(interactive
|
||||||
(let* ((file (mml-minibuffer-read-file "Attach file: "))
|
(let* ((file (mml-minibuffer-read-file "Attach file: "))
|
||||||
(type (if current-prefix-arg
|
(type (if current-prefix-arg
|
||||||
(or (mm-default-file-encoding file)
|
(or (mm-default-file-type file)
|
||||||
"application/octet-stream")
|
"application/octet-stream")
|
||||||
(mml-minibuffer-read-type file)))
|
(mml-minibuffer-read-type file)))
|
||||||
(description (if current-prefix-arg
|
(description (if current-prefix-arg
|
||||||
|
|
|
||||||
|
|
@ -1800,14 +1800,14 @@ If the current line has `mail-yank-prefix', insert it on the new line."
|
||||||
|
|
||||||
(declare-function mml-attach-file "mml"
|
(declare-function mml-attach-file "mml"
|
||||||
(file &optional type description disposition))
|
(file &optional type description disposition))
|
||||||
(declare-function mm-default-file-encoding "mm-encode" (file))
|
|
||||||
|
|
||||||
(defun mail-add-attachment (file)
|
(defun mail-add-attachment (file)
|
||||||
"Add FILE as a MIME attachment to the end of the mail message being composed."
|
"Add FILE as a MIME attachment to the end of the mail message being composed."
|
||||||
(interactive "fAttach file: ")
|
(interactive "fAttach file: ")
|
||||||
(mml-attach-file file
|
(mml-attach-file file
|
||||||
(or (mm-default-file-encoding file)
|
(or (mm-default-file-type file)
|
||||||
"application/octet-stream") nil)
|
"application/octet-stream")
|
||||||
|
nil)
|
||||||
(setq mail-encode-mml t))
|
(setq mail-encode-mml t))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1725,14 +1725,14 @@ a type (see `mailcap-mime-types').
|
||||||
Optional argument DEFAULT is returned if a type isn't entered."
|
Optional argument DEFAULT is returned if a type isn't entered."
|
||||||
(mailcap-parse-mimetypes)
|
(mailcap-parse-mimetypes)
|
||||||
(let* ((default (or default
|
(let* ((default (or default
|
||||||
(mm-default-file-encoding filename)
|
(mm-default-file-type filename)
|
||||||
"application/octet-stream"))
|
"application/octet-stream"))
|
||||||
(probed-type (mh-file-mime-type filename))
|
(probed-type (mh-file-mime-type filename))
|
||||||
(type (or (and (not (equal probed-type "application/octet-stream"))
|
(type (or (and (not (equal probed-type "application/octet-stream"))
|
||||||
probed-type)
|
probed-type)
|
||||||
(completing-read
|
(completing-read
|
||||||
(format "Content type (default %s): " default)
|
(format "Content type (default %s): " default)
|
||||||
(mapcar 'list (mailcap-mime-types))))))
|
(mapcar #'list (mailcap-mime-types))))))
|
||||||
(if (not (equal type ""))
|
(if (not (equal type ""))
|
||||||
type
|
type
|
||||||
default)))
|
default)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue