tm 7.27.1.
[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.5 1995/11/21 02:49:25 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 (require 'tm-ew-d)
31
32
33 ;;; @ to decode subjects in mode-line
34 ;;;
35 ;; This function imported from gnus.el.
36 ;;
37 ;; New implementation in gnus 3.14.3
38 ;;
39
40 (defun tm-gnus/article-set-mode-line ()
41   "Set Article mode line string.
42 If you don't like it, define your own gnus-article-set-mode-line."
43   (let ((maxlen 15)                     ;Maximum subject length
44         (subject
45          (if gnus-current-headers
46              (mime-eword/decode-string
47               (nntp-header-subject gnus-current-headers))
48            "")
49          ))
50     ;; The value must be a string to escape %-constructs because of subject.
51     (setq mode-line-buffer-identification
52           (format "GNUS: %s%s %s%s%s"
53                   gnus-newsgroup-name
54                   (if gnus-current-article
55                       (format "/%d" gnus-current-article) "")
56                   (rightful-boundary-short-string subject
57                                                   (min (string-width subject)
58                                                        maxlen))
59                   (if (> (string-width subject) maxlen) "..." "")
60                   (make-string (max 0 (- 17 (string-width subject))) ? )
61                   )))
62   (set-buffer-modified-p t))
63
64
65 ;;; @ to decode subjects in Summary buffer
66 ;;;
67
68 (defun tm-gnus/decode-summary-subjects ()
69   (mapcar (function
70            (lambda (header)
71              (let ((subj (or (gnus-header-subject header) "")))
72                (nntp-set-header-subject
73                 header (mime-eword/decode-string subj))
74                )))
75           gnus-newsgroup-headers)
76   )
77
78
79 ;;; @ end
80 ;;;
81
82 (provide 'tm-gd3)