* dgnushack.el: Fix last change.
+2001-07-09 17:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * mm-view.el (mm-inline-text): w3-coding-system-for-mime-charset
+ may not defined. From: Raja R Harinath <harinath@cs.umn.edu>.
+
+ * message.el (message-send-mail-real-function): New variable.
+ (message-send-mail-partially, message-send-mail):
+
+ * nngateway.el (nngateway-request-post): Use it.
+
+ * gnus-agent.el (gnus-agentize): Use it.
+
+ * nnsoup.el (nnsoup-old-functions, nnsoup-set-variables)
+ (nnsoup-revert-variables): Use it.
+
+2001-07-09 Colin Walters <walters@cis.ohio-state.edu>
+
+ * mm-decode.el (mm-inline-media-tests): Default to displaying as
+ text/plain if the type doesn't match any other media types.
+ (mm-inlined-types): Doc fix.
+ (mm-display-inline): Revert previous change (now handled by a
+ default type in `mm-inline-media-tests'.
+ (mm-inlinable-p): Revive.
+ (mm-display-part): Call `mm-inlinable-p'.
+ (mm-attachment-override-p): Ditto.
+ (mm-inlined-p): Doc fix.
+
+ * gnus-art.el (gnus-mime-display-single): Call `mm-inlinable-p' as
+ well as `mm-inlined-p'.
+
2001-07-09 13:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
* nntp.el (nntp-send-command, nntp-send-command-nodelete):
;; included in the standard `load-path' or added by the configure
;; option "--with-addpath=".
(let ((path (or (locate-library "path-util")
- (locate-library "apel/path-util"))));; backward compat.
+ (locate-library "apel/path-util")));; backward compat.
+ parent lpath)
(if path
(progn
(when (string-match "/$" (setq path (file-name-directory path)))
(setq path (substring path 0 (match-beginning 0))))
;; path == "/var/home/john/lisp/apel-VERSION"
- (unless (or (member path load-path)
- (member (file-name-as-directory path) load-path))
- (push path load-path))
- (when (string-match "/$" (setq path (file-name-directory path)))
- (setq path (substring path 0 (match-beginning 0))))
- ;; path == "/var/home/john/lisp"
- (unless (or (member path load-path)
- (member (file-name-as-directory path) load-path))
- (push path (cdr load-path)))
+ (when (string-match "/$" (setq parent (file-name-directory path)))
+ (setq parent (substring path 0 (match-beginning 0))))
+ ;; parent == "/var/home/john/lisp"
+ (if (setq lpath (or (member path load-path)
+ (member (file-name-as-directory path) load-path)))
+ (unless (or (member parent load-path)
+ (member (file-name-as-directory parent) load-path))
+ (push parent (cdr lpath)))
+ (push path load-path)
+ (unless (or (member parent load-path)
+ (member (file-name-as-directory parent) load-path))
+ (push parent (cdr load-path))))
(require 'path-util))
(error "
APEL modules are not found in %s.
\(gnus-agentize)
This will modify the `gnus-setup-news-hook', and
-`message-send-mail-function' variables, and install the Gnus agent
+`message-send-mail-real-function' variables, and install the Gnus agent
minor mode in all Gnus buffers."
(interactive)
(gnus-open-agent)
(add-hook 'gnus-setup-news-hook 'gnus-agent-queue-setup)
(unless gnus-agent-send-mail-function
- (setq gnus-agent-send-mail-function message-send-mail-function
- message-send-mail-function 'gnus-agent-send-mail))
+ (setq gnus-agent-send-mail-function (or
+ message-send-mail-real-function
+ message-send-mail-function)
+ message-send-mail-real-function 'gnus-agent-send-mail))
(unless gnus-agent-covered-methods
(setq gnus-agent-covered-methods (list gnus-select-method))))
"inline")
(mm-attachment-override-p handle))))
(mm-automatic-display-p handle)
- (or (mm-inlined-p handle)
+ (or (and
+ (mm-inlinable-p handle)
+ (mm-inlined-p handle))
(mm-automatic-external-display-p type)))
(setq display t)
(when (equal (mm-handle-media-supertype handle) "text")
(defvar message-options nil
"Some saved answers when sending message.")
+(defvar message-send-mail-real-function nil
+ "Internal send mail function.")
+
(eval-and-compile
(autoload 'message-setup-toolbar "messagexmas")
(autoload 'mh-new-draft-name "mh-comp")
(delete-region (match-end 0) (std11-field-end))
(insert " " (message-make-message-id))))
(condition-case err
- (funcall message-send-mail-function)
+ (funcall (or message-send-mail-real-function
+ message-send-mail-function))
(error
(throw 'message-sending-mail-failure err))))))
nil)
(condition-case err
(progn
- (funcall message-send-mail-function)
+ (funcall (or message-send-mail-real-function
+ message-send-mail-function))
nil)
(error err))))
(when failure
(insert "\n")
(widen)
(mm-with-unibyte-current-buffer
- (funcall message-send-mail-function)))
+ (funcall (or message-send-mail-real-function
+ message-send-mail-function))))
(setq n (+ n 1))
(setq p (pop plist))
(erase-buffer)))
("application/pkcs7-signature" ignore identity)
("multipart/alternative" ignore identity)
("multipart/mixed" ignore identity)
- ("multipart/related" ignore identity))
+ ("multipart/related" ignore identity)
+ ;; Default to displaying as text
+ (".*" mm-inline-text identity))
"Alist of media types/tests saying whether types can be displayed inline."
:type '(repeat (list (string :tag "MIME type")
(function :tag "Display function")
"application/pkcs7-signature")
"List of media types that are to be displayed inline.
See also `mm-inline-media-tests', which says how to display a media
-type inline. If no media test is defined, the default is to treat the
-type as plain text."
+type inline."
:type '(repeat string)
:group 'mime-display)
(mm-remove-part handle)
(let* ((type (mm-handle-media-type handle))
(method (mailcap-mime-info type)))
- (if (mm-inlined-p handle)
+ (if (and (mm-inlinable-p handle)
+ (mm-inlined-p handle))
(progn
(forward-line 1)
(mm-display-inline handle)
(defun mm-display-inline (handle)
(let* ((type (mm-handle-media-type handle))
(function (cadr (mm-assoc-string-match mm-inline-media-tests type))))
- (funcall (or function #'mm-inline-text) handle)
+ (funcall function handle)
(goto-char (point-min))))
(defun mm-assoc-string-match (alist type)
methods nil)))
result))
+(defun mm-inlinable-p (handle)
+ "Say whether HANDLE can be displayed inline."
+ (let ((alist mm-inline-media-tests)
+ (type (mm-handle-media-type handle))
+ test)
+ (while alist
+ (when (string-match (caar alist) type)
+ (setq test (caddar alist)
+ alist nil)
+ (setq test (funcall test handle)))
+ (pop alist))
+ test))
+
(defun mm-inlined-p (handle)
- "Say whether the user wants HANDLE to be displayed automatically."
+ "Say whether the user wants HANDLE to be displayed inline."
(let ((methods mm-inlined-types)
(type (mm-handle-media-type handle))
method result)
ty)
(catch 'found
(while (setq ty (pop types))
- (when (string-match ty type)
+ (when (and (string-match ty type)
+ (mm-inlinable-p ty))
(throw 'found t))))))
(defun mm-inline-override-p (handle)
(and (boundp 'w3-meta-charset-content-type-regexp)
(re-search-forward
w3-meta-charset-content-type-regexp nil t)))
- (setq charset (or (w3-coding-system-for-mime-charset
- (buffer-substring-no-properties
- (match-beginning 2)
- (match-end 2)))
- charset)))
+ (setq charset
+ (or (let ((bsubstr (buffer-substring-no-properties
+ (match-beginning 2)
+ (match-end 2))))
+ (if (fboundp 'w3-coding-system-for-mime-charset)
+ (w3-coding-system-for-mime-charset bsubstr)
+ (mm-charset-to-coding-system bsubstr)))
+ charset)))
(delete-region (point-min) (point-max))
(insert (mm-decode-string text charset))
(save-window-excursion
(insert mail-header-separator "\n")
(widen)
(let (message-required-mail-headers)
- (funcall message-send-mail-function))
+ (funcall (or message-send-mail-real-function
+ message-send-mail-function)))
t))))
;;; Internal functions
(and areas (car areas))))
(defvar nnsoup-old-functions
- (list message-send-mail-function message-send-news-function))
+ (list message-send-mail-real-function message-send-news-function))
;;;###autoload
(defun nnsoup-set-variables ()
"Use the SOUP methods for posting news and mailing mail."
(interactive)
(setq message-send-news-function 'nnsoup-request-post)
- (setq message-send-mail-function 'nnsoup-request-mail))
+ (setq message-send-mail-real-function 'nnsoup-request-mail))
;;;###autoload
(defun nnsoup-revert-variables ()
"Revert posting and mailing methods to the standard Emacs methods."
(interactive)
- (setq message-send-mail-function (car nnsoup-old-functions))
+ (setq message-send-mail-real-function (car nnsoup-old-functions))
(setq message-send-news-function (cadr nnsoup-old-functions)))
(defun nnsoup-store-reply (kind)