aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/gnus
diff options
context:
space:
mode:
authorMiles Bader <[email protected]>2007-12-28 22:26:31 +0000
committerMiles Bader <[email protected]>2007-12-28 22:26:31 +0000
commit870356897e927f380841268667a92b40fb9e6782 (patch)
treeba253641e797b1d4b35bdf41bb140508dafb5440 /lisp/gnus
parentb17f53abc28496125965f36147b76ea5f6a2b4fb (diff)
Merge from gnus--devo--0
Revision: [email protected]/emacs--devo--0--patch-967
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/ChangeLog59
-rw-r--r--lisp/gnus/gnus-art.el194
-rw-r--r--lisp/gnus/gnus-draft.el3
-rw-r--r--lisp/gnus/gnus-registry.el48
-rw-r--r--lisp/gnus/message.el1
-rw-r--r--lisp/gnus/mm-decode.el2
-rw-r--r--lisp/gnus/mml-sec.el6
-rw-r--r--lisp/gnus/sieve-manage.el7
-rw-r--r--lisp/gnus/smime.el7
9 files changed, 286 insertions, 41 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index f3204e344d..a6b43d7831 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,38 @@
+2007-12-28 Reiner Steib <[email protected]>
+
+ * message.el (message-send-mail-function): Increase custom version.
+
+ * mml-sec.el, sieve-manage.el, smime.el: Simplify loading of
+ password-cache or password. Suggested by Glenn Morris <[email protected]>.
+
+2007-12-21 Teodor Zlatanov <[email protected]>
+
+ * imap.el (imap-authenticate): Use current-buffer instead of buffer,
+ for the cases where imap-authenticate is called with a nil buffer
+ parameter.
+
+2007-12-19 Katsumi Yamaoka <[email protected]>
+
+ * gnus-art.el (gnus-article-browse-html-parts): Work for two or more
+ html parts correctly; support forwarded messages.
+ (gnus-article-browse-html-article): Remove work buffers.
+
+ * netrc.el: Bind encrypt-file-alist for Emacs 21 and XEmacs when
+ compiling.
+ (netrc-bound-and-true-p): New macro.
+ (netrc-parse): Use it instead of bound-and-true-p that is not available
+ in XEmacs 21.4.
+
+2007-12-19 Teodor Zlatanov <[email protected]>
+
+ * gnus-registry.el (gnus-registry-mark-article)
+ (gnus-registry-article-marks): Add functionality to mark articles
+ through the Gnus registry.
+
+ * netrc.el: Autoload encrypt when encrypt-file-alist is set.
+ (netrc-parse): Use encrypt-file-alist to determine if
+ encrypt-find-model or encrypt-insert-file-contents should be used.
+
2007-12-19 Glenn Morris <[email protected]>
* mml.el (message-options-set, message-narrow-to-head)
@@ -9,6 +44,24 @@
(message-options-set-recipient, message-generate-headers)
(message-sort-headers): Declare as functions.
+2007-12-18 Reiner Steib <[email protected]>
+
+ * gnus-draft.el (gnus-draft-send-message): Mention process/prefix
+ convention in doc string.
+
+2007-12-17 Katsumi Yamaoka <[email protected]>
+
+ * gnus-art.el (gnus-article-browse-html-parts): Add message header and
+ title to html parts.
+ (gnus-article-browse-html-article): Pass message header to it.
+
+ * mm-decode.el (mm-display-external): Use mm-add-meta-html-tag.
+
+2007-12-16 Reiner Steib <[email protected]>
+
+ * mml-sec.el, sieve-manage.el, smime.el: Make loading of password-cache
+ or password compatible with XEmacs.
+
2007-12-15 Reiner Steib <[email protected]>
* gnus-art.el (article-verify-x-pgp-sig): Add reference to X-PGP-Sig
@@ -261,6 +314,12 @@
* message.el (message-ignored-supersedes-headers): Add "X-ID".
+2007-12-03 Nathan J. Williams <[email protected]> (tiny change)
+
+ * imap.el (imap-mailbox-status-asynch): Upcase STATUS items.
+ (imap-parse-status): Upcase status-att for servers that sends them
+ lower-case (e.g., MS Exchange 2007).
+
2007-12-03 Lars Magne Ingebrigtsen <[email protected]>
* gnus-sum.el (gnus-uu-extract-map): Add a command for the yenc
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index e984372543..8459558b45 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -2798,9 +2798,10 @@ summary buffer."
(setq gnus-article-browse-html-temp-list nil))
gnus-article-browse-html-temp-list)
-(defun gnus-article-browse-html-parts (list)
+(defun gnus-article-browse-html-parts (list &optional header)
"View all \"text/html\" parts from LIST.
-Recurse into multiparts."
+Recurse into multiparts. The optional HEADER that should be a decoded
+message header will be added to the bodies of the \"text/html\" parts."
;; Internal function used by `gnus-article-browse-html-article'.
(let (type file charset tmp-file showed)
;; Find and show the html-parts.
@@ -2809,10 +2810,11 @@ Recurse into multiparts."
(cond ((not (listp handle)))
((or (equal (car (setq type (mm-handle-type handle))) "text/html")
(and (equal (car type) "message/external-body")
- (setq file (or (mail-content-type-get type 'name)
- (mail-content-type-get
- (mm-handle-disposition handle)
- 'filename)))
+ (or header
+ (setq file (or (mail-content-type-get type 'name)
+ (mail-content-type-get
+ (mm-handle-disposition handle)
+ 'filename))))
(or (mm-handle-cache handle)
(condition-case code
(progn (mm-extern-cache-contents handle) t)
@@ -2825,24 +2827,111 @@ Recurse into multiparts."
type (mm-handle-type handle))
(equal (car type) "text/html"))))
(when (or (setq charset (mail-content-type-get type 'charset))
+ header
(not file))
(setq tmp-file (mm-make-temp-file
;; Do we need to care for 8.3 filenames?
"mm-" nil ".html")))
- (if charset
- ;; Add a meta html tag to specify charset.
- (mm-with-unibyte-buffer
- (insert (if (eq charset 'gnus-decoded)
- (mm-encode-coding-string (mm-get-part handle)
- (setq charset 'utf-8))
- (mm-get-part handle)))
- (if (or (mm-add-meta-html-tag handle charset)
- (not file))
- (mm-write-region (point-min) (point-max)
- tmp-file nil nil nil 'binary t)
- (setq tmp-file nil)))
- (when tmp-file
- (mm-save-part-to-file handle tmp-file)))
+ ;; Add a meta html tag to specify charset and a header.
+ (cond
+ (header
+ (let (title eheader body hcharset coding)
+ (with-temp-buffer
+ (mm-enable-multibyte)
+ (setq case-fold-search t)
+ (insert header "\n")
+ (setq title (message-fetch-field "subject"))
+ (goto-char (point-min))
+ (while (re-search-forward "\\(<\\)\\|\\(>\\)\\|&" nil t)
+ (replace-match (cond ((match-beginning 1) "&lt;")
+ ((match-beginning 2) "&gt;")
+ (t "&amp;"))))
+ (goto-char (point-min))
+ (insert "<pre>\n")
+ (goto-char (point-max))
+ (insert "</pre>\n<hr>\n")
+ ;; We have to examine charset one by one since
+ ;; charset specified in parts might be different.
+ (if (eq charset 'gnus-decoded)
+ (setq charset 'utf-8
+ eheader (mm-encode-coding-string (buffer-string)
+ charset)
+ title (when title
+ (mm-encode-coding-string title charset))
+ body (mm-encode-coding-string (mm-get-part handle)
+ charset))
+ (setq hcharset (mm-find-mime-charset-region (point-min)
+ (point-max)))
+ (cond ((= (length hcharset) 1)
+ (setq hcharset (car hcharset)
+ coding (mm-charset-to-coding-system
+ hcharset)))
+ ((> (length hcharset) 1)
+ (setq hcharset 'utf-8
+ coding hcharset)))
+ (if coding
+ (if charset
+ (progn
+ (setq body
+ (mm-charset-to-coding-system charset))
+ (if (eq coding body)
+ (setq eheader (mm-encode-coding-string
+ (buffer-string) coding)
+ title (when title
+ (mm-encode-coding-string
+ title coding))
+ body (mm-get-part handle))
+ (setq charset 'utf-8
+ eheader (mm-encode-coding-string
+ (buffer-string) charset)
+ title (when title
+ (mm-encode-coding-string
+ title charset))
+ body (mm-encode-coding-string
+ (mm-decode-coding-string
+ (mm-get-part handle) body)
+ charset))))
+ (setq charset hcharset
+ eheader (mm-encode-coding-string
+ (buffer-string) coding)
+ title (when title
+ (mm-encode-coding-string
+ title coding))
+ body (mm-get-part handle)))
+ (setq eheader (mm-string-as-unibyte (buffer-string))
+ body (mm-get-part handle))))
+ (erase-buffer)
+ (mm-disable-multibyte)
+ (insert body)
+ (when charset
+ (mm-add-meta-html-tag handle charset))
+ (when title
+ (goto-char (point-min))
+ (unless (search-forward "<title>" nil t)
+ (re-search-forward "<head>\\s-*" nil t)
+ (insert "<title>" title "</title>\n")))
+ (goto-char (point-min))
+ (or (re-search-forward
+ "<body\\(?:\\s-+[^>]+\\|\\s-*\\)>\\s-*" nil t)
+ (re-search-forward
+ "</head\\(?:\\s-+[^>]+\\|\\s-*\\)>\\s-*" nil t))
+ (insert eheader)
+ (mm-write-region (point-min) (point-max)
+ tmp-file nil nil nil 'binary t))))
+ (charset
+ (mm-with-unibyte-buffer
+ (insert (if (eq charset 'gnus-decoded)
+ (mm-encode-coding-string
+ (mm-get-part handle)
+ (setq charset 'utf-8))
+ (mm-get-part handle)))
+ (if (or (mm-add-meta-html-tag handle charset)
+ (not file))
+ (mm-write-region (point-min) (point-max)
+ tmp-file nil nil nil 'binary t)
+ (setq tmp-file nil))))
+ (tmp-file
+ (mm-save-part-to-file handle tmp-file)))
(when tmp-file
(add-to-list 'gnus-article-browse-html-temp-list tmp-file))
(add-hook 'gnus-summary-prepare-exit-hook
@@ -2854,16 +2943,37 @@ Recurse into multiparts."
(browse-url-of-file (or tmp-file (expand-file-name file)))
(setq showed t))
;; If multipart, recurse
- ((and (stringp (car handle))
- (string-match "^multipart/" (car handle))
- (setq showed
- (or showed
- (gnus-article-browse-html-parts handle)))))))
+ ((equal (mm-handle-media-supertype handle) "multipart")
+ (when (gnus-article-browse-html-parts handle header)
+ (setq showed t)))
+ ((equal (mm-handle-media-type handle) "message/rfc822")
+ (mm-with-multibyte-buffer
+ (mm-insert-part handle)
+ (setq handle (mm-dissect-buffer t t))
+ (when (and (bufferp (car handle))
+ (stringp (car (mm-handle-type handle))))
+ (setq handle (list handle)))
+ (when header
+ (article-decode-encoded-words)
+ (let ((gnus-visible-headers
+ (or (get 'gnus-visible-headers 'standard-value)
+ gnus-visible-headers)))
+ (article-hide-headers))
+ (goto-char (point-min))
+ (search-forward "\n\n" nil 'move)
+ (skip-chars-backward "\t\n ")
+ (setq header (buffer-substring (point-min) (point)))))
+ (when (prog1
+ (gnus-article-browse-html-parts handle header)
+ (mm-destroy-parts handle))
+ (setq showed t)))))
showed))
;; FIXME: Documentation in texi/gnus.texi missing.
-(defun gnus-article-browse-html-article ()
+(defun gnus-article-browse-html-article (&optional arg)
"View \"text/html\" parts of the current article with a WWW browser.
+The message header is added to the beginning of every html part unless
+the prefix argument ARG is given.
Warning: Spammers use links to images in HTML articles to verify
whether you have read the message. As
@@ -2874,20 +2984,36 @@ should only use it for mails from trusted senders.
If you alwasy want to display HTML part in the browser, set
`mm-text-html-renderer' to nil."
;; Cf. `mm-w3m-safe-url-regexp'
- (interactive)
- (save-window-excursion
- ;; Open raw article and select the buffer
- (gnus-summary-show-article t)
- (gnus-summary-select-article-buffer)
- (let ((parts (mm-dissect-buffer t t)))
+ (interactive "P")
+ (if arg
+ (gnus-summary-show-article)
+ (let ((gnus-visible-headers (or (get 'gnus-visible-headers 'standard-value)
+ gnus-visible-headers)))
+ (gnus-summary-show-article)))
+ (with-current-buffer gnus-article-buffer
+ (let ((header (unless arg
+ (save-restriction
+ (widen)
+ (buffer-substring-no-properties
+ (goto-char (point-min))
+ (if (search-forward "\n\n" nil t)
+ (match-beginning 0)
+ (goto-char (point-max))
+ (skip-chars-backward "\t\n ")
+ (point))))))
+ parts)
+ (set-buffer gnus-original-article-buffer)
+ (setq parts (mm-dissect-buffer t t))
;; If singlepart, enforce a list.
(when (and (bufferp (car parts))
(stringp (car (mm-handle-type parts))))
(setq parts (list parts)))
;; Process the list
- (unless (gnus-article-browse-html-parts parts)
+ (unless (gnus-article-browse-html-parts parts header)
(gnus-error 3 "Mail doesn't contain a \"text/html\" part!"))
- (gnus-summary-show-article))))
+ (mm-destroy-parts parts)
+ (unless arg
+ (gnus-summary-show-article)))))
(defun article-hide-list-identifiers ()
"Remove list identifies from the Subject header.
diff --git a/lisp/gnus/gnus-draft.el b/lisp/gnus/gnus-draft.el
index 344f9c028d..6873c3dcb1 100644
--- a/lisp/gnus/gnus-draft.el
+++ b/lisp/gnus/gnus-draft.el
@@ -119,7 +119,8 @@
message-send-actions)))
(defun gnus-draft-send-message (&optional n)
- "Send the current draft."
+ "Send the current draft(s).
+Obeys the standard process/prefix convention."
(interactive "P")
(let* ((articles (gnus-summary-work-articles n))
(total (length articles))
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el
index d45cc6c5d6..bbc69ea343 100644
--- a/lisp/gnus/gnus-registry.el
+++ b/lisp/gnus/gnus-registry.el
@@ -586,6 +586,54 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
(string-match word x))
list)))))
+(defun gnus-registry-mark-article (article &optional mark remove)
+ "Mark ARTICLE with MARK in the Gnus registry or remove MARK.
+MARK can be any symbol. If ARTICLE is nil, then the
+`gnus-current-article' will be marked. If MARK is nil,
+`gnus-registry-flag-default' will be used."
+ (interactive "nArticle number: ")
+ (let ((article (or article gnus-current-article))
+ (mark (or mark 'gnus-registry-flag-default))
+ article-id)
+ (unless article
+ (error "No article on current line"))
+ (setq article-id
+ (gnus-registry-fetch-message-id-fast gnus-current-article))
+ (unless article-id
+ (error "No article ID could be retrieved"))
+ (let* (
+ ;; all the marks for this article
+ (marks (gnus-registry-fetch-extra-flags article-id))
+ ;; the marks without the mark of interest
+ (cleaned-marks (delq mark marks))
+ ;; the new marks we want to use
+ (new-marks (if remove
+ cleaned-marks
+ (cons mark cleaned-marks))))
+ (apply 'gnus-registry-store-extra-flags ; set the extra flags
+ article-id ; for the message ID
+ new-marks)
+ (gnus-registry-fetch-extra-flags article-id))))
+
+(defun gnus-registry-article-marks (article)
+ "Get the Gnus registry marks for ARTICLE.
+If ARTICLE is nil, then the `gnus-current-article' will be
+used."
+ (interactive "nArticle number: ")
+ (let ((article (or article gnus-current-article))
+ article-id)
+ (unless article
+ (error "No article on current line"))
+ (setq article-id
+ (gnus-registry-fetch-message-id-fast gnus-current-article))
+ (unless article-id
+ (error "No article ID could be retrieved"))
+ (gnus-message 1
+ "Message ID %s, Registry flags: %s"
+ article-id
+ (concat (gnus-registry-fetch-extra-flags article-id)))))
+
+
;;; if this extends to more than 'flags, it should be improved to be more generic.
(defun gnus-registry-fetch-extra-flags (id)
"Get the flags of a message, based on the message ID.
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 4fba4fd630..69cb173e9a 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -666,6 +666,7 @@ See also `send-mail-function'."
:tag "Use Mailclient package")
(function :tag "Other"))
:group 'message-sending
+ :version "23.0" ;; No Gnus
:initialize 'custom-initialize-default
:link '(custom-manual "(message)Mail Variables")
:group 'message-mail)
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index e2c23d9db5..14eb7f3ae9 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -751,6 +751,7 @@ external if displayed external."
(set-buffer (generate-new-buffer " *mm*"))
(setq method nil))
(mm-insert-part handle)
+ (mm-add-meta-html-tag handle)
(let ((win (get-buffer-window cur t)))
(when win
(select-window win)))
@@ -774,6 +775,7 @@ external if displayed external."
(mm-handle-set-undisplayer handle mm)))))
;; The function is a string to be executed.
(mm-insert-part handle)
+ (mm-add-meta-html-tag handle)
(let* ((dir (mm-make-temp-file
(expand-file-name "emm." mm-tmp-directory) 'dir))
(filename (or
diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el
index e7ecc06164..c349631f91 100644
--- a/lisp/gnus/mml-sec.el
+++ b/lisp/gnus/mml-sec.el
@@ -27,8 +27,10 @@
;;; Code:
(eval-when-compile (require 'cl))
-(or (require 'password-cache nil t)
- (require 'password))
+
+(if (locate-library "password-cache")
+ (require 'password-cache)
+ (require 'password))
(autoload 'mml2015-sign "mml2015")
(autoload 'mml2015-encrypt "mml2015")
diff --git a/lisp/gnus/sieve-manage.el b/lisp/gnus/sieve-manage.el
index a4b763650c..5e021c26e8 100644
--- a/lisp/gnus/sieve-manage.el
+++ b/lisp/gnus/sieve-manage.el
@@ -79,8 +79,11 @@
;; For Emacs < 22.2.
(eval-and-compile
(unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-(or (require 'password-cache nil t)
- (require 'password))
+
+(if (locate-library "password-cache")
+ (require 'password-cache)
+ (require 'password))
+
(eval-when-compile
(require 'sasl)
(require 'starttls))
diff --git a/lisp/gnus/smime.el b/lisp/gnus/smime.el
index 105cadff08..34c5b410b6 100644
--- a/lisp/gnus/smime.el
+++ b/lisp/gnus/smime.el
@@ -125,8 +125,11 @@
(eval-and-compile
(unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
(require 'dig)
-(or (require 'password-cache nil t)
- (require 'password))
+
+(if (locate-library "password-cache")
+ (require 'password-cache)
+ (require 'password))
+
(eval-when-compile (require 'cl))
(eval-and-compile