projects
/
gnus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(shr-insert-table): Bind free variable.
[gnus]
/
lisp
/
mml.el
diff --git
a/lisp/mml.el
b/lisp/mml.el
index
9dc0966
..
3cf0f37
100644
(file)
--- a/
lisp/mml.el
+++ b/
lisp/mml.el
@@
-33,10
+33,14
@@
(require 'mm-decode)
(require 'mml-sec)
(eval-when-compile (require 'cl))
(require 'mm-decode)
(require 'mml-sec)
(eval-when-compile (require 'cl))
+(eval-when-compile
+ (when (featurep 'xemacs)
+ (require 'easy-mmode))) ; for `define-minor-mode'
(autoload 'message-make-message-id "message")
(declare-function gnus-setup-posting-charset "gnus-msg" (group))
(autoload 'gnus-make-local-hook "gnus-util")
(autoload 'message-make-message-id "message")
(declare-function gnus-setup-posting-charset "gnus-msg" (group))
(autoload 'gnus-make-local-hook "gnus-util")
+(autoload 'gnus-completing-read "gnus-util")
(autoload 'message-fetch-field "message")
(autoload 'message-mark-active-p "message")
(autoload 'message-info "message")
(autoload 'message-fetch-field "message")
(autoload 'message-mark-active-p "message")
(autoload 'message-info "message")
@@
-117,10
+121,10
@@
match found will be used."
,dispositions))))
:group 'message)
,dispositions))))
:group 'message)
-(defcustom mml-insert-mime-headers-always
nil
+(defcustom mml-insert-mime-headers-always
t
"If non-nil, always put Content-Type: text/plain at top of empty parts.
It is necessary to work against a bug in certain clients."
"If non-nil, always put Content-Type: text/plain at top of empty parts.
It is necessary to work against a bug in certain clients."
- :version "2
2
.1"
+ :version "2
4
.1"
:type 'boolean
:group 'message)
:type 'boolean
:group 'message)
@@
-225,7
+229,10
@@
part. This is for the internal use, you should never modify the value.")
(let* (secure-mode
(taginfo (mml-read-tag))
(keyfile (cdr (assq 'keyfile taginfo)))
(let* (secure-mode
(taginfo (mml-read-tag))
(keyfile (cdr (assq 'keyfile taginfo)))
- (certfile (cdr (assq 'certfile taginfo)))
+ (certfiles (delq nil (mapcar (lambda (tag)
+ (if (eq (car-safe tag) 'certfile)
+ (cdr tag)))
+ taginfo)))
(recipients (cdr (assq 'recipients taginfo)))
(sender (cdr (assq 'sender taginfo)))
(location (cdr (assq 'tag-location taginfo)))
(recipients (cdr (assq 'recipients taginfo)))
(sender (cdr (assq 'sender taginfo)))
(location (cdr (assq 'tag-location taginfo)))
@@
-251,8
+258,10
@@
part. This is for the internal use, you should never modify the value.")
,@tags
,(if keyfile "keyfile")
,keyfile
,@tags
,(if keyfile "keyfile")
,keyfile
- ,(if certfile "certfile")
- ,certfile
+ ,@(apply #'append
+ (mapcar (lambda (certfile)
+ (list "certfile" certfile))
+ certfiles))
,(if recipients "recipients")
,recipients
,(if sender "sender")
,(if recipients "recipients")
,recipients
,(if sender "sender")
@@
-901,8
+910,7
@@
If HANDLES is non-nil, use it instead reparsing the buffer."
;; Determine type and stuff.
(unless (stringp (car handle))
(unless (setq textp (equal (mm-handle-media-supertype handle) "text"))
;; Determine type and stuff.
(unless (stringp (car handle))
(unless (setq textp (equal (mm-handle-media-supertype handle) "text"))
- (save-excursion
- (set-buffer (setq buffer (mml-generate-new-buffer " *mml*")))
+ (with-current-buffer (setq buffer (mml-generate-new-buffer " *mml*"))
(if (eq (mail-content-type-get (mm-handle-type handle) 'charset)
'gnus-decoded)
;; A part that mm-uu dissected from a non-MIME message
(if (eq (mail-content-type-get (mm-handle-type handle) 'charset)
'gnus-decoded)
;; A part that mm-uu dissected from a non-MIME message
@@
-1129,25
+1137,18
@@
If HANDLES is non-nil, use it instead reparsing the buffer."
,@(if (featurep 'xemacs) '(t)
'(:help "Display the EasyPG manual"))]))
,@(if (featurep 'xemacs) '(t)
'(:help "Display the EasyPG manual"))]))
-(defvar mml-mode nil
- "Minor mode for editing MML.")
-
-(defun mml-mode (&optional arg)
+(define-minor-mode mml-mode
"Minor mode for editing MML.
MML is the MIME Meta Language, a minor mode for composing MIME articles.
See Info node `(emacs-mime)Composing'.
\\{mml-mode-map}"
"Minor mode for editing MML.
MML is the MIME Meta Language, a minor mode for composing MIME articles.
See Info node `(emacs-mime)Composing'.
\\{mml-mode-map}"
- (interactive "P")
- (when (set (make-local-variable 'mml-mode)
- (if (null arg) (not mml-mode)
- (> (prefix-numeric-value arg) 0)))
- (add-minor-mode 'mml-mode " MML" mml-mode-map)
+ :lighter " MML" :keymap mml-mode-map
+ (when mml-mode
(easy-menu-add mml-menu mml-mode-map)
(when (boundp 'dnd-protocol-alist)
(set (make-local-variable 'dnd-protocol-alist)
(easy-menu-add mml-menu mml-mode-map)
(when (boundp 'dnd-protocol-alist)
(set (make-local-variable 'dnd-protocol-alist)
- (append mml-dnd-protocol-alist dnd-protocol-alist)))
- (run-hooks 'mml-mode-hook)))
+ (append mml-dnd-protocol-alist dnd-protocol-alist)))))
;;;
;;; Helper functions for reading MIME stuff from the minibuffer and
;;;
;;; Helper functions for reading MIME stuff from the minibuffer and
@@
-1188,9
+1189,10
@@
If not set, `default-directory' will be used."
;; looks like, and offer text/plain if it looks
;; like text/plain.
"application/octet-stream"))
;; looks like, and offer text/plain if it looks
;; like text/plain.
"application/octet-stream"))
- (string (completing-read
- (format "Content type (default %s): " default)
- (mapcar 'list (mailcap-mime-types)))))
+ (string (gnus-completing-read
+ "Content type"
+ (mailcap-mime-types)
+ nil nil nil default)))
(if (not (equal string ""))
string
default)))
(if (not (equal string ""))
string
default)))
@@
-1204,10
+1206,10
@@
If not set, `default-directory' will be used."
(defun mml-minibuffer-read-disposition (type &optional default filename)
(unless default
(setq default (mml-content-disposition type filename)))
(defun mml-minibuffer-read-disposition (type &optional default filename)
(unless default
(setq default (mml-content-disposition type filename)))
- (let ((disposition (completing-read
- (format "Disposition (default %s): " default)
- '(
("attachment") ("inline") ("")
)
-
nil
t nil nil default)))
+ (let ((disposition (
gnus-
completing-read
+ "Disposition"
+ '(
"attachment" "inline"
)
+ t nil nil default)))
(if (not (equal disposition ""))
disposition
default)))
(if (not (equal disposition ""))
disposition
default)))
@@
-1395,11
+1397,11
@@
TYPE is the MIME type to use."
(defun mml-insert-multipart (&optional type)
(interactive (if (message-in-body-p)
(defun mml-insert-multipart (&optional type)
(interactive (if (message-in-body-p)
- (list (
completing-read "Multipart type (default mixed):
"
- '(("mixed") ("alternative")
- ("digest") ("parallel")
-
("signed") ("encrypted")
)
-
nil
nil "mixed"))
+ (list (
gnus-completing-read "Multipart type
"
+ '("mixed" "alternative"
+ "digest" "parallel"
+
"signed" "encrypted"
)
+
nil "mixed"))
(error "Use this command in the message body")))
(or type
(setq type "mixed"))
(error "Use this command in the message body")))
(or type
(setq type "mixed"))
@@
-1570,5
+1572,4
@@
or the `pop-to-buffer' function."
(provide 'mml)
(provide 'mml)
-;; arch-tag: 583c96cf-1ffe-451b-a5e5-4733ae9ddd12
;;; mml.el ends here
;;; mml.el ends here