2 ;;; A MIME extension for GNUS
4 ;;; by Morioka Tomohiko, 1993/11/20
19 (defconst tm-gnus/RCS-ID
20 "$Id: tm-gnus.el,v 5.1 1994/10/25 07:17:51 morioka Exp $")
22 (defconst tm-gnus/version (get-version-string tm-gnus/RCS-ID))
27 (defvar tm-gnus/startup-hook nil)
30 ;;; @ to decode subjects in mode-line
32 ;; This function imported from gnus.el.
34 ;; New implementation in gnus 3.14.3
36 (defun tm-gnus/article-set-mode-line ()
37 "Set Article mode line string.
38 If you don't like it, define your own gnus-article-set-mode-line."
39 (let ((maxlen 15) ;Maximum subject length
41 (if gnus-current-headers
42 (mime/decode-string (nntp-header-subject gnus-current-headers))
45 ;; The value must be a string to escape %-constructs because of subject.
46 (setq mode-line-buffer-identification
47 (format "GNUS: %s%s %s%s%s"
49 (if gnus-current-article
50 (format "/%d" gnus-current-article) "")
51 (rightful-boundary-short-string subject
52 (min (string-width subject)
54 (if (> (string-width subject) maxlen) "..." "")
55 (make-string (max 0 (- 17 (string-width subject))) ? )
57 (set-buffer-modified-p t))
60 ;;; @ to decode subjects in Summary buffer
62 (defun tm-gnus/decode-summary-subjects ()
65 (nntp-set-header-subject
67 (mime/decode-string (gnus-header-subject header))
69 gnus-newsgroup-headers)
73 ;;; @ change MIME header decoding mode, decoding or non decoding.
76 (defun tm-gnus/set-mime-header-decoding-mode (arg)
77 "Set MIME header processing.
78 With arg, turn MIME processing on iff arg is positive."
79 (setq mime/header-decoding-mode arg)
80 (setq gnus-have-all-headers (not gnus-have-all-headers))
81 (gnus-summary-select-article (not gnus-have-all-headers) t)
84 (defun tm-gnus/toggle-mime-header-decoding-mode ()
85 "Toggle MIME header processing.
86 With arg, turn MIME processing on iff arg is positive."
88 (tm-gnus/set-mime-header-decoding-mode (not mime/header-decoding-mode))
93 (if (string-match "^GNUS [0-3]" gnus-version)
98 (run-hooks 'tm-gnus/startup-hook)