From e0b65c6edd6df4d9bdb61cacef954355172476c7 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 28 Jun 1999 23:27:06 +0000 Subject: [PATCH] Sync up with Pterodactyl Gnus v0.89. --- aclocal.m4 | 2 +- lisp/ChangeLog | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ lisp/gnus-art.el | 65 +++++++++++++++++++++++++++++++++++++--------------- lisp/gnus-cache.el | 14 ++++++++--- lisp/gnus-cus.el | 9 ++++++++ lisp/gnus-draft.el | 8 +++++-- lisp/gnus-start.el | 2 +- lisp/gnus-sum.el | 54 +++++++++++++++++++++++++++++++++++-------- lisp/gnus-xmas.el | 2 +- lisp/mail-prsvr.el | 6 +++++ lisp/message.el | 2 +- lisp/mm-bodies.el | 10 ++++++-- lisp/mm-util.el | 2 +- lisp/mm-view.el | 61 +++++++++++++++++++++++++++++++----------------- lisp/mml.el | 10 ++++---- lisp/nnmail.el | 2 +- lisp/rfc2047.el | 4 ++++ 17 files changed, 250 insertions(+), 67 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index a83ab59..c37987d 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -4,7 +4,7 @@ AC_DEFUN(AM_PATH_LISPDIR, [# If set to t, that means we are running in a shell under Emacs. # If you have an Emacs named "t", then use the full path. test "$EMACS" = t && EMACS= - AC_PATH_PROG(EMACS, emacs xemacs, no) + AC_PATH_PROGS(EMACS, emacs xemacs, no) if test $EMACS != "no"; then AC_MSG_CHECKING([where .elc files should go]) dnl Set default value diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d27d230..b807b2d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,67 @@ +Mon Jun 28 17:54:01 1999 Lars Magne Ingebrigtsen + + * gnus.el: Pterodactyl Gnus v0.89 is released. + +1999-06-24 Shenghuo ZHU + + * nnmail.el (nnmail-file-coding-system-1): For NTEmacs in Windows. + * message.el (message-draft-coding-system): Ditto. + * mm-util.el (mm-running-ntemacs): Ditto. + +1999-06-23 Shenghuo ZHU + + * gnus-xmas.el (gnus-xmas-summary-recenter): A blank line may + cause problem. + +1999-06-23 Shenghuo ZHU + + * mm-view.el (mm-inline-text): Ignore error in w3-region. + +1999-06-23 Shenghuo ZHU + + * mml.el: require mm-decode. + +1999-06-23 Shenghuo ZHU + + * gnus-art.el (gnus-display-mime): Treat as head only if necessary. + +1999-06-23 Shenghuo ZHU + + * mm-view.el (mm-inline-image): Fix image undisplayer. + +1999-06-22 Shenghuo ZHU + + * mml.el (mml-insert-multipart): Error in compeling-read. + (mml-insert-tag): Match tags. + +1999-06-19 Shenghuo ZHU + + * gnus-cache.el (gnus-cache-braid-nov): Fix coding-system bug. + (gnus-cache-braid-heads): Ditto. + (gnus-cache-retrieve-headers): Ditto. + +1999-06-16 Shenghuo ZHU + + * gnus-draft.el (gnus-draft-send): Fix encoding bug. + +1999-06-16 10:17:29 Katsumi Yamaoka + + * gnus-art.el (gnus-article-read-summary-keys): Convert key events + to string under XEmacs. + +1999-06-28 19:34:03 Petersen Jens-Ulrik + + * gnus-start.el (gnus-find-new-newsgroups): Doc fix. + +1999-06-22 Shenghuo ZHU + + * mm-view.el (mm-inline-message): Fix message view bug. + * gnus-art.el (gnus-article-prepare): Ditto. + +1999-06-16 Shenghuo ZHU + + * gnus-cache.el (gnus-cache-possibly-enter-article): Fetch headers. + Tue Jun 15 04:13:01 1999 Lars Magne Ingebrigtsen * gnus.el: Pterodactyl Gnus v0.88 is released. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 3c503aa..2e4a6ae 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -1512,7 +1512,10 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")." (set-buffer gnus-article-buffer) (let ((inhibit-point-motion-hooks t) buffer-read-only - (mail-parse-charset gnus-newsgroup-charset)) + (mail-parse-charset gnus-newsgroup-charset) + (mail-parse-ignored-charsets + (save-excursion (set-buffer gnus-summary-buffer) + gnus-newsgroup-ignored-charsets))) (mail-decode-encoded-word-region (point-min) (point-max))))) (defun article-decode-charset (&optional prompt) @@ -1534,9 +1537,10 @@ If PROMPT (the prefix), prompt for a coding system to use." (ctl (mail-content-type-get ctl 'charset)))) (mail-parse-charset gnus-newsgroup-charset) + (mail-parse-ignored-charsets + (save-excursion (set-buffer gnus-summary-buffer) + gnus-newsgroup-ignored-charsets)) buffer-read-only) - (when (memq charset gnus-newsgroup-ignored-charsets) - (setq charset nil)) (goto-char (point-max)) (widen) (forward-line 1) @@ -3085,7 +3089,10 @@ Type any key: " (save-current-buffer (set-buffer gnus-article-buffer) (let ((handles (or handles gnus-article-mime-handles)) - (mail-parse-charset gnus-newsgroup-charset)) + (mail-parse-charset gnus-newsgroup-charset) + (mail-parse-ignored-charsets + (save-excursion (set-buffer gnus-summary-buffer) + gnus-newsgroup-ignored-charsets))) (if (stringp (car handles)) (gnus-mime-view-all-parts (cdr handles)) (mapcar 'mm-display-part handles))))) @@ -3156,7 +3163,10 @@ Type any key: " (let* ((handle (or handle (get-text-property (point) 'gnus-data))) (mm-user-display-methods nil) (mm-all-images-fit t) - (mail-parse-charset gnus-newsgroup-charset)) + (mail-parse-charset gnus-newsgroup-charset) + (mail-parse-ignored-charsets + (save-excursion (set-buffer gnus-summary-buffer) + gnus-newsgroup-ignored-charsets))) (if (mm-handle-undisplayer handle) (mm-remove-part handle) (mm-display-part handle)))) @@ -3168,7 +3178,10 @@ Type any key: " (let* ((handle (or handle (get-text-property (point) 'gnus-data))) (mm-user-display-methods '((".*" . inline))) (mm-all-images-fit t) - (mail-parse-charset gnus-newsgroup-charset)) + (mail-parse-charset gnus-newsgroup-charset) + (mail-parse-ignored-charsets + (save-excursion (set-buffer gnus-summary-buffer) + gnus-newsgroup-ignored-charsets))) (if (mm-handle-undisplayer handle) (mm-remove-part handle) (mm-display-part handle)))) @@ -3234,7 +3247,10 @@ Type any key: " (forward-line 1) (prog1 (let ((window (selected-window)) - (mail-parse-charset gnus-newsgroup-charset)) + (mail-parse-charset gnus-newsgroup-charset) + (mail-parse-ignored-charsets + (save-excursion (set-buffer gnus-summary-buffer) + gnus-newsgroup-ignored-charsets))) (save-excursion (unwind-protect (let ((win (get-buffer-window (current-buffer) t)) @@ -3346,9 +3362,10 @@ Type any key: " (when (and (not ihandles) (not gnus-displaying-mime)) ;; Top-level call; we clean up. - (mm-destroy-parts gnus-article-mime-handles) - (setq gnus-article-mime-handles handles - gnus-article-mime-handle-alist nil) + (when gnus-article-mime-handles + (mm-destroy-parts gnus-article-mime-handles) + (setq gnus-article-mime-handle-alist nil)) ;; A trick. + (setq gnus-article-mime-handles handles) ;; We allow users to glean info from the handles. (when gnus-article-mime-part-function (gnus-mime-part-function handles))) @@ -3368,12 +3385,13 @@ Type any key: " (narrow-to-region (point) (point-max)) (gnus-treat-article nil 1 1) (widen))) - ;; Highlight the headers. - (save-excursion - (save-restriction - (article-goto-body) - (narrow-to-region (point-min) (point)) - (gnus-treat-article 'head))))))) + (if (not ihandles) + ;; Highlight the headers. + (save-excursion + (save-restriction + (article-goto-body) + (narrow-to-region (point-min) (point)) + (gnus-treat-article 'head)))))))) (defvar gnus-mime-display-multipart-as-mixed nil) @@ -3448,7 +3466,10 @@ Type any key: " (display (when move (forward-line -2)) - (let ((mail-parse-charset gnus-newsgroup-charset)) + (let ((mail-parse-charset gnus-newsgroup-charset) + (mail-parse-ignored-charsets + (save-excursion (set-buffer gnus-summary-buffer) + gnus-newsgroup-ignored-charsets))) (mm-display-part handle t)) (goto-char (point-max))) ((and text not-attachment) @@ -3556,7 +3577,10 @@ Type any key: " (when preferred (if (stringp (car preferred)) (gnus-display-mime preferred) - (let ((mail-parse-charset gnus-newsgroup-charset)) + (let ((mail-parse-charset gnus-newsgroup-charset) + (mail-parse-ignored-charsets + (save-excursion (set-buffer gnus-summary-buffer) + gnus-newsgroup-ignored-charsets))) (mm-display-part preferred))) (goto-char (point-max)) (setcdr begend (point-marker))))) @@ -3782,7 +3806,10 @@ Argument LINES specifies lines to be scrolled down." (set-buffer gnus-article-current-summary) (let (gnus-pick-mode) (push (or key last-command-event) unread-command-events) - (setq keys (read-key-sequence nil)))) + (setq keys (if gnus-xemacs + (events-to-keys (read-key-sequence nil)) + (read-key-sequence nil))))) + (message "") (if (or (member keys nosaves) diff --git a/lisp/gnus-cache.el b/lisp/gnus-cache.el index 97d660c..99bc5d9 100644 --- a/lisp/gnus-cache.el +++ b/lisp/gnus-cache.el @@ -184,6 +184,8 @@ it's not cached." (when (> (buffer-size) 0) (gnus-write-buffer-as-coding-system gnus-cache-write-file-coding-system file) + (setq headers (nnheader-parse-head t)) + (mail-header-set-number headers number) (gnus-cache-change-buffer group) (set-buffer (cdr gnus-cache-buffer)) (goto-char (point-max)) @@ -306,7 +308,9 @@ it's not cached." ;; unsuccessful), so we use the cached headers exclusively. (set-buffer nntp-server-buffer) (erase-buffer) - (nnheader-insert-file-contents cache-file) + (let ((nnheader-file-coding-system + gnus-cache-overview-coding-system)) + (nnheader-insert-file-contents cache-file)) 'nov) ((eq type 'nov) ;; We have both cached and uncached NOV headers, so we @@ -542,7 +546,9 @@ Returns the list of articles removed." (save-excursion (set-buffer cache-buf) (erase-buffer) - (nnheader-insert-file-contents (or file (gnus-cache-file-name group ".overview"))) + (let ((nnheader-file-coding-system gnus-cache-overview-coding-system)) + (nnheader-insert-file-contents + (or file (gnus-cache-file-name group ".overview")))) (goto-char (point-min)) (insert "\n") (goto-char (point-min))) @@ -584,7 +590,9 @@ Returns the list of articles removed." (save-excursion (set-buffer cache-buf) (erase-buffer) - (nnheader-insert-file-contents (gnus-cache-file-name group (car cached))) + (let ((nnheader-file-coding-system gnus-cache-coding-system)) + (nnheader-insert-file-contents + (gnus-cache-file-name group (car cached)))) (goto-char (point-min)) (insert "220 ") (princ (car cached) (current-buffer)) diff --git a/lisp/gnus-cus.el b/lisp/gnus-cus.el index ee9f042..71c36af 100644 --- a/lisp/gnus-cus.el +++ b/lisp/gnus-cus.el @@ -170,6 +170,15 @@ in it..") (charset (symbol :tag "Charset") "\ The default charset to use in the group.") + (ignored-charsets + (choice :tag "Ignored charsets" + :value nil + (repeat (symbol))) "\ +List of charsets that should be ignored. + +When these charsets are used in the \"charset\" parameter, the +default charset will be used instead.") + (highlight-words (choice :tag "Highlight words" :value nil diff --git a/lisp/gnus-draft.el b/lisp/gnus-draft.el index dbdcf09..a917ea5 100644 --- a/lisp/gnus-draft.el +++ b/lisp/gnus-draft.el @@ -125,8 +125,12 @@ (gnus-draft-setup-for-sending article (or group "nndraft:queue")) (let ((message-syntax-checks (if interactive nil 'dont-check-for-anything-just-trust-me)) - (message-inhibit-body-encoding t) - message-send-hook type method) + (message-inhibit-body-encoding (or (not group) + (equal group "nndraft:queue") + message-inhibit-body-encoding)) + (message-send-hook (and group (not (equal group "nndraft:queue")) + message-send-hook)) + type method) ;; We read the meta-information that says how and where ;; this message is to be sent. (save-restriction diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el index 1b32281..5a0ea5e 100644 --- a/lisp/gnus-start.el +++ b/lisp/gnus-start.el @@ -952,7 +952,7 @@ If LEVEL is non-nil, the news will be set up at level LEVEL." (defun gnus-find-new-newsgroups (&optional arg) "Search for new newsgroups and add them. -Each new newsgroup will be treated with `gnus-subscribe-newsgroup-method.' +Each new newsgroup will be treated with `gnus-subscribe-newsgroup-method'. The `-n' option line from .newsrc is respected. With 1 C-u, use the `ask-server' method to query the server for new diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 24deb95..9514695 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -837,6 +837,15 @@ default charset will be used instead." :type '(repeat symbol) :group 'gnus-charset) +(defcustom gnus-group-ignored-charsets-alist + '(("alt\\.chinese\\.text" iso-8859-1)) + "Alist of regexps (to match group names) and charsets that should be ignored. +When these charsets are used in the \"charset\" parameter, the +default charset will be used instead." + :type '(repeat (cons (regexp :tag "Group") + (repeat symbol))) + :group 'gnus-charset) + (defcustom gnus-group-highlight-words-alist nil "Alist of group regexps and highlight regexps. This variable uses the same syntax as `gnus-emphasis-alist'." @@ -1510,6 +1519,7 @@ increase the score of each group you read." "\M-\C-e" gnus-summary-expire-articles-now "\177" gnus-summary-delete-article [delete] gnus-summary-delete-article + [backspace] gnus-summary-delete-article "m" gnus-summary-move-article "r" gnus-summary-respool-article "w" gnus-summary-edit-article @@ -2495,7 +2505,10 @@ marks of articles." (defun gnus-summary-from-or-to-or-newsgroups (header) (let ((to (cdr (assq 'To (mail-header-extra header)))) (newsgroups (cdr (assq 'Newsgroups (mail-header-extra header)))) - (mail-parse-charset gnus-newsgroup-charset)) + (mail-parse-charset gnus-newsgroup-charset) + (mail-parse-ignored-charsets + (save-excursion (set-buffer gnus-summary-buffer) + gnus-newsgroup-ignored-charsets))) (cond ((and to gnus-ignored-from-addresses @@ -4516,7 +4529,10 @@ The resulting hash table is returned, or nil if no Xrefs were found." (save-excursion (set-buffer gnus-summary-buffer) gnus-newsgroup-dependencies))) headers id end ref - (mail-parse-charset gnus-newsgroup-charset)) + (mail-parse-charset gnus-newsgroup-charset) + (mail-parse-ignored-charsets + (save-excursion (set-buffer gnus-summary-buffer) + gnus-newsgroup-ignored-charsets))) (save-excursion (set-buffer nntp-server-buffer) ;; Translate all TAB characters into SPACE characters. @@ -4679,6 +4695,7 @@ list of headers that match SEQUENCE (see `nntp-retrieve-headers')." ;; NNTP servers do not include Xrefs when using XOVER. (setq gnus-article-internal-prepare-hook '(gnus-article-get-xrefs)) (let ((mail-parse-charset gnus-newsgroup-charset) + (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets) (cur nntp-server-buffer) (dependencies (or dependencies gnus-newsgroup-dependencies)) number headers header) @@ -7539,9 +7556,10 @@ This will have permanent effect only in mail groups. If FORCE is non-nil, allow editing of articles even in read-only groups." (interactive "P") - (let ((mail-parse-charset gnus-newsgroup-charset)) - (save-excursion - (set-buffer gnus-summary-buffer) + (save-excursion + (set-buffer gnus-summary-buffer) + (let ((mail-parse-charset gnus-newsgroup-charset) + (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets)) (gnus-set-global-variables) (when (and (not force) (gnus-group-read-only-p)) @@ -7550,7 +7568,9 @@ groups." (gnus-article-edit-article 'ignore `(lambda (no-highlight) - (let ((mail-parse-charset ',gnus-newsgroup-charset)) + (let ((mail-parse-charset ',gnus-newsgroup-charset) + (mail-parse-ignored-charsets + ',gnus-newsgroup-ignored-charsets)) (gnus-summary-edit-article-done ,(or (mail-header-references gnus-current-headers) "") ,(gnus-group-read-only-p) ,gnus-summary-buffer no-highlight))))))) @@ -9367,8 +9387,22 @@ If REVERSE, save parts that do not match TYPE." (defun gnus-summary-setup-default-charset () "Setup newsgroup default charset." - (let ((name (and gnus-newsgroup-name - (gnus-group-real-name gnus-newsgroup-name)))) + (let* ((name (and gnus-newsgroup-name + (gnus-group-real-name gnus-newsgroup-name))) + (ignored-charsets + (append + (and gnus-newsgroup-name + (or (gnus-group-find-parameter gnus-newsgroup-name + 'ignored-charsets t) + (let ((alist gnus-group-ignored-charsets-alist) + elem (charsets nil)) + (while (setq elem (pop alist)) + (when (and name + (string-match (car elem) name)) + (setq alist nil + charsets (cdr elem)))) + charsets))) + gnus-newsgroup-ignored-charsets))) (setq gnus-newsgroup-charset (or (and gnus-newsgroup-name (or (gnus-group-find-parameter gnus-newsgroup-name @@ -9381,7 +9415,9 @@ If REVERSE, save parts that do not match TYPE." (setq alist nil charset (cadr elem)))) charset))) - gnus-default-charset)))) + gnus-default-charset)) + (set (make-local-variable 'gnus-newsgroup-ignored-charsets) + ignored-charsets))) ;;; ;;; Mime Commands diff --git a/lisp/gnus-xmas.el b/lisp/gnus-xmas.el index 7e65c43..5e9a7ad 100644 --- a/lisp/gnus-xmas.el +++ b/lisp/gnus-xmas.el @@ -178,7 +178,7 @@ displayed, no centering will be performed." (sit-for 0)) (when gnus-auto-center-summary (let* ((height (if (fboundp 'window-displayed-height) - (window-displayed-height) + (1- (window-displayed-height)) (- (window-height) 2))) (top (cond ((< height 4) 0) ((< height 7) 1) diff --git a/lisp/mail-prsvr.el b/lisp/mail-prsvr.el index f59b1ff..82187fc 100644 --- a/lisp/mail-prsvr.el +++ b/lisp/mail-prsvr.el @@ -29,6 +29,12 @@ This variable should never be set. Instead, it should be bound by functions that wish to call mail-parse functions and let them know what the desired charset is to be.") +(defvar mail-parse-ignored-charsets nil + "Ignored charsets used by low-level libraries. +This variable should never be set. Instead, it should be bound by +functions that wish to call mail-parse functions and let them know +what the desired charsets is to be ignored.") + (provide 'mail-prsvr) ;;; mail-prsvr.el ends here diff --git a/lisp/message.el b/lisp/message.el index ef9d2e3..ac65a3d 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1048,7 +1048,7 @@ The cdr of ech entry is a function for applying the face to a region.") (cond ((not (fboundp 'find-coding-system)) nil) ((find-coding-system 'emacs-mule) - (if (string-match "nt" system-configuration) + (if (string-match "nt\\|windows" system-configuration) 'emacs-mule-dos 'emacs-mule)) ((find-coding-system 'escape-quoted) 'escape-quoted) ((find-coding-system 'no-conversion) 'no-conversion) diff --git a/lisp/mm-bodies.el b/lisp/mm-bodies.el index bcbd4f1..1107947 100644 --- a/lisp/mm-bodies.el +++ b/lisp/mm-bodies.el @@ -194,7 +194,10 @@ If no encoding was done, nil is returned." (defun mm-decode-body (charset &optional encoding type) "Decode the current article that has been encoded with ENCODING. The characters in CHARSET should then be decoded." - (setq charset (or charset mail-parse-charset)) + (if (stringp charset) + (setq charset (intern (downcase charset)))) + (if (or (not charset) (memq charset mail-parse-ignored-charsets)) + (setq charset mail-parse-charset)) (save-excursion (when encoding (mm-decode-content-transfer-encoding encoding type)) @@ -212,7 +215,10 @@ The characters in CHARSET should then be decoded." (defun mm-decode-string (string charset) "Decode STRING with CHARSET." - (setq charset (or charset mail-parse-charset)) + (if (stringp charset) + (setq charset (intern (downcase charset)))) + (if (or (not charset) (memq charset mail-parse-ignored-charsets)) + (setq charset mail-parse-charset)) (or (when (featurep 'mule) (let (mule-charset) diff --git a/lisp/mm-util.el b/lisp/mm-util.el index 2ade070..966cb91 100644 --- a/lisp/mm-util.el +++ b/lisp/mm-util.el @@ -28,7 +28,7 @@ (defvar mm-running-ntemacs (and (not mm-running-xemacs) - (string-match "nt" system-configuration))) + (string-match "nt\\|windows" system-configuration))) (defvar mm-binary-coding-system (if mm-running-xemacs diff --git a/lisp/mm-view.el b/lisp/mm-view.el index 8be8603..d1993a4 100644 --- a/lisp/mm-view.el +++ b/lisp/mm-view.el @@ -38,9 +38,17 @@ ;;; (defun mm-inline-image (handle) - (let ((annot (make-annotation (mm-get-image handle) nil 'text)) + (let ((b (point)) + (annot (make-annotation (mm-get-image handle) nil 'text)) buffer-read-only) - (mm-insert-inline handle "\n") + (insert "\n") + (mm-handle-set-undisplayer + handle + `(lambda () + (let (buffer-read-only) + (delete-annotation ,annot) + (delete-region ,(set-marker (make-marker) b) + ,(set-marker (make-marker) (point)))))) (set-extent-property annot 'mm t) (set-extent-property annot 'duplicable t))) @@ -73,28 +81,34 @@ (save-restriction (narrow-to-region b (point)) (goto-char (point-min)) - (if (or (re-search-forward w3-meta-content-type-charset-regexp nil t) - (re-search-forward w3-meta-charset-content-type-regexp nil t)) + (if (or (re-search-forward + w3-meta-content-type-charset-regexp nil t) + (re-search-forward + w3-meta-charset-content-type-regexp nil t)) (setq charset (w3-coding-system-for-mime-charset (buffer-substring-no-properties (match-beginning 2) (match-end 2))))) (mm-decode-body charset) (save-window-excursion - (let ((w3-strict-width width) - (url-standalone-mode t)) - (w3-region (point-min) (point-max))))) - (narrow-to-region (1+ (point-min)) (point-max)) - (mm-handle-set-undisplayer - handle - `(lambda () - (let (buffer-read-only) - (mapc (lambda (prop) - (remove-specifier - (face-property 'default prop) (current-buffer))) - '(background background-pixmap foreground)) - (delete-region ,(point-min-marker) - ,(point-max-marker)))))))) + (save-restriction + (let ((w3-strict-width width) + (url-standalone-mode t)) + (condition-case var + (w3-region (point-min) (point-max)) + (error))))) +;;; (narrow-to-region (1+ (point-min)) (point-max)) + (mm-handle-set-undisplayer + handle + `(lambda () + (let (buffer-read-only) + (if (functionp 'remove-specifier) + (mapc (lambda (prop) + (remove-specifier + (face-property 'default prop) (current-buffer))) + '(background background-pixmap foreground))) + (delete-region ,(point-min-marker) + ,(point-max-marker))))))))) ((or (equal type "enriched") (equal type "richtext")) (save-excursion @@ -157,13 +171,18 @@ (goto-char (point-min))) (defun mm-inline-message (handle) - (let ((b (point))) + (let ((b (point)) gnus-displaying-mime handles) (save-excursion (save-restriction (narrow-to-region b b) (mm-insert-part handle) - (run-hooks 'gnus-article-decode-hook) - (gnus-article-prepare-display) + (let (gnus-article-mime-handles) + (run-hooks 'gnus-article-decode-hook) + (gnus-article-prepare-display) + (setq handles gnus-article-mime-handles)) + (if handles + (setq gnus-article-mime-handles + (append gnus-article-mime-handles handles))) (mm-handle-set-undisplayer handle `(lambda () diff --git a/lisp/mml.el b/lisp/mml.el index dc6266b..16c7341 100644 --- a/lisp/mml.el +++ b/lisp/mml.el @@ -26,6 +26,7 @@ (require 'mm-util) (require 'mm-bodies) (require 'mm-encode) +(require 'mm-decode) (eval-and-compile (autoload 'message-make-message-id "message")) @@ -617,7 +618,7 @@ (when (string-match "[\"\\~/* \t\n]" value) (setq value (prin1-to-string value))) (insert (format " %s=%s" key value))))) - (insert ">\n<#/part>\n")) + (insert ">\n<#/" name ">\n")) ;;; Attachment functions. @@ -661,14 +662,13 @@ TYPE is the MIME type to use." 'description description)) (defun mml-insert-multipart (&optional type) - (interactive (list (completing-read "Multipart type (default mixed): ") - "mixed" + (interactive (list (completing-read "Multipart type (default mixed): " '(("mixed") ("alternative") ("digest") ("parallel") - ("signed") ("encrypted")))) + ("signed") ("encrypted")) + nil nil "mixed"))) (or type (setq type "mixed")) (mml-insert-tag "multipart" 'type type) - (insert "<#/!multipart>\n") (forward-line -1)) (defun mml-preview (&optional raw) diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 0b463a8..e507fcd 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -423,7 +423,7 @@ parameter. It should return nil, `warn' or `delete'." "Coding system used in nnmail.") (defvar nnmail-file-coding-system-1 - (if (string-match "nt" system-configuration) + (if (string-match "nt\\|windows" system-configuration) 'raw-text-dos 'binary) "Another coding system used in nnmail.") diff --git a/lisp/rfc2047.el b/lisp/rfc2047.el index f11194c..a389d36 100644 --- a/lisp/rfc2047.el +++ b/lisp/rfc2047.el @@ -326,6 +326,10 @@ Return WORD if not." "Decode STRING that uses CHARSET with ENCODING. Valid ENCODINGs are \"B\" and \"Q\". If your Emacs implementation can't decode CHARSET, it returns nil." + (if (stringp charset) + (setq charset (intern (downcase charset)))) + (if (or (not charset) (memq charset mail-parse-ignored-charsets)) + (setq charset mail-parse-charset)) (let ((cs (mm-charset-to-coding-system charset))) (when cs (when (and (eq cs 'ascii) -- 1.7.10.4