+2002-01-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-art.el (gnus-emphasis-alist): Include !? as sentence-ending
+ characters.
+
+2002-01-22 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-xmas.el (gnus-xmas-completing-read): New function.
+ (gnus-xmas-redefine): Redefine conditionally.
+
+2002-01-22 Josh Huber <huber@alum.wpi.edu>
+
+ * mml.el (mml-parse-1): Fixed usage of recipients in the secure
+ tag.
+
+2002-01-22 Josh Huber <huber@alum.wpi.edu>
+
+ * message.el (message-font-lock-keywords): Added the secure tag.
+ * mml-sec.el: Added functions to generate/modify/remove the secure
+ tag while in message mode.
+ * mml-sec.el (mml-secure-message): New.
+ * mml-sec.el (mml-unsecure-message): New.
+ * mml-sec.el (mml-secure-message-sign-smime): New.
+ * mml-sec.el (mml-secure-message-sign-pgp): New.
+ * mml-sec.el (mml-secure-message-sign-pgpmime): New.
+ * mml-sec.el (mml-secure-message-encrypt-smime): New.
+ * mml-sec.el (mml-secure-message-encrypt-pgp): New.
+ * mml-sec.el (mml-secure-message-encrypt-pgpmime): New.
+ * mml.el (mml-parse-1): Added code to recognise the secure tag and
+ convert it to either a part or multipart depending on if there are
+ other parts in the message.
+ * mml.el (mml-mode-map): Changed default sign/encrypt keybindings
+ to use the secure tag, rather than the part tag.
+ * mml.el (mml-preview): Added a save-excursion to keep cursor
+ position after doing an MML preview.
+
2002-01-22 Lars Magne Ingebrigtsen <larsi@gnus.org>
* nnheader.el (nnheader-parse-overview-file): New function.
(defcustom gnus-emphasis-alist
(let ((format
- "\\(\\s-\\|^\\|\\=\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\\(\\([-,.;:\"]\\|\\s)\\)+\\s-\\|[?!.]\\s-\\|\\s)\\|\\s-\\)")
+ "\\(\\s-\\|^\\|\\=\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\\(\\([-,.;:!?\"]\\|\\s)\\)+\\s-\\|[?!.]\\s-\\|\\s)\\|\\s-\\)")
(types
'(("\\*" "\\*" bold)
("_" "_" underline)
(defalias 'gnus-create-image 'gnus-xmas-create-image)
(defalias 'gnus-remove-image 'gnus-xmas-remove-image)
+ (when (or (< emacs-major-version 21)
+ (and (= emacs-major-version 21)
+ (< emacs-minor-version 3)))
+ (defalias gnus-completing-read gnus-xmas-completing-read))
+
;; These ones are not defcutom'ed, sometimes not even defvar'ed. They
;; probably should. If that is done, the code below should then be moved
;; where each variable is defined, in order not to mess with user settings.
nil)
nil nil nil nil nil 'gnus-image))
+(defun gnus-xmas-completing-read (prompt table &optional
+ predicate require-match history)
+ (when (and history
+ (not (boundp history)))
+ (set history nil))
+ (completing-read
+ (if (symbol-value history)
+ (concat prompt " (" (car (symbol-value history)) "): ")
+ (concat prompt ": "))
+ table
+ predicate
+ require-match
+ nil
+ history))
+
(provide 'gnus-xmas)
;;; gnus-xmas.el ends here
(eval-when-compile (require 'cl))
(require 'mm-util)
-;;(require 'url)
-(require 'w3)
(eval-and-compile
(autoload 'exec-installed-p "path-util")
- ;;(autoload 'url-insert-file-contents "url-handlers")
- (autoload 'url-insert-file-contents "url")
- )
+ (autoload 'url-insert-file-contents "url-handlers"))
(defgroup mm-url nil
"A wrapper of url package and external url command for Gnus."
:group 'gnus)
-(defcustom mm-url-use-external nil
+(defcustom mm-url-use-external (not
+ (condition-case nil
+ (require 'url-handlers)
+ (error nil)))
"*If not-nil, use external grab program `mm-url-program'."
:type 'boolean
:group 'mm-url)
(if (string-match "^file:/+" url)
(insert-file-contents (substring url (1- (match-end 0))))
(mm-url-insert-file-contents-external url))
- ;;(require 'url-handlers)
+ (require 'url-handlers)
(let ((name buffer-file-name))
(prog1
(url-insert-file-contents url)
(defun mm-url-fetch-form (url pairs)
"Fetch a form from URL with PAIRS as the data using the POST method."
- ;;(require 'url-handlers)
+ (require 'url-handlers)
(let ((url-request-data (mm-url-encode-www-form-urlencoded pairs))
(url-request-method "POST")
(url-request-extra-headers
t)
(defun mm-url-fetch-simple (url content)
- ;;(require 'url-handlers)
+ (require 'url-handlers)
(let ((url-request-data content)
(url-request-method "POST")
(url-request-extra-headers
(interactive)
(mml-secure-part "smime"))
+;; defuns that add the proper <#secure ...> tag to the top of the message body
+(defun mml-secure-message (method &optional sign)
+ (let ((mode (if sign "sign" "encrypt"))
+ insert-loc)
+ (mml-unsecure-message)
+ (save-excursion
+ (goto-char (point-max))
+ (cond ((re-search-backward
+ (concat "^" (regexp-quote mail-header-separator) "\n") nil t)
+ (goto-char (setq insert-loc (match-end 0)))
+ (unless (looking-at "<#secure")
+ (mml-insert-tag
+ 'secure 'method method 'mode mode)))
+ (t (error
+ "The message is corrupted. No mail header separator"))))
+ (when (eql insert-loc (point))
+ (forward-line 1))))
+
+(defun mml-unsecure-message ()
+ (interactive)
+ (save-excursion
+ (goto-char (point-max))
+ (when (re-search-backward "^<#secure.*>\n" nil t)
+ (kill-region (match-beginning 0) (match-end 0)))))
+
+(defun mml-secure-message-sign-smime ()
+ "Add MML tag to encrypt/sign the entire message."
+ (interactive)
+ (mml-secure-message "smime" 'sign))
+
+(defun mml-secure-message-sign-pgp ()
+ "Add MML tag to encrypt/sign the entire message."
+ (interactive)
+ (mml-secure-message "pgp" 'sign))
+
+(defun mml-secure-message-sign-pgpmime ()
+ "Add MML tag to encrypt/sign the entire message."
+ (interactive)
+ (mml-secure-message "pgpmime" 'sign))
+
+(defun mml-secure-message-encrypt-smime ()
+ "Add MML tag to encrypt/sign the entire message."
+ (interactive)
+ (mml-secure-message "smime"))
+
+(defun mml-secure-message-encrypt-pgp ()
+ "Add MML tag to encrypt/sign the entire message."
+ (interactive)
+ (mml-secure-message "pgp"))
+
+(defun mml-secure-message-encrypt-pgpmime ()
+ "Add MML tag to encrypt/sign the entire message."
+ (interactive)
+ (mml-secure-message "pgpmime"))
+
(provide 'mml-sec)
;;; mml-sec.el ends here
(while (and (not (eobp))
(not (looking-at "<#/multipart")))
(cond
+ ((looking-at "<#secure")
+ ;; The secure part is essentially a meta-meta tag, which
+ ;; expands to either a part tag if there are no other parts in
+ ;; the document or a multipart tag if there are other parts
+ ;; included in the message
+ (let* (secure-mode
+ (taginfo (mml-read-tag))
+ (recipients (cdr (assq 'recipients taginfo)))
+ (location (cdr (assq 'tag-location taginfo))))
+ (save-excursion
+ (if
+ (re-search-forward
+ "<#\\(/\\)?\\(multipart\\|part\\|external\\|mml\\)." nil t)
+ (setq secure-mode "multipart")
+ (setq secure-mode "part")))
+ (save-excursion
+ (goto-char location)
+ (re-search-forward "<#secure[^\n]*>\n"))
+ (delete-region (match-beginning 0) (match-end 0))
+ (mml-insert-tag secure-mode
+ (cdr (assq 'mode taginfo))
+ (cdr (assq 'method taginfo))
+ (and recipients 'recipients)
+ recipients)
+ ;; restart the parse
+ (goto-char location)))
((looking-at "<#multipart")
(push (nconc (mml-read-tag) (mml-parse-1)) struct))
((looking-at "<#external")
(encrypt (make-sparse-keymap))
(map (make-sparse-keymap))
(main (make-sparse-keymap)))
- (define-key sign "p" 'mml-secure-sign-pgpmime)
- (define-key sign "o" 'mml-secure-sign-pgp)
- (define-key sign "s" 'mml-secure-sign-smime)
- (define-key encrypt "p" 'mml-secure-encrypt-pgpmime)
- (define-key encrypt "o" 'mml-secure-encrypt-pgp)
- (define-key encrypt "s" 'mml-secure-encrypt-smime)
+ (define-key sign "p" 'mml-secure-message-sign-pgpmime)
+ (define-key sign "o" 'mml-secure-message-sign-pgp)
+ (define-key sign "s" 'mml-secure-message-sign-smime)
+ (define-key encrypt "p" 'mml-secure-message-encrypt-pgpmime)
+ (define-key encrypt "o" 'mml-secure-message-encrypt-pgp)
+ (define-key encrypt "s" 'mml-secure-message-encrypt-smime)
(define-key map "f" 'mml-attach-file)
(define-key map "b" 'mml-attach-buffer)
(define-key map "e" 'mml-attach-external)
["Attach External" mml-attach-external t]
["Insert Part" mml-insert-part t]
["Insert Multipart" mml-insert-multipart t]
- ["PGP/MIME Sign" mml-secure-sign-pgpmime t]
- ["PGP/MIME Encrypt" mml-secure-encrypt-pgpmime t]
- ["PGP Sign" mml-secure-sign-pgp t]
- ["PGP Encrypt" mml-secure-encrypt-pgp t]
- ["S/MIME Sign" mml-secure-sign-smime t]
- ["S/MIME Encrypt" mml-secure-encrypt-smime t]
+ ["PGP/MIME Sign" mml-secure-message-sign-pgpmime t]
+ ["PGP/MIME Encrypt" mml-secure-message-encrypt-pgpmime t]
+ ["PGP Sign" mml-secure-message-sign-pgp t]
+ ["PGP Encrypt" mml-secure-message-encrypt-pgp t]
+ ["S/MIME Sign" mml-secure-message-sign-smime t]
+ ["S/MIME Encrypt" mml-secure-message-encrypt-smime t]
;;["Narrow" mml-narrow-to-part t]
["Quote MML" mml-quote-region t]
["Validate MML" mml-validate t]
"Display current buffer with Gnus, in a new buffer.
If RAW, don't highlight the article."
(interactive "P")
- (let* ((buf (current-buffer))
- (message-options message-options)
- (message-this-is-news (message-news-p))
- (message-posting-charset (or (gnus-setup-posting-charset
- (save-restriction
- (message-narrow-to-headers-or-head)
- (message-fetch-field "Newsgroups")))
- message-posting-charset)))
- (message-options-set-recipient)
- (switch-to-buffer (generate-new-buffer
- (concat (if raw "*Raw MIME preview of "
- "*MIME preview of ") (buffer-name))))
- (erase-buffer)
- (insert-buffer buf)
- (if (re-search-forward
- (concat "^" (regexp-quote mail-header-separator) "\n") nil t)
- (replace-match "\n"))
- (let ((mail-header-separator "")) ;; mail-header-separator is removed.
- (mml-to-mime))
- (if raw
- (when (fboundp 'set-buffer-multibyte)
- (let ((s (buffer-string)))
- ;; Insert the content into unibyte buffer.
- (erase-buffer)
- (mm-disable-multibyte)
- (insert s)))
- (let ((gnus-newsgroup-charset (car message-posting-charset))
- gnus-article-prepare-hook gnus-original-article-buffer)
- (run-hooks 'gnus-article-decode-hook)
- (let ((gnus-newsgroup-name "dummy"))
- (gnus-article-prepare-display))))
- ;; Disable article-mode-map.
- (use-local-map nil)
- (setq buffer-read-only t)
- (local-set-key "q" (lambda () (interactive) (kill-buffer nil)))
- (goto-char (point-min))))
+ (save-excursion
+ (let* ((buf (current-buffer))
+ (message-options message-options)
+ (message-this-is-news (message-news-p))
+ (message-posting-charset (or (gnus-setup-posting-charset
+ (save-restriction
+ (message-narrow-to-headers-or-head)
+ (message-fetch-field "Newsgroups")))
+ message-posting-charset)))
+ (message-options-set-recipient)
+ (switch-to-buffer (generate-new-buffer
+ (concat (if raw "*Raw MIME preview of "
+ "*MIME preview of ") (buffer-name))))
+ (erase-buffer)
+ (insert-buffer buf)
+ (if (re-search-forward
+ (concat "^" (regexp-quote mail-header-separator) "\n") nil t)
+ (replace-match "\n"))
+ (let ((mail-header-separator ""));; mail-header-separator is removed.
+ (mml-to-mime))
+ (if raw
+ (when (fboundp 'set-buffer-multibyte)
+ (let ((s (buffer-string)))
+ ;; Insert the content into unibyte buffer.
+ (erase-buffer)
+ (mm-disable-multibyte)
+ (insert s)))
+ (let ((gnus-newsgroup-charset (car message-posting-charset))
+ gnus-article-prepare-hook gnus-original-article-buffer)
+ (run-hooks 'gnus-article-decode-hook)
+ (let ((gnus-newsgroup-name "dummy"))
+ (gnus-article-prepare-display))))
+ ;; Disable article-mode-map.
+ (use-local-map nil)
+ (setq buffer-read-only t)
+ (local-set-key "q" (lambda () (interactive) (kill-buffer nil)))
+ (goto-char (point-min)))))
(defun mml-validate ()
"Validate the current MML document."
+2002-01-22 Josh Huber <huber@alum.wpi.edu>
+
+ * emacs-mime.texi (MML Definition): Added a few words about the
+ recipients option.
+ * message.texi (Security): Changed documentation to reflect use of
+ the new secure tag.
+
2002-01-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus.texi (Article Washing): Addition.
@item read-date
RFC822 date when the part was read (@code{Content-Disposition}).
+@item recipients
+Who to encrypt/sign the part to. This field is used to override any
+auto-detection based on the To/CC headers.
+
@item size
The size (in octets) of the part (@code{Content-Disposition}).
@cindex PGP/MIME
@cindex sign
@cindex encrypt
+@cindex secure
Using the MML language, Message is able to create digitally signed and
digitally encrypted messages. Message (or rather MML) currently
@item C-c C-m s s
@kindex C-c C-m s s
-@findex mml-secure-sign-smime
+@findex mml-secure-message-sign-smime
-Digitally sign current MIME part using S/MIME.
+Digitally sign current message using S/MIME.
@item C-c C-m s o
@kindex C-c C-m s o
-@findex mml-secure-sign-pgp
+@findex mml-secure-message-sign-pgp
-Digitally sign current MIME part using PGP.
+Digitally sign current message using PGP.
@item C-c C-m s p
@kindex C-c C-m s p
-@findex mml-secure-sign-pgp
+@findex mml-secure-message-sign-pgp
-Digitally sign current MIME part using PGP/MIME.
+Digitally sign current message using PGP/MIME.
@item C-c C-m c s
@kindex C-c C-m c s
-@findex mml-secure-encrypt-smime
+@findex mml-secure-message-encrypt-smime
-Digitally encrypt current MIME part using S/MIME.
+Digitally encrypt current message using S/MIME.
@item C-c C-m c o
@kindex C-c C-m c o
-@findex mml-secure-encrypt-pgp
+@findex mml-secure-message-encrypt-pgp
-Digitally encrypt current MIME part using PGP.
+Digitally encrypt current message using PGP.
@item C-c C-m c p
@kindex C-c C-m c p
-@findex mml-secure-encrypt-pgpmime
+@findex mml-secure-message-encrypt-pgpmime
-Digitally encrypt current MIME part using PGP/MIME.
+Digitally encrypt current message using PGP/MIME.
@end table
These commands do not immediately sign or encrypt the message, they
-merely insert proper MML tags to instruct the MML engine to perform that
-operation when the message is actually sent. They may perform other
-operations too, such as locating and retrieving a S/MIME certificate of
-the person you wish to send encrypted mail to.
+merely insert the proper MML secure tag to instruct the MML engine to
+perform that operation when the message is actually sent. They may
+perform other operations too, such as locating and retrieving a S/MIME
+certificate of the person you wish to send encrypted mail to. When the
+mml parsing engine converts your MML into a properly encoded MIME
+message, the secure tag will be replaced with either a part or a
+multipart tag. If your message contains other mml parts, a multipart
+tag will be used; if no other parts are present in your message a single
+part tag will be used. This way, message mode will do the Right Thing
+(TM) with signed/encrypted multipart messages.
Since signing and especially encryption often is used when sensitive
information is sent, you may want to have some way to ensure that your
@cindex PGP/MIME
@cindex sign
@cindex encrypt
+@cindex secure
Using the MML language, Message is able to create digitally signed and
digitally encrypted messages. Message (or rather MML) currently
@item C-c C-m s s
@kindex C-c C-m s s
-@findex mml-secure-sign-smime
+@findex mml-secure-message-sign-smime
-Digitally sign current MIME part using S/MIME.
+Digitally sign current message using S/MIME.
@item C-c C-m s o
@kindex C-c C-m s o
-@findex mml-secure-sign-pgp
+@findex mml-secure-message-sign-pgp
-Digitally sign current MIME part using PGP.
+Digitally sign current message using PGP.
@item C-c C-m s p
@kindex C-c C-m s p
-@findex mml-secure-sign-pgp
+@findex mml-secure-message-sign-pgp
-Digitally sign current MIME part using PGP/MIME.
+Digitally sign current message using PGP/MIME.
@item C-c C-m c s
@kindex C-c C-m c s
-@findex mml-secure-encrypt-smime
+@findex mml-secure-message-encrypt-smime
-Digitally encrypt current MIME part using S/MIME.
+Digitally encrypt current message using S/MIME.
@item C-c C-m c o
@kindex C-c C-m c o
-@findex mml-secure-encrypt-pgp
+@findex mml-secure-message-encrypt-pgp
-Digitally encrypt current MIME part using PGP.
+Digitally encrypt current message using PGP.
@item C-c C-m c p
@kindex C-c C-m c p
-@findex mml-secure-encrypt-pgpmime
+@findex mml-secure-message-encrypt-pgpmime
-Digitally encrypt current MIME part using PGP/MIME.
+Digitally encrypt current message using PGP/MIME.
@end table
These commands do not immediately sign or encrypt the message, they
-merely insert proper MML tags to instruct the MML engine to perform that
-operation when the message is actually sent. They may perform other
-operations too, such as locating and retrieving a S/MIME certificate of
-the person you wish to send encrypted mail to.
+merely insert the proper MML secure tag to instruct the MML engine to
+perform that operation when the message is actually sent. They may
+perform other operations too, such as locating and retrieving a S/MIME
+certificate of the person you wish to send encrypted mail to. When the
+mml parsing engine converts your MML into a properly encoded MIME
+message, the secure tag will be replaced with either a part or a
+multipart tag. If your message contains other mml parts, a multipart
+tag will be used; if no other parts are present in your message a single
+part tag will be used. This way, message mode will do the Right Thing
+(TM) with signed/encrypted multipart messages.
Since signing and especially encryption often is used when sensitive
information is sent, you may want to have some way to ensure that your