This commit was generated by cvs2svn to compensate for changes in r542,
[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 ;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
9 ;;; Created: 1995/05/23 (obsolete tm-ognus.el)
10 ;;; Version:
11 ;;;     $Id: tm-gd3.el,v 7.6 1996/03/27 19:27:04 morioka Exp $
12 ;;; Keywords: news, MIME, multimedia, multilingual, encoded-word
13 ;;;
14 ;;; This file is part of tm (Tools for MIME).
15 ;;;
16 ;;; This program is free software; you can redistribute it and/or
17 ;;; modify it under the terms of the GNU General Public License as
18 ;;; published by the Free Software Foundation; either version 2, or
19 ;;; (at your option) any later version.
20 ;;;
21 ;;; This program is distributed in the hope that it will be useful,
22 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24 ;;; General Public License for more details.
25 ;;;
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with This program.  If not, write to the Free Software
28 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
29 ;;;
30 ;;; Code:
31
32 (require 'tm-ew-d)
33
34
35 ;;; @ to decode subjects in mode-line
36 ;;;
37 ;; This function imported from gnus.el.
38 ;;
39 ;; New implementation in gnus 3.14.3
40 ;;
41
42 (defun tm-gnus/article-set-mode-line ()
43   "Set Article mode line string.
44 If you don't like it, define your own gnus-article-set-mode-line."
45   (let ((maxlen 15)                     ;Maximum subject length
46         (subject
47          (if gnus-current-headers
48              (mime-eword/decode-string
49               (nntp-header-subject gnus-current-headers))
50            "")
51          ))
52     ;; The value must be a string to escape %-constructs because of subject.
53     (setq mode-line-buffer-identification
54           (format "GNUS: %s%s %s%s%s"
55                   gnus-newsgroup-name
56                   (if gnus-current-article
57                       (format "/%d" gnus-current-article) "")
58                   (truncate-string subject
59                                    (min (string-width subject) maxlen))
60                   (if (> (string-width subject) maxlen) "..." "")
61                   (make-string (max 0 (- 17 (string-width subject))) ? )
62                   )))
63   (set-buffer-modified-p t))
64
65
66 ;;; @ to decode subjects in Summary buffer
67 ;;;
68
69 (defun tm-gnus/decode-summary-subjects ()
70   (mapcar (function
71            (lambda (header)
72              (let ((subj (or (gnus-header-subject header) "")))
73                (nntp-set-header-subject
74                 header (mime-eword/decode-string subj))
75                )))
76           gnus-newsgroup-headers)
77   )
78
79
80 ;;; @ end
81 ;;;
82
83 (provide 'tm-gd3)
84
85 ;;; tm-gd3.el ends here