From 8f7126cd0c9a866e65fb210282f30338841764c1 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 4 Oct 2000 02:42:54 +0000 Subject: [PATCH] Synch with Gnus. --- lisp/ChangeLog | 30 ++++++++++++++++++++++++++++++ lisp/binhex.el | 4 ++-- lisp/earcon.el | 3 --- lisp/gnus-art.el | 43 ++++++++++++++++++++++++++++++++++++++++--- lisp/gnus-audio.el | 3 --- lisp/lpath.el | 1 - lisp/message.el | 2 +- lisp/mm-util.el | 2 +- lisp/nnheader.el | 2 +- lisp/uudecode.el | 2 +- 10 files changed, 76 insertions(+), 16 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3b11760..047f997 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,33 @@ +2000-10-03 21:20:31 ShengHuo ZHU + + * gnus-art.el (gnus-mime-action-alist): New variable. + (gnus-mime-action-on-part): Use it. + (gnus-mime-button-commands): Add command ".". + +2000-10-03 20:37:42 ShengHuo ZHU + + * gnus-art.el (gnus-mime-inline-part): Support prefix argument. + +2000-10-03 Katsumi Yamaoka + + * lpath.el: "." is in the load-path because dgnushack.el. + +2000-10-03 Bjorn Torkelsson + + * uudecode.el: xemacs cleanup (use featurep ' xemacs) + + * nnheader.el: ditto + + * mm-util.el: ditto + + * message.el: ditto + + * binhex.el: ditto + + * gnus-audio.el: removed unnecessary xemacs test + + * earcon.el: ditto + 2000-10-03 19:55:55 Lars Magne Ingebrigtsen * nnweb.el (nnweb-decode-entities): Work for non-character diff --git a/lisp/binhex.el b/lisp/binhex.el index 200d571..c7fb243 100644 --- a/lisp/binhex.el +++ b/lisp/binhex.el @@ -67,7 +67,7 @@ input and write the converted data to its standard output.") ((boundp 'temporary-file-directory) temporary-file-directory) ("/tmp/"))) -(if (string-match "XEmacs" emacs-version) +(if (featurep 'xemacs) (defalias 'binhex-insert-char 'insert-char) (defun binhex-insert-char (char &optional count ignored buffer) (if (or (null buffer) (eq buffer (current-buffer))) @@ -198,7 +198,7 @@ If HEADER-ONLY is non-nil only decode header and return filename." (save-excursion (goto-char start) (when (re-search-forward binhex-begin-line end t) - (if (and (not (string-match "XEmacs\\|Lucid" emacs-version)) + (if (and (not (featurep 'xemacs)) (boundp 'enable-multibyte-characters)) (let ((multibyte (default-value 'enable-multibyte-characters))) diff --git a/lisp/earcon.el b/lisp/earcon.el index a698479..1fe7d9e 100644 --- a/lisp/earcon.el +++ b/lisp/earcon.el @@ -22,9 +22,6 @@ ;;; Code: -(if (null (boundp 'running-xemacs)) - (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))) - (eval-when-compile (require 'cl)) (require 'gnus) (require 'gnus-audio) diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 88e13d9..7bd0c80 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -683,6 +683,20 @@ used." :value undisplayed-alternative) (function))) +(defcustom gnus-mime-action-alist + '(("save to file" . gnus-mime-save-part) + ("display as text" . gnus-mime-inline-part) + ("view the part" . gnus-mime-view-part) + ("pipe to command" . gnus-mime-pipe-part) + ("toggle display" . gnus-article-press-button) + ("view as type" . gnus-mime-view-part-as-type) + ("internalize type" . gnus-mime-internalize-part) + ("externalize type" . gnus-mime-externalize-part)) + "An alist of actions that run on the MIME attachment." + :group 'gnus-article-mime + :type '(repeat (cons (string :tag "name") + (function)))) + ;;; ;;; The treatment variables ;;; @@ -3255,7 +3269,8 @@ value of the variable `gnus-show-mime' is non-nil." (gnus-mime-inline-part "i" "View As Text, In This Buffer") (gnus-mime-internalize-part "E" "View Internally") (gnus-mime-externalize-part "e" "View Externally") - (gnus-mime-pipe-part "|" "Pipe To Command..."))) + (gnus-mime-pipe-part "|" "Pipe To Command...") + (gnus-mime-action-on-part "." "Take action on the part"))) (defun gnus-article-mime-part-status () (with-current-buffer gnus-article-buffer @@ -3380,14 +3395,26 @@ value of the variable `gnus-show-mime' is non-nil." (interactive) (gnus-article-check-buffer) (let* ((handle (or handle (get-text-property (point) 'gnus-data))) - contents + contents charset (b (point)) buffer-read-only) (if (mm-handle-undisplayer handle) (mm-remove-part handle) (setq contents (mm-get-part handle)) + (cond + ((not current-prefix-arg) + (setq charset (or (mail-content-type-get + (mm-handle-type handle) 'charset) + gnus-newsgroup-charset))) + ((numberp current-prefix-arg) + (setq charset + (or (cdr (assq current-prefix-arg + gnus-summary-show-article-charset-alist)) + (read-coding-system "Charset: "))))) (forward-line 2) - (mm-insert-inline handle contents) + (mm-insert-inline handle (if charset + (mm-decode-coding-string contents charset) + contents)) (goto-char b)))) (defun gnus-mime-externalize-part (&optional handle) @@ -3421,6 +3448,16 @@ In no internal viewer is available, use an external viewer." (mm-remove-part handle) (mm-display-part handle)))) +(defun gnus-mime-action-on-part (&optional action) + "Do something with the MIME attachment at \(point\)." + (interactive + (list (completing-read "Action: " gnus-mime-action-alist))) + (gnus-article-check-buffer) + (let ((action-pair (assoc action gnus-mime-action-alist))) + (if action-pair + (funcall (cdr action-pair))))) + + (defun gnus-article-part-wrapper (n function) (save-current-buffer (set-buffer gnus-article-buffer) diff --git a/lisp/gnus-audio.el b/lisp/gnus-audio.el index e84c1df..51d054c 100644 --- a/lisp/gnus-audio.el +++ b/lisp/gnus-audio.el @@ -26,9 +26,6 @@ ;; You can safely ignore most of it until Red Gnus. **Evil Laugh** ;;; Code: -(when (null (boundp 'running-xemacs)) - (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))) - (require 'nnheader) (eval-when-compile (require 'cl)) diff --git a/lisp/lpath.el b/lisp/lpath.el index 8091555..916b108 100644 --- a/lisp/lpath.el +++ b/lisp/lpath.el @@ -112,7 +112,6 @@ make-symbolic-link map-extents smiley-encode-buffer toolbar-gnus))) -(setq load-path (cons "." load-path)) (require 'custom) (defun md5 (object &optional start end coding noerror) diff --git a/lisp/message.el b/lisp/message.el index b17e411..a83409f 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -5204,7 +5204,7 @@ which specify the range to operate on." (defalias 'message-exchange-point-and-mark 'exchange-point-and-mark) ;; Support for toolbar -(when (string-match "XEmacs\\|Lucid" emacs-version) +(when (featurep 'xemacs) (require 'messagexmas)) ;;; Group name completion. diff --git a/lisp/mm-util.el b/lisp/mm-util.el index 3091e20..31f5938 100644 --- a/lisp/mm-util.el +++ b/lisp/mm-util.el @@ -313,7 +313,7 @@ If the charset is `composition', return the actual one." See also `with-temp-file' and `with-output-to-string'." (let ((temp-buffer (make-symbol "temp-buffer")) (multibyte (make-symbol "multibyte"))) - `(if (or (string-match "XEmacs\\|Lucid" emacs-version) + `(if (or (featurep 'xemacs) (not (boundp 'enable-multibyte-characters))) (with-temp-buffer ,@forms) (let ((,multibyte (default-value 'enable-multibyte-characters)) diff --git a/lisp/nnheader.el b/lisp/nnheader.el index f70171b..bd11872 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -1133,7 +1133,7 @@ find-file-hooks, etc. (message "%s(Y/n) Yes" prompt) t))) -(when (string-match "XEmacs" emacs-version) +(when (featurep 'xemacs) (require 'nnheaderxm)) (run-hooks 'nnheader-load-hook) diff --git a/lisp/uudecode.el b/lisp/uudecode.el index 19eb5ad..fa55b88 100644 --- a/lisp/uudecode.el +++ b/lisp/uudecode.el @@ -111,7 +111,7 @@ If FILE-NAME is non-nil, save the result to FILE-NAME." (and work-buffer (kill-buffer work-buffer)) (ignore-errors (or file-name (delete-file tempfile)))))) -(if (string-match "XEmacs" emacs-version) +(if (featurep 'xemacs) (defalias 'uudecode-insert-char 'insert-char) (defun uudecode-insert-char (char &optional count ignored buffer) (if (or (null buffer) (eq buffer (current-buffer))) -- 1.7.10.4