Function: mml-secure-part
mml-secure-part is a byte-compiled function defined in mml-sec.el.gz.
Signature
(mml-secure-part METHOD &optional SIGN)
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/mml-sec.el.gz
(defun mml-secure-part (method &optional sign)
(save-excursion
(let ((tags (funcall (nth 2 (assoc method (if sign mml-sign-alist
mml-encrypt-alist))))))
(cond ((re-search-backward
"<#\\(multipart\\|part\\|external\\|mml\\)" nil t)
(goto-char (match-end 0))
(insert (if sign " sign=" " encrypt=") method)
(while tags
(let ((key (pop tags))
(value (pop tags)))
(when value
;; Quote VALUE if it contains suspicious characters.
(when (string-match "[\"'\\~/*;() \t\n]" value)
(setq value (prin1-to-string value)))
(insert (format " %s=%s" key value))))))
((or (re-search-backward
(concat "^" (regexp-quote mail-header-separator) "\n") nil t)
(re-search-forward
(concat "^" (regexp-quote mail-header-separator) "\n") nil t))
(goto-char (match-end 0))
(apply #'mml-insert-tag 'part (cons (if sign 'sign 'encrypt)
(cons method tags))))
(t (error "The message is corrupted. No mail header separator"))))))