tm 7.27.
[elisp/tm.git] / gnus / tm-gd3.el
1 ;;;
2 ;;; tm-gd3.el --- tm-gnus module for GNUS 3.* and 4.*
3 ;;;
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1995 MORIOKA Tomohiko
6 ;;;
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;;; Version:
9 ;;;     $Id: tm-gd3.el,v 7.4 1995/11/19 07:10:19 morioka Exp $
10 ;;; Keywords: news, MIME, multimedia, multilingual, encoded-word
11 ;;;
12 ;;; This file is part of tm (Tools for MIME).
13 ;;;
14
15 (require 'tm-ew-d)
16
17
18 ;;; @ to decode subjects in mode-line
19 ;;;
20 ;; This function imported from gnus.el.
21 ;;
22 ;; New implementation in gnus 3.14.3
23 ;;
24
25 (defun tm-gnus/article-set-mode-line ()
26   "Set Article mode line string.
27 If you don't like it, define your own gnus-article-set-mode-line."
28   (let ((maxlen 15)                     ;Maximum subject length
29         (subject
30          (if gnus-current-headers
31              (mime-eword/decode-string
32               (nntp-header-subject gnus-current-headers))
33            "")
34          ))
35     ;; The value must be a string to escape %-constructs because of subject.
36     (setq mode-line-buffer-identification
37           (format "GNUS: %s%s %s%s%s"
38                   gnus-newsgroup-name
39                   (if gnus-current-article
40                       (format "/%d" gnus-current-article) "")
41                   (rightful-boundary-short-string subject
42                                                   (min (string-width subject)
43                                                        maxlen))
44                   (if (> (string-width subject) maxlen) "..." "")
45                   (make-string (max 0 (- 17 (string-width subject))) ? )
46                   )))
47   (set-buffer-modified-p t))
48
49
50 ;;; @ to decode subjects in Summary buffer
51 ;;;
52
53 (defun tm-gnus/decode-summary-subjects ()
54   (mapcar (function
55            (lambda (header)
56              (let ((subj (or (gnus-header-subject header) "")))
57                (nntp-set-header-subject
58                 header (mime-eword/decode-string subj))
59                )))
60           gnus-newsgroup-headers)
61   )
62
63
64 ;;; @ end
65 ;;;
66
67 (provide 'tm-gd3)