2 ;;; tm-gnus.el --- tm-gnus module for GNUS 3.* and 4.*
4 ;;; $Id: tm-ognus.el,v 6.8 1995/09/02 07:40:13 morioka Exp $
12 (defvar tm-gnus/decoding-mode t "*Decode MIME header if non-nil.")
14 (defun tm-gnus/add-decoding-mode-to-mode-line ()
15 (or (assq 'tm-gnus/decoding-mode minor-mode-alist)
16 (setq minor-mode-alist
17 (cons (list 'tm-gnus/decoding-mode " MIME")
22 ;;; @ change MIME encoded-word decoding mode, decoding or non decoding.
25 (defun tm-gnus/set-decoding-mode (arg)
26 "Set MIME encoded-word processing.
27 With arg, turn MIME encoded-word processing on iff arg is positive."
28 (setq tm-gnus/decoding-mode arg)
29 (setq gnus-have-all-headers (not gnus-have-all-headers))
30 (gnus-summary-select-article (not gnus-have-all-headers) t)
33 (defun tm-gnus/toggle-decoding-mode ()
34 "Toggle MIME encoded-word processing.
35 With arg, turn MIME encoded-word processing on iff arg is positive."
37 (tm-gnus/set-decoding-mode (not tm-gnus/decoding-mode))
41 ;;; @ to decode subjects in mode-line
43 ;; This function imported from gnus.el.
45 ;; New implementation in gnus 3.14.3
48 (defun tm-gnus/article-set-mode-line ()
49 "Set Article mode line string.
50 If you don't like it, define your own gnus-article-set-mode-line."
51 (let ((maxlen 15) ;Maximum subject length
53 (if gnus-current-headers
54 (mime/decode-string (nntp-header-subject gnus-current-headers))
57 ;; The value must be a string to escape %-constructs because of subject.
58 (setq mode-line-buffer-identification
59 (format "GNUS: %s%s %s%s%s"
61 (if gnus-current-article
62 (format "/%d" gnus-current-article) "")
63 (rightful-boundary-short-string subject
64 (min (string-width subject)
66 (if (> (string-width subject) maxlen) "..." "")
67 (make-string (max 0 (- 17 (string-width subject))) ? )
69 (set-buffer-modified-p t))
72 ;;; @ to decode subjects in Summary buffer
75 (defun tm-gnus/decode-summary-subjects ()
78 (let ((subj (or (gnus-header-subject header) "")))
79 (nntp-set-header-subject header (mime/decode-string subj))
81 gnus-newsgroup-headers)