;;; ;;; tm-ognus.el --- tm-gnus module for GNUS 3.* and 4.* ;;; ;;; Copyright (C) 1995 Free Software Foundation, Inc. ;;; Copyright (C) 1995 MORIOKA Tomohiko ;;; ;;; Author: MORIOKA Tomohiko ;;; Version: ;;; $Id: tm-ognus.el,v 7.1 1995/10/17 16:56:12 morioka Exp $ ;;; Keywords: news, MIME, multimedia, multilingual, encoded-word ;;; ;;; This file is part of tm (Tools for MIME). ;;; (require 'emu) (require 'gnus) (autoload 'mime/decode-message-header "tm-ew-d" "Decode MIME encoded-words in message header." t) (autoload 'mime-eword/decode-string "tm-ew-d" "Decode MIME encoded-words in string." t) (defvar tm-gnus/decoding-mode t "*Decode MIME header if non-nil.") (defun tm-gnus/add-decoding-mode-to-mode-line () (or (assq 'tm-gnus/decoding-mode minor-mode-alist) (setq minor-mode-alist (cons (list 'tm-gnus/decoding-mode " MIME") minor-mode-alist)) )) ;;; @ change MIME encoded-word decoding mode, decoding or non decoding. ;;; (defun tm-gnus/set-decoding-mode (arg) "Set MIME encoded-word processing. With arg, turn MIME encoded-word processing on iff arg is positive." (setq tm-gnus/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-decoding-mode () "Toggle MIME encoded-word processing. With arg, turn MIME encoded-word processing on iff arg is positive." (interactive) (tm-gnus/set-decoding-mode (not tm-gnus/decoding-mode)) ) ;;; @ to decode subjects 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-eword/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)) ;;; @ to decode subjects in Summary buffer ;;; (defun tm-gnus/decode-summary-subjects () (mapcar (function (lambda (header) (let ((subj (or (gnus-header-subject header) ""))) (nntp-set-header-subject header (mime-eword/decode-string subj)) ))) gnus-newsgroup-headers) ) ;;; @ end ;;; (provide 'tm-ognus)