;;; ;;; $Id: tm-gnus.el,v 2.0 1994/07/24 08:33:00 morioka Exp morioka $ ;;; ;;; A MIME extension for GNUS ;;; ;;; by Morioka Tomohiko, 1993/11/20 (provide 'tm-gnus) (require 'tm-misc) (require 'gnus) ;;; @ variables ;;; (defvar tm-gnus/startup-hook nil) ;;; @ to decode subject in mode-line ;;; ;; This function imported from gnus.el. ;; ;; New implementation in gnus 3.14.3 ;; (defun tm-gnus/article-set-mode-line () "Set Article mode line string. If you don't like it, define your own gnus-article-set-mode-line." (let ((maxlen 15) ;Maximum subject length (subject (if gnus-current-headers (mime/decode-string (nntp-header-subject gnus-current-headers)) "") )) ;; The value must be a string to escape %-constructs because of subject. (setq mode-line-buffer-identification (format "GNUS: %s%s %s%s%s" gnus-newsgroup-name (if gnus-current-article (format "/%d" gnus-current-article) "") (rightful-boundary-short-string subject (min (string-width subject) maxlen)) (if (> (string-width subject) maxlen) "..." "") (make-string (max 0 (- 17 (string-width subject))) ? ) ))) (set-buffer-modified-p t)) ;;; @ MIME full decode message ;;; (defun tm-gnus/full-decode-message-old (arg) "MIME full-decode this article." (interactive "P") (let ((gnus-Article-prepare-hook mime/body-decoding-method)) ;; The following is a trick ;; to force to read the current article again. (setq gnus-have-all-headers (not gnus-have-all-headers)) (gnus-summary-select-article (not gnus-have-all-headers) t) )) (defun tm-gnus/full-decode-message-new (arg) "MIME full-decode this article." (interactive "P") (setq gnus-show-mime t) ;; The following is a trick to force to read the current article again. (setq gnus-have-all-headers (not gnus-have-all-headers)) (gnus-summary-select-article (not gnus-have-all-headers) t) (setq gnus-show-mime nil)) (defun tm-gnus/play-message (arg) "MIME decode and play this message." (interactive "P") (let ((mime/body-decoding-mode "play")) (tm-gnus/full-decode-message arg) ) (mime/show-body-decoded-result) ) (defun tm-gnus/extract-message (arg) "MIME decode and extract files from this message." (interactive "P") (let ((mime/body-decoding-mode "extract")) (tm-gnus/full-decode-message arg) ) (mime/show-body-decoded-result) ) (defun tm-gnus/print-message (arg) "MIME decode and print contents of this message." (interactive "P") (let ((mime/body-decoding-mode "print")) (tm-gnus/full-decode-message arg) ) (mime/show-body-decoded-result) ) ;;; @ change MIME header decoding mode, decoding or non decoding. ;;; (defun tm-gnus/set-mime-header-decoding-mode (arg) "Set MIME header processing. With arg, turn MIME processing on iff arg is positive." (setq mime/header-decoding-mode arg) (setq gnus-have-all-headers (not gnus-have-all-headers)) (gnus-summary-select-article (not gnus-have-all-headers) t) ) (defun tm-gnus/toggle-mime-header-decoding-mode () "Toggle MIME header processing. With arg, turn MIME processing on iff arg is positive." (interactive) (tm-gnus/set-mime-header-decoding-mode (not mime/header-decoding-mode)) ) ;;; @ set up ;;; (if (string-match "^GNUS [0-3]" gnus-version) (require 'tm-gnus3) (require 'tm-gnus4) ) (run-hooks 'tm-gnus/startup-hook)