+2000-10-03 21:20:31 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * 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 <zsh@cs.rochester.edu>
+
+ * gnus-art.el (gnus-mime-inline-part): Support prefix argument.
+
+2000-10-03 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * lpath.el: "." is in the load-path because dgnushack.el.
+
+2000-10-03 Bjorn Torkelsson <torkel@hpc2n.umu.se>
+
+ * 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 <larsi@gnus.org>
* nnweb.el (nnweb-decode-entities): Work for non-character
((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)))
(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)))
;;; 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)
: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
;;;
(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
(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)
(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)
;; 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))
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)
(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.
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))
(message "%s(Y/n) Yes" prompt)
t)))
-(when (string-match "XEmacs" emacs-version)
+(when (featurep 'xemacs)
(require 'nnheaderxm))
(run-hooks 'nnheader-load-hook)
(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)))