annotate lisp/tm/tm-gd3.el @ 4:b82b59fe008d r19-15b3

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