annotate lisp/gnus/gnus-art.el @ 109418:6e96aca307a4

Merge from mainline.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sun, 27 Jun 2010 22:48:36 +0000
parents 98ae5d8b7b72
children 8b1192833a1e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1 ;;; gnus-art.el --- article mode commands for Gnus
64754
fafd692d1e40 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64735
diff changeset
2
fafd692d1e40 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64735
diff changeset
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 106746
diff changeset
4 ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7 ;; Keywords: news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93726
diff changeset
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93726
diff changeset
13 ;; the Free Software Foundation, either version 3 of the License, or
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93726
diff changeset
14 ;; (at your option) any later version.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
74151
a74b0c78f3ac (gnus-article-x-face-command, gnus-numeric-save-name):
Juanma Barranquero <lekktu@gmail.com>
parents: 73627
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
19 ;; GNU General Public License for more details.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
20
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93726
diff changeset
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
23
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
24 ;;; Commentary:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
25
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
26 ;;; Code:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
27
87187
54ba9c058e4a (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87161
diff changeset
28 ;; For Emacs < 22.2.
54ba9c058e4a (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87161
diff changeset
29 (eval-and-compile
54ba9c058e4a (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87161
diff changeset
30 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
31 (eval-when-compile
86154
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85888
diff changeset
32 (require 'cl))
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85888
diff changeset
33 (defvar tool-bar-map)
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85888
diff changeset
34 (defvar w3m-minor-mode-map)
19521
6f6cf9184e93 Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents: 17493
diff changeset
35
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
36 (require 'gnus)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
37 ;; Avoid the "Recursive load suspected" error in Emacs 21.1.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
38 (eval-and-compile
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
39 (let ((recursive-load-depth-limit 100))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
40 (require 'gnus-sum)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
41 (require 'gnus-spec)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
42 (require 'gnus-int)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
43 (require 'gnus-win)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
44 (require 'mm-bodies)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
45 (require 'mail-parse)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
46 (require 'mm-decode)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
47 (require 'mm-view)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
48 (require 'wid-edit)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
49 (require 'mm-uu)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
50 (require 'message)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
51
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
52 (autoload 'gnus-msg-mail "gnus-msg" nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
53 (autoload 'gnus-button-mailto "gnus-msg")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
54 (autoload 'gnus-button-reply "gnus-msg" nil t)
61304
a1964e18a9ba Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-234
Miles Bader <miles@gnu.org>
parents: 60696
diff changeset
55 (autoload 'parse-time-string "parse-time" nil nil)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
56 (autoload 'ansi-color-apply-on-region "ansi-color")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
57 (autoload 'mm-url-insert-file-contents-external "mm-url")
69572
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
58 (autoload 'mm-extern-cache-contents "mm-extern")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
59
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
60 (defgroup gnus-article nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
61 "Article display."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
62 :link '(custom-manual "(gnus)Article Buffer")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
63 :group 'gnus)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
64
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
65 (defgroup gnus-article-treat nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
66 "Treating article parts."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
67 :link '(custom-manual "(gnus)Article Hiding")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
68 :group 'gnus-article)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
69
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
70 (defgroup gnus-article-hiding nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
71 "Hiding article parts."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
72 :link '(custom-manual "(gnus)Article Hiding")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
73 :group 'gnus-article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
74
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
75 (defgroup gnus-article-highlight nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
76 "Article highlighting."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
77 :link '(custom-manual "(gnus)Article Highlighting")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
78 :group 'gnus-article
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
79 :group 'gnus-visual)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
80
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
81 (defgroup gnus-article-signature nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
82 "Article signatures."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
83 :link '(custom-manual "(gnus)Article Signature")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
84 :group 'gnus-article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
85
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
86 (defgroup gnus-article-headers nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
87 "Article headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
88 :link '(custom-manual "(gnus)Hiding Headers")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
89 :group 'gnus-article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
90
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
91 (defgroup gnus-article-washing nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
92 "Special commands on articles."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
93 :link '(custom-manual "(gnus)Article Washing")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
94 :group 'gnus-article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
95
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
96 (defgroup gnus-article-emphasis nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
97 "Fontisizing articles."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
98 :link '(custom-manual "(gnus)Article Fontisizing")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
99 :group 'gnus-article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
100
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
101 (defgroup gnus-article-saving nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
102 "Saving articles."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
103 :link '(custom-manual "(gnus)Saving Articles")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
104 :group 'gnus-article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
105
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
106 (defgroup gnus-article-mime nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
107 "Worshiping the MIME wonder."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
108 :link '(custom-manual "(gnus)Using MIME")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
109 :group 'gnus-article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
110
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
111 (defgroup gnus-article-buttons nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
112 "Pushable buttons in the article buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
113 :link '(custom-manual "(gnus)Article Buttons")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
114 :group 'gnus-article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
115
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
116 (defgroup gnus-article-various nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
117 "Other article options."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
118 :link '(custom-manual "(gnus)Misc Article")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
119 :group 'gnus-article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
120
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
121 (defcustom gnus-ignored-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
122 (mapcar
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
123 (lambda (header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
124 (concat "^" header ":"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
125 '("Path" "Expires" "Date-Received" "References" "Xref" "Lines"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
126 "Relay-Version" "Message-ID" "Approved" "Sender" "Received"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
127 "X-UIDL" "MIME-Version" "Return-Path" "In-Reply-To"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
128 "Content-Type" "Content-Transfer-Encoding" "X-WebTV-Signature"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
129 "X-MimeOLE" "X-MSMail-Priority" "X-Priority" "X-Loop"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
130 "X-Authentication-Warning" "X-MIME-Autoconverted" "X-Face"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
131 "X-Attribution" "X-Originating-IP" "Delivered-To"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
132 "NNTP-[-A-Za-z]+" "Distribution" "X-no-archive" "X-Trace"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
133 "X-Complaints-To" "X-NNTP-Posting-Host" "X-Orig.*"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
134 "Abuse-Reports-To" "Cache-Post-Path" "X-Article-Creation-Date"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
135 "X-Poster" "X-Mail2News-Path" "X-Server-Date" "X-Cache"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
136 "Originator" "X-Problems-To" "X-Auth-User" "X-Post-Time"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
137 "X-Admin" "X-UID" "Resent-[-A-Za-z]+" "X-Mailing-List"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
138 "Precedence" "Original-[-A-Za-z]+" "X-filename" "X-Orcpt"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
139 "Old-Received" "X-Pgp" "X-Auth" "X-From-Line"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
140 "X-Gnus-Article-Number" "X-Majordomo" "X-Url" "X-Sender"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
141 "MBOX-Line" "Priority" "X400-[-A-Za-z]+"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
142 "Status" "X-Gnus-Mail-Source" "Cancel-Lock"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
143 "X-FTN" "X-EXP32-SerialNo" "Encoding" "Importance"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
144 "Autoforwarded" "Original-Encoded-Information-Types" "X-Ya-Pop3"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
145 "X-Face-Version" "X-Vms-To" "X-ML-NAME" "X-ML-COUNT"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
146 "Mailing-List" "X-finfo" "X-md5sum" "X-md5sum-Origin"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
147 "X-Sun-Charset" "X-Accept-Language" "X-Envelope-Sender"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
148 "List-[A-Za-z]+" "X-Listprocessor-Version"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
149 "X-Received" "X-Distribute" "X-Sequence" "X-Juno-Line-Breaks"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
150 "X-Notes-Item" "X-MS-TNEF-Correlator" "x-uunet-gateway"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
151 "X-Received" "Content-length" "X-precedence"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
152 "X-Authenticated-User" "X-Comment" "X-Report" "X-Abuse-Info"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
153 "X-HTTP-Proxy" "X-Mydeja-Info" "X-Copyright" "X-No-Markup"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
154 "X-Abuse-Info" "X-From_" "X-Accept-Language" "Errors-To"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
155 "X-BeenThere" "X-Mailman-Version" "List-Help" "List-Post"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
156 "List-Subscribe" "List-Id" "List-Unsubscribe" "List-Archive"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
157 "X-Content-length" "X-Posting-Agent" "Original-Received"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
158 "X-Request-PGP" "X-Fingerprint" "X-WRIEnvto" "X-WRIEnvfrom"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
159 "X-Virus-Scanned" "X-Delivery-Agent" "Posted-Date" "X-Gateway"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
160 "X-Local-Origin" "X-Local-Destination" "X-UserInfo1"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
161 "X-Received-Date" "X-Hashcash" "Face" "X-DMCA-Notifications"
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
162 "X-Abuse-and-DMCA-Info" "X-Postfilter" "X-Gpg-.*" "X-Disclaimer"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
163 "Envelope-To" "X-Spam-Score" "System-Type" "X-Injected-Via-Gmane"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
164 "X-Gmane-NNTP-Posting-Host" "Jabber-ID" "Archived-At"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
165 "Envelope-Sender" "Envelope-Recipients"))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
166 "*All headers that start with this regexp will be hidden.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
167 This variable can also be a list of regexps of headers to be ignored.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
168 If `gnus-visible-headers' is non-nil, this variable will be ignored."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
169 :type '(choice :custom-show nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
170 regexp
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
171 (repeat regexp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
172 :group 'gnus-article-hiding)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
173
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
174 (defcustom gnus-visible-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
175 "^From:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^Followup-To:\\|^Reply-To:\\|^Organization:\\|^Summary:\\|^Keywords:\\|^To:\\|^[BGF]?Cc:\\|^Posted-To:\\|^Mail-Copies-To:\\|^Mail-Followup-To:\\|^Apparently-To:\\|^Gnus-Warning:\\|^Resent-From:\\|^X-Sent:"
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
176 "*All headers that do not match this regexp will be hidden.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
177 This variable can also be a list of regexp of headers to remain visible.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
178 If this variable is non-nil, `gnus-ignored-headers' will be ignored."
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
179 :type '(choice
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
180 (repeat :value-to-internal (lambda (widget value)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
181 (custom-split-regexp-maybe value))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
182 :match (lambda (widget value)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
183 (or (stringp value)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
184 (widget-editable-list-match widget value)))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
185 regexp)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
186 (const :tag "Use gnus-ignored-headers" nil)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
187 regexp)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
188 :group 'gnus-article-hiding)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
189
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
190 (defcustom gnus-sorted-header-list
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
191 '("^From:" "^Subject:" "^Summary:" "^Keywords:" "^Newsgroups:"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
192 "^Followup-To:" "^To:" "^Cc:" "^Date:" "^Organization:")
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
193 "*This variable is a list of regular expressions.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
194 If it is non-nil, headers that match the regular expressions will
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
195 be placed first in the article buffer in the sequence specified by
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
196 this list."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
197 :type '(repeat regexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
198 :group 'gnus-article-hiding)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
199
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
200 (defcustom gnus-boring-article-headers '(empty followup-to reply-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
201 "Headers that are only to be displayed if they have interesting data.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
202 Possible values in this list are:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
203
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
204 'empty Headers with no content.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
205 'newsgroups Newsgroup identical to Gnus group.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
206 'to-address To identical to To-address.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
207 'to-list To identical to To-list.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
208 'cc-list CC identical to To-list.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
209 'followup-to Followup-to identical to Newsgroups.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
210 'reply-to Reply-to identical to From.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
211 'date Date less than four days old.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
212 'long-to To and/or Cc longer than 1024 characters.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
213 'many-to Multiple To and/or Cc."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
214 :type '(set (const :tag "Headers with no content." empty)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
215 (const :tag "Newsgroups identical to Gnus group." newsgroups)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
216 (const :tag "To identical to To-address." to-address)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
217 (const :tag "To identical to To-list." to-list)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
218 (const :tag "CC identical to To-list." cc-list)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
219 (const :tag "Followup-to identical to Newsgroups." followup-to)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
220 (const :tag "Reply-to identical to From." reply-to)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
221 (const :tag "Date less than four days old." date)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
222 (const :tag "To and/or Cc longer than 1024 characters." long-to)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
223 (const :tag "Multiple To and/or Cc headers." many-to))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
224 :group 'gnus-article-hiding)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
225
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
226 (defcustom gnus-article-skip-boring nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
227 "Skip over text that is not worth reading.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
228 By default, if you set this t, then Gnus will display citations and
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
229 signatures, but will never scroll down to show you a page consisting
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
230 only of boring text. Boring text is controlled by
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
231 `gnus-article-boring-faces'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
232 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
233 :type 'boolean
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
234 :group 'gnus-article-hiding)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
235
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
236 (defcustom gnus-signature-separator '("^-- $" "^-- *$")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
237 "Regexp matching signature separator.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
238 This can also be a list of regexps. In that case, it will be checked
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
239 from head to tail looking for a separator. Searches will be done from
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
240 the end of the buffer."
67643
1c477099d3ac Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents: 67418
diff changeset
241 :type '(choice :format "%{%t%}: %[Value Menu%]\n%v"
1c477099d3ac Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents: 67418
diff changeset
242 (regexp)
1c477099d3ac Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents: 67418
diff changeset
243 (repeat :tag "List of regexp" regexp))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
244 :group 'gnus-article-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
245
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
246 (defcustom gnus-signature-limit nil
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
247 "Provide a limit to what is considered a signature.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
248 If it is a number, no signature may not be longer (in characters) than
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
249 that number. If it is a floating point number, no signature may be
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
250 longer (in lines) than that number. If it is a function, the function
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
251 will be called without any parameters, and if it returns nil, there is
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
252 no signature in the buffer. If it is a string, it will be used as a
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
253 regexp. If it matches, the text in question is not a signature.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
254
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
255 This can also be a list of the above values."
65342
c71b1b2d2d04 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-530
Miles Bader <miles@gnu.org>
parents: 65271
diff changeset
256 :type '(choice (const nil)
c71b1b2d2d04 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-530
Miles Bader <miles@gnu.org>
parents: 65271
diff changeset
257 (integer :value 200)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
258 (number :value 4.0)
75401
22f89b72ef50 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75347
diff changeset
259 function
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
260 (regexp :value ".*"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
261 :group 'gnus-article-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
262
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
263 (defcustom gnus-hidden-properties '(invisible t intangible t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
264 "Property list to use for hiding text."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
265 :type 'sexp
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
266 :group 'gnus-article-hiding)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
267
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
268 ;; Fixme: This isn't the right thing for mixed graphical and non-graphical
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
269 ;; frames in a session.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
270 (defcustom gnus-article-x-face-command
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
271 (if (featurep 'xemacs)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
272 (if (or (gnus-image-type-available-p 'xface)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
273 (gnus-image-type-available-p 'pbm))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
274 'gnus-display-x-face-in-from
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
275 "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | ee -")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
276 (if (gnus-image-type-available-p 'pbm)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
277 'gnus-display-x-face-in-from
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
278 "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | \
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
279 display -"))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
280 "*String or function to be executed to display an X-Face header.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
281 If it is a string, the command will be executed in a sub-shell
74151
a74b0c78f3ac (gnus-article-x-face-command, gnus-numeric-save-name):
Juanma Barranquero <lekktu@gmail.com>
parents: 73627
diff changeset
282 asynchronously. The compressed face will be piped to this command."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
283 :type `(choice string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
284 (function-item gnus-display-x-face-in-from)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
285 function)
35759
952c61f346ff (gnus-article-x-face-command)
Dave Love <fx@gnu.org>
parents: 35453
diff changeset
286 :version "21.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
287 :group 'gnus-picon
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
288 :group 'gnus-article-washing)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
289
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
290 (defcustom gnus-article-x-face-too-ugly nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
291 "Regexp matching posters whose face shouldn't be shown automatically."
23361
86b5dc6c12f5 (gnus-article-x-face-too-ugly): Fix type.
Karl Heuer <kwzh@gnu.org>
parents: 22584
diff changeset
292 :type '(choice regexp (const nil))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
293 :group 'gnus-article-washing)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
294
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
295 (defcustom gnus-article-banner-alist nil
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
296 "Banner alist for stripping.
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
297 For example,
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
298 ((egroups . \"^[ \\t\\n]*-------------------+\\\\( \\\\(e\\\\|Yahoo! \\\\)Groups Sponsor -+\\\\)?....\\n\\\\(.+\\n\\\\)+\"))"
33397
1c1159327046 (gnus-article-banner-alist)
Dave Love <fx@gnu.org>
parents: 33342
diff changeset
299 :version "21.1"
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
300 :type '(repeat (cons symbol regexp))
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
301 :group 'gnus-article-washing)
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
302
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
303 (gnus-define-group-parameter
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
304 banner
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
305 :variable-document
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
306 "Alist of regexps (to match group names) and banner."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
307 :variable-group gnus-article-washing
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
308 :parameter-type
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
309 '(choice :tag "Banner"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
310 :value nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
311 (const :tag "Remove signature" signature)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
312 (symbol :tag "Item in `gnus-article-banner-alist'" none)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
313 regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
314 (const :tag "None" nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
315 :parameter-document
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
316 "If non-nil, specify how to remove `banners' from articles.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
317
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
318 Symbol `signature' means to remove signatures delimited by
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
319 `gnus-signature-separator'. Any other symbol is used to look up a
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
320 regular expression to match the banner in `gnus-article-banner-alist'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
321 A string is used as a regular expression to match the banner
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
322 directly.")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
323
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
324 (defcustom gnus-article-address-banner-alist nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
325 "Alist of mail addresses and banners.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
326 Each element has the form (ADDRESS . BANNER), where ADDRESS is a regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
327 to match a mail address in the From: header, BANNER is one of a symbol
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
328 `signature', an item in `gnus-article-banner-alist', a regexp and nil.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
329 If ADDRESS matches author's mail address, it will remove things like
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
330 advertisements. For example:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
331
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
332 \((\"@yoo-hoo\\\\.co\\\\.jp\\\\'\" . \"\\n_+\\nDo You Yoo-hoo!\\\\?\\n.*\\n.*\\n\"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
333 "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
334 :type '(repeat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
335 (cons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
336 (regexp :tag "Address")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
337 (choice :tag "Banner" :value nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
338 (const :tag "Remove signature" signature)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
339 (symbol :tag "Item in `gnus-article-banner-alist'" none)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
340 regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
341 (const :tag "None" nil))))
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
342 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
343 :group 'gnus-article-washing)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
344
58147
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
345 (defmacro gnus-emphasis-custom-with-format (&rest body)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
346 `(let ((format "\
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
347 \\(\\s-\\|^\\|\\=\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
348 \\(\\([-,.;:!?\"]\\|\\s)\\)+\\s-\\|[?!.]\\s-\\|\\s)\\|\\s-\\)"))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
349 ,@body))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
350
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
351 (defun gnus-emphasis-custom-value-to-external (value)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
352 (gnus-emphasis-custom-with-format
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
353 (if (consp (car value))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
354 (list (format format (car (car value)) (cdr (car value)))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
355 2
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
356 (if (nth 1 value) 2 3)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
357 (nth 2 value))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
358 value)))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
359
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
360 (defun gnus-emphasis-custom-value-to-internal (value)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
361 (gnus-emphasis-custom-with-format
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
362 (let ((regexp (concat "\\`"
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
363 (format (regexp-quote format)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
364 "\\([^()]+\\)" "\\([^()]+\\)")
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
365 "\\'"))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
366 pattern)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
367 (if (string-match regexp (setq pattern (car value)))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
368 (list (cons (match-string 1 pattern) (match-string 2 pattern))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
369 (= (nth 2 value) 2)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
370 (nth 3 value))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
371 value))))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
372
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
373 (defcustom gnus-emphasis-alist
58147
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
374 (let ((types
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
375 '(("\\*" "\\*" bold nil 2)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
376 ("_" "_" underline)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
377 ("/" "/" italic)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
378 ("_/" "/_" underline-italic)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
379 ("_\\*" "\\*_" underline-bold)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
380 ("\\*/" "/\\*" bold-italic)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
381 ("_\\*/" "/\\*_" underline-bold-italic))))
58147
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
382 (nconc
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
383 (gnus-emphasis-custom-with-format
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
384 (mapcar (lambda (spec)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
385 (list (format format (car spec) (cadr spec))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
386 (or (nth 3 spec) 2)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
387 (or (nth 4 spec) 3)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
388 (intern (format "gnus-emphasis-%s" (nth 2 spec)))))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
389 types))
62978
c0f8b7d7e2ae (gnus-emphasis-alist): Disable the strikethru thingy.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 62943
diff changeset
390 '(;; I've never seen anyone use this strikethru convention whereas I've
c0f8b7d7e2ae (gnus-emphasis-alist): Disable the strikethru thingy.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 62943
diff changeset
391 ;; several times seen it triggered by normal text. --Stef
c0f8b7d7e2ae (gnus-emphasis-alist): Disable the strikethru thingy.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 62943
diff changeset
392 ;; Miles suggests that this form is sometimes used but for italics,
c0f8b7d7e2ae (gnus-emphasis-alist): Disable the strikethru thingy.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 62943
diff changeset
393 ;; so maybe we should map it to `italic'.
c0f8b7d7e2ae (gnus-emphasis-alist): Disable the strikethru thingy.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 62943
diff changeset
394 ;; ("\\(\\s-\\|^\\)\\(-\\(\\(\\w\\|-[^-]\\)+\\)-\\)\\(\\s-\\|[?!.,;]\\)"
c0f8b7d7e2ae (gnus-emphasis-alist): Disable the strikethru thingy.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 62943
diff changeset
395 ;; 2 3 gnus-emphasis-strikethru)
58147
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
396 ("\\(\\s-\\|^\\)\\(_\\(\\(\\w\\|_[^_]\\)+\\)_\\)\\(\\s-\\|[?!.,;]\\)"
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
397 2 3 gnus-emphasis-underline))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
398 "*Alist that says how to fontify certain phrases.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
399 Each item looks like this:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
400
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
401 (\"_\\\\(\\\\w+\\\\)_\" 0 1 'underline)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
402
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
403 The first element is a regular expression to be matched. The second
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
404 is a number that says what regular expression grouping used to find
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
405 the entire emphasized word. The third is a number that says what
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
406 regexp grouping should be displayed and highlighted. The fourth
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
407 is the face used for highlighting."
58147
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
408 :type
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
409 '(repeat
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
410 (menu-choice
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
411 :format "%[Customizing Style%]\n%v"
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
412 :indent 2
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
413 (group :tag "Default"
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
414 :value ("" 0 0 default)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
415 :value-create
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
416 (lambda (widget)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
417 (let ((value (widget-get
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
418 (cadr (widget-get (widget-get widget :parent)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
419 :args))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
420 :value)))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
421 (if (not (eq (nth 2 value) 'default))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
422 (widget-put
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
423 widget
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
424 :value
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
425 (gnus-emphasis-custom-value-to-external value))))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
426 (widget-group-value-create widget))
58835
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 58147
diff changeset
427 regexp
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 58147
diff changeset
428 (integer :format "Match group: %v")
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
429 (integer :format "Emphasize group: %v")
58147
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
430 face)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
431 (group :tag "Simple"
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
432 :value (("_" . "_") nil default)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
433 (cons :format "%v"
58835
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 58147
diff changeset
434 (regexp :format "Start regexp: %v")
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 58147
diff changeset
435 (regexp :format "End regexp: %v"))
58147
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
436 (boolean :format "Show start and end patterns: %[%v%]\n"
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
437 :on " On " :off " Off ")
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
438 face)))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
439 :get (lambda (symbol)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
440 (mapcar 'gnus-emphasis-custom-value-to-internal
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
441 (default-value symbol)))
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
442 :set (lambda (symbol value)
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
443 (set-default symbol (mapcar 'gnus-emphasis-custom-value-to-external
a46385598b7c Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Miles Bader <miles@gnu.org>
parents: 57923
diff changeset
444 value)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
445 :group 'gnus-article-emphasis)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
446
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
447 (defcustom gnus-emphasize-whitespace-regexp "^[ \t]+\\|[ \t]*\n"
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
448 "A regexp to describe whitespace which should not be emphasized.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
449 Typical values are \"^[ \\t]+\\\\|[ \\t]*\\n\" and \"[ \\t]+\\\\|[ \\t]*\\n\".
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
450 The former avoids underlining of leading and trailing whitespace,
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
451 and the latter avoids underlining any whitespace at all."
33397
1c1159327046 (gnus-article-banner-alist)
Dave Love <fx@gnu.org>
parents: 33342
diff changeset
452 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
453 :group 'gnus-article-emphasis
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
454 :type 'regexp)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
455
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
456 (defface gnus-emphasis-bold '((t (:bold t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
457 "Face used for displaying strong emphasized text (*word*)."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
458 :group 'gnus-article-emphasis)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
459
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
460 (defface gnus-emphasis-italic '((t (:italic t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
461 "Face used for displaying italic emphasized text (/word/)."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
462 :group 'gnus-article-emphasis)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
463
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
464 (defface gnus-emphasis-underline '((t (:underline t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
465 "Face used for displaying underlined emphasized text (_word_)."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
466 :group 'gnus-article-emphasis)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
467
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
468 (defface gnus-emphasis-underline-bold '((t (:bold t :underline t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
469 "Face used for displaying underlined bold emphasized text (_*word*_)."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
470 :group 'gnus-article-emphasis)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
471
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
472 (defface gnus-emphasis-underline-italic '((t (:italic t :underline t)))
25382
925a1c3dd62a (gnus-emphasis-underline-italic): Doc fix.
Andreas Schwab <schwab@suse.de>
parents: 24357
diff changeset
473 "Face used for displaying underlined italic emphasized text (_/word/_)."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
474 :group 'gnus-article-emphasis)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
475
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
476 (defface gnus-emphasis-bold-italic '((t (:bold t :italic t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
477 "Face used for displaying bold italic emphasized text (/*word*/)."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
478 :group 'gnus-article-emphasis)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
479
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
480 (defface gnus-emphasis-underline-bold-italic
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
481 '((t (:bold t :italic t :underline t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
482 "Face used for displaying underlined bold italic emphasized text.
48588
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 47569
diff changeset
483 Example: (_/*word*/_)."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
484 :group 'gnus-article-emphasis)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
485
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
486 (defface gnus-emphasis-strikethru (if (featurep 'xemacs)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
487 '((t (:strikethru t)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
488 '((t (:strike-through t))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
489 "Face used for displaying strike-through text (-word-)."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
490 :group 'gnus-article-emphasis)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
491
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
492 (defface gnus-emphasis-highlight-words
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
493 '((t (:background "black" :foreground "yellow")))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
494 "Face used for displaying highlighted words."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
495 :group 'gnus-article-emphasis)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
496
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
497 (defcustom gnus-article-time-format "%a, %d %b %Y %T %Z"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
498 "Format for display of Date headers in article bodies.
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
499 See `format-time-string' for the possible values.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
500
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
501 The variable can also be function, which should return a complete Date
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
502 header. The function is called with one argument, the time, which can
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
503 be fed to `format-time-string'."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
504 :type '(choice string function)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
505 :link '(custom-manual "(gnus)Article Date")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
506 :group 'gnus-article-washing)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
507
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
508 (defcustom gnus-save-all-headers t
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
509 "*If non-nil, don't remove any headers before saving.
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
510 This will be overridden by the `:headers' property that the symbol of
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
511 the saver function, which is specified by `gnus-default-article-saver',
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
512 might have."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
513 :group 'gnus-article-saving
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
514 :type 'boolean)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
515
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
516 (defcustom gnus-prompt-before-saving 'always
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
517 "*This variable says how much prompting is to be done when saving articles.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
518 If it is nil, no prompting will be done, and the articles will be
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
519 saved to the default files. If this variable is `always', each and
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
520 every article that is saved will be preceded by a prompt, even when
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
521 saving large batches of articles. If this variable is neither nil not
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
522 `always', there the user will be prompted once for a file name for
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
523 each invocation of the saving commands."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
524 :group 'gnus-article-saving
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
525 :type '(choice (item always)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
526 (item :tag "never" nil)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
527 (sexp :tag "once" :format "%t\n" :value t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
528
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
529 (defcustom gnus-saved-headers gnus-visible-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
530 "Headers to keep if `gnus-save-all-headers' is nil.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
531 If `gnus-save-all-headers' is non-nil, this variable will be ignored.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
532 If that variable is nil, however, all headers that match this regexp
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
533 will be kept while the rest will be deleted before saving. This and
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
534 `gnus-save-all-headers' will be overridden by the `:headers' property
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
535 that the symbol of the saver function, which is specified by
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
536 `gnus-default-article-saver', might have."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
537 :group 'gnus-article-saving
23361
86b5dc6c12f5 (gnus-article-x-face-too-ugly): Fix type.
Karl Heuer <kwzh@gnu.org>
parents: 22584
diff changeset
538 :type 'regexp)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
539
102026
55b8ba83f74b (rmail-output-to-rmail-file): Remove autoload added in previous change.
Glenn Morris <rgm@gnu.org>
parents: 102018
diff changeset
540 ;; Note that "Rmail format" is mbox since Emacs 23, but Babyl before.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
541 (defcustom gnus-default-article-saver 'gnus-summary-save-in-rmail
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
542 "A function to save articles in your favourite format.
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
543 The function will be called by way of the `gnus-summary-save-article'
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
544 command, and friends such as `gnus-summary-save-article-rmail'.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
545
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
546 Gnus provides the following functions:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
547
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
548 * gnus-summary-save-in-rmail (Rmail format)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
549 * gnus-summary-save-in-mail (Unix mail format)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
550 * gnus-summary-save-in-folder (MH folder)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
551 * gnus-summary-save-in-file (article format)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
552 * gnus-summary-save-body-in-file (article body)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
553 * gnus-summary-save-in-vm (use VM's folder format)
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
554 * gnus-summary-write-to-file (article format -- overwrite)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
555 * gnus-summary-write-body-to-file (article body -- overwrite)
96498
1f27a4bf06f5 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95586
diff changeset
556 * gnus-summary-save-in-pipe (article format)
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
557
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
558 The symbol of each function may have the following properties:
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
559
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
560 * :decode
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
561 The value non-nil means save decoded articles. This is meaningful
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
562 only with `gnus-summary-save-in-file', `gnus-summary-save-body-in-file',
96498
1f27a4bf06f5 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95586
diff changeset
563 `gnus-summary-write-to-file', `gnus-summary-write-body-to-file', and
1f27a4bf06f5 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95586
diff changeset
564 `gnus-summary-save-in-pipe'.
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
565
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
566 * :function
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
567 The value specifies an alternative function which appends, not
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
568 overwrites, articles to a file. This implies that when saving many
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
569 articles at a time, `gnus-prompt-before-saving' is bound to t and all
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
570 articles are saved in a single file. This is meaningful only with
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
571 `gnus-summary-write-to-file' and `gnus-summary-write-body-to-file'.
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
572
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
573 * :headers
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
574 The value specifies the symbol of a variable of which the value
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
575 specifies headers to be saved. If it is omitted,
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
576 `gnus-save-all-headers' and `gnus-saved-headers' control what
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
577 headers should be saved."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
578 :group 'gnus-article-saving
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
579 :type '(radio (function-item gnus-summary-save-in-rmail)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
580 (function-item gnus-summary-save-in-mail)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
581 (function-item gnus-summary-save-in-folder)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
582 (function-item gnus-summary-save-in-file)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
583 (function-item gnus-summary-save-body-in-file)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
584 (function-item gnus-summary-save-in-vm)
67418
28264c86d408 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-668
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
585 (function-item gnus-summary-write-to-file)
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
586 (function-item gnus-summary-write-body-to-file)
96498
1f27a4bf06f5 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95586
diff changeset
587 (function-item gnus-summary-save-in-pipe)
67418
28264c86d408 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-668
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
588 (function)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
589
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
590 (defcustom gnus-article-save-coding-system
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
591 (or (and (mm-coding-system-p 'utf-8) 'utf-8)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
592 (and (mm-coding-system-p 'iso-2022-7bit) 'iso-2022-7bit)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
593 (and (mm-coding-system-p 'emacs-mule) 'emacs-mule)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
594 (and (mm-coding-system-p 'escape-quoted) 'escape-quoted))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
595 "Coding system used to save decoded articles to a file.
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
596
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
597 The recommended coding systems are `utf-8', `iso-2022-7bit' and so on,
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
598 which can safely encode any characters in text. This is used by the
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
599 commands including:
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
600
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
601 * gnus-summary-save-article-file
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
602 * gnus-summary-save-article-body-file
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
603 * gnus-summary-write-article-file
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
604 * gnus-summary-write-article-body-file
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
605
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
606 and the functions to which you may set `gnus-default-article-saver':
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
607
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
608 * gnus-summary-save-in-file
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
609 * gnus-summary-save-body-in-file
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
610 * gnus-summary-write-to-file
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
611 * gnus-summary-write-body-to-file
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
612
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
613 Those commands and functions save just text displayed in the article
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
614 buffer to a file if the value of this variable is non-nil. Note that
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
615 buttonized MIME parts will be lost in a saved file in that case.
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
616 Otherwise, raw articles will be saved."
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
617 :group 'gnus-article-saving
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
618 :type `(choice
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
619 :format "%{%t%}:\n %[Value Menu%] %v"
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
620 (const :tag "Save raw articles" nil)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
621 ,@(delq nil
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
622 (mapcar
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
623 (lambda (arg) (if (mm-coding-system-p (nth 3 arg)) arg))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
624 '((const :tag "UTF-8" utf-8)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
625 (const :tag "iso-2022-7bit" iso-2022-7bit)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
626 (const :tag "Emacs internal" emacs-mule)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
627 (const :tag "escape-quoted" escape-quoted))))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
628 (symbol :tag "Coding system")))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
629
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
630 (defcustom gnus-rmail-save-name 'gnus-plain-save-name
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
631 "A function generating a file name to save articles in Rmail format.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
632 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
633 :group 'gnus-article-saving
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
634 :type 'function)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
635
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
636 (defcustom gnus-mail-save-name 'gnus-plain-save-name
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
637 "A function generating a file name to save articles in Unix mail format.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
638 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
639 :group 'gnus-article-saving
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
640 :type 'function)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
641
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
642 (defcustom gnus-folder-save-name 'gnus-folder-save-name
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
643 "A function generating a file name to save articles in MH folder.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
644 The function is called with NEWSGROUP, HEADERS, and optional LAST-FOLDER."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
645 :group 'gnus-article-saving
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
646 :type 'function)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
647
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
648 (defcustom gnus-file-save-name 'gnus-numeric-save-name
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
649 "A function generating a file name to save articles in article format.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
650 The function is called with NEWSGROUP, HEADERS, and optional
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
651 LAST-FILE."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
652 :group 'gnus-article-saving
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
653 :type 'function)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
654
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
655 (defcustom gnus-split-methods
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
656 '((gnus-article-archive-name)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
657 (gnus-article-nndoc-name))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
658 "*Variable used to suggest where articles are to be saved.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
659 For instance, if you would like to save articles related to Gnus in
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
660 the file \"gnus-stuff\", and articles related to VM in \"vm-stuff\",
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
661 you could set this variable to something like:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
662
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
663 '((\"^Subject:.*gnus\\|^Newsgroups:.*gnus\" \"gnus-stuff\")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
664 (\"^Subject:.*vm\\|^Xref:.*vm\" \"vm-stuff\"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
665
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
666 This variable is an alist where the key is the match and the
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
667 value is a list of possible files to save in if the match is
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
668 non-nil.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
669
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
670 If the match is a string, it is used as a regexp match on the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
671 article. If the match is a symbol, that symbol will be funcalled
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
672 from the buffer of the article to be saved with the newsgroup as the
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
673 parameter. If it is a list, it will be evaled in the same buffer.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
674
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
675 If this form or function returns a string, this string will be used as a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
676 possible file name; and if it returns a non-nil list, that list will be
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
677 used as possible file names."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
678 :group 'gnus-article-saving
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
679 :type '(repeat (choice (list :value (fun) function)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
680 (cons :value ("" "") regexp (repeat string))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
681 (sexp :value nil))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
682
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
683 (defcustom gnus-page-delimiter "^\^L"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
684 "*Regexp describing what to use as article page delimiters.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
685 The default value is \"^\^L\", which is a form linefeed at the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
686 beginning of a line."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
687 :type 'regexp
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
688 :group 'gnus-article-various)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
689
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
690 (defcustom gnus-article-mode-line-format "Gnus: %g [%w] %S%m"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
691 "*The format specification for the article mode line.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
692 See `gnus-summary-mode-line-format' for a closer description.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
693
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
694 The following additional specs are available:
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
695
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
696 %w The article washing status.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
697 %m The number of MIME parts in the article."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
698 :type 'string
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
699 :group 'gnus-article-various)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
700
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
701 (defcustom gnus-article-mode-hook nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
702 "*A hook for Gnus article mode."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
703 :type 'hook
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
704 :group 'gnus-article-various)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
705
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
706 (when (featurep 'xemacs)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
707 ;; Extracted from gnus-xmas-define in order to preserve user settings
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
708 (when (fboundp 'turn-off-scroll-in-place)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
709 (add-hook 'gnus-article-mode-hook 'turn-off-scroll-in-place))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
710 ;; Extracted from gnus-xmas-redefine in order to preserve user settings
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
711 (add-hook 'gnus-article-mode-hook 'gnus-xmas-article-menu-add))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
712
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
713 (defcustom gnus-article-menu-hook nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
714 "*Hook run after the creation of the article mode menu."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
715 :type 'hook
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
716 :group 'gnus-article-various)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
717
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
718 (defcustom gnus-article-prepare-hook nil
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
719 "*A hook called after an article has been prepared in the article buffer."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
720 :type 'hook
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
721 :group 'gnus-article-various)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
722
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
723 (defcustom gnus-copy-article-ignored-headers nil
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
724 "List of headers to be removed when copying an article.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
725 Each element is a regular expression."
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 92306
diff changeset
726 :version "23.1" ;; No Gnus
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
727 :type '(repeat regexp)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
728 :group 'gnus-article-various)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
729
104700
9866b069527c * spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104692
diff changeset
730 (make-obsolete-variable 'gnus-article-hide-pgp-hook nil
9866b069527c * spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104692
diff changeset
731 "Gnus 5.10 (Emacs-22.1)")
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
732
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
733 (defface gnus-button
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
734 '((t (:weight bold)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
735 "Face used for highlighting a button in the article buffer."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
736 :group 'gnus-article-buttons)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
737
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
738 (defcustom gnus-article-button-face 'gnus-button
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
739 "Face used for highlighting buttons in the article buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
740
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
741 An article button is a piece of text that you can activate by pressing
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
742 `RET' or `mouse-2' above it."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
743 :type 'face
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
744 :group 'gnus-article-buttons)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
745
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
746 (defcustom gnus-article-mouse-face 'highlight
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
747 "Face used for mouse highlighting in the article buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
748
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
749 Article buttons will be displayed in this face when the cursor is
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
750 above them."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
751 :type 'face
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
752 :group 'gnus-article-buttons)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
753
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
754 (defcustom gnus-signature-face 'gnus-signature
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
755 "Face used for highlighting a signature in the article buffer.
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
756 Obsolete; use the face `gnus-signature' for customizations instead."
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
757 :type 'face
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
758 :group 'gnus-article-highlight
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
759 :group 'gnus-article-signature)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
760
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
761 (defface gnus-signature
32927
c0b62376988c (gnus-signature-face): Use italics on all terminals that support it.
Jason Rumney <jasonr@gnu.org>
parents: 32210
diff changeset
762 '((t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
763 (:italic t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
764 "Face used for highlighting a signature in the article buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
765 :group 'gnus-article-highlight
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
766 :group 'gnus-article-signature)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
767 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
768 (put 'gnus-signature-face 'face-alias 'gnus-signature)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 104700
diff changeset
769 (put 'gnus-signature-face 'obsolete-face "22.1")
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
770
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
771 (defface gnus-header-from
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
772 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
773 (background dark))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
774 (:foreground "PaleGreen1"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
775 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
776 (background light))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
777 (:foreground "red3"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
778 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
779 (:italic t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
780 "Face used for displaying from headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
781 :group 'gnus-article-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
782 :group 'gnus-article-highlight)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
783 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
784 (put 'gnus-header-from-face 'face-alias 'gnus-header-from)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 104700
diff changeset
785 (put 'gnus-header-from-face 'obsolete-face "22.1")
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
786
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
787 (defface gnus-header-subject
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
788 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
789 (background dark))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
790 (:foreground "SeaGreen1"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
791 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
792 (background light))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
793 (:foreground "red4"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
794 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
795 (:bold t :italic t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
796 "Face used for displaying subject headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
797 :group 'gnus-article-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
798 :group 'gnus-article-highlight)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
799 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
800 (put 'gnus-header-subject-face 'face-alias 'gnus-header-subject)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 104700
diff changeset
801 (put 'gnus-header-subject-face 'obsolete-face "22.1")
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
802
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
803 (defface gnus-header-newsgroups
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
804 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
805 (background dark))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
806 (:foreground "yellow" :italic t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
807 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
808 (background light))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
809 (:foreground "MidnightBlue" :italic t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
810 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
811 (:italic t)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
812 "Face used for displaying newsgroups headers.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
813 In the default setup this face is only used for crossposted
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
814 articles."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
815 :group 'gnus-article-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
816 :group 'gnus-article-highlight)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
817 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
818 (put 'gnus-header-newsgroups-face 'face-alias 'gnus-header-newsgroups)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 104700
diff changeset
819 (put 'gnus-header-newsgroups-face 'obsolete-face "22.1")
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
820
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
821 (defface gnus-header-name
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
822 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
823 (background dark))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
824 (:foreground "SpringGreen2"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
825 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
826 (background light))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
827 (:foreground "maroon"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
828 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
829 (:bold t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
830 "Face used for displaying header names."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
831 :group 'gnus-article-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
832 :group 'gnus-article-highlight)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
833 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
834 (put 'gnus-header-name-face 'face-alias 'gnus-header-name)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 104700
diff changeset
835 (put 'gnus-header-name-face 'obsolete-face "22.1")
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
836
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
837 (defface gnus-header-content
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
838 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
839 (background dark))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
840 (:foreground "SpringGreen1" :italic t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
841 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
842 (background light))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
843 (:foreground "indianred4" :italic t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
844 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
845 (:italic t))) "Face used for displaying header content."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
846 :group 'gnus-article-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
847 :group 'gnus-article-highlight)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
848 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
849 (put 'gnus-header-content-face 'face-alias 'gnus-header-content)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 104700
diff changeset
850 (put 'gnus-header-content-face 'obsolete-face "22.1")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
851
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
852 (defcustom gnus-header-face-alist
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
853 '(("From" nil gnus-header-from)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
854 ("Subject" nil gnus-header-subject)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
855 ("Newsgroups:.*," nil gnus-header-newsgroups)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
856 ("" gnus-header-name gnus-header-content))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
857 "*Controls highlighting of article headers.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
858
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
859 An alist of the form (HEADER NAME CONTENT).
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
860
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
861 HEADER is a regular expression which should match the name of a
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
862 header and NAME and CONTENT are either face names or nil.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
863
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
864 The name of each header field will be displayed using the face
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
865 specified by the first element in the list where HEADER matches
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
866 the header name and NAME is non-nil. Similarly, the content will
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
867 be displayed by the first non-nil matching CONTENT face."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
868 :group 'gnus-article-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
869 :group 'gnus-article-highlight
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
870 :type '(repeat (list (regexp :tag "Header")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
871 (choice :tag "Name"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
872 (item :tag "skip" nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
873 (face :value default))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
874 (choice :tag "Content"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
875 (item :tag "skip" nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
876 (face :value default)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
877
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
878 (defcustom gnus-face-properties-alist (if (featurep 'xemacs)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
879 '((xface . (:face gnus-x-face)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
880 '((pbm . (:face gnus-x-face))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
881 (png . nil)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
882 "Alist of image types and properties applied to Face and X-Face images.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
883 Here are examples:
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
884
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
885 ;; Specify the altitude of Face images in the From header.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
886 \(setq gnus-face-properties-alist
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
887 '((pbm . (:face gnus-x-face :ascent 80))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
888 (png . (:ascent 80))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
889
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
890 ;; Show Face images as pressed buttons.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
891 \(setq gnus-face-properties-alist
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
892 '((pbm . (:face gnus-x-face :relief -2))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
893 (png . (:relief -2))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
894
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
895 See the manual for the valid properties for various image types.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
896 Currently, `pbm' is used for X-Face images and `png' is used for Face
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
897 images in Emacs. Only the `:face' property is effective on the `xface'
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
898 image type in XEmacs if it is built with the libcompface library."
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 92306
diff changeset
899 :version "23.1" ;; No Gnus
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
900 :group 'gnus-article-headers
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
901 :type '(repeat (cons :format "%v" (symbol :tag "Image type") plist)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
902
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
903 (defcustom gnus-article-decode-hook
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
904 '(article-decode-charset article-decode-encoded-words
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
905 article-decode-group-name article-decode-idna-rhs)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
906 "*Hook run to decode charsets in articles."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
907 :group 'gnus-article-headers
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
908 :type 'hook)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
909
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
910 (defcustom gnus-display-mime-function 'gnus-display-mime
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
911 "Function to display MIME articles."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
912 :group 'gnus-article-mime
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
913 :type 'function)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
914
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
915 (defvar gnus-decode-header-function 'mail-decode-encoded-word-region
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
916 "Function used to decode headers.")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
917
72605
de654a6735da Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 71379
diff changeset
918 (defvar gnus-decode-address-function 'mail-decode-encoded-address-region
de654a6735da Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 71379
diff changeset
919 "Function used to decode addresses.")
de654a6735da Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 71379
diff changeset
920
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
921 (defvar gnus-article-dumbquotes-map
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
922 '(("\200" "EUR")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
923 ("\202" ",")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
924 ("\203" "f")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
925 ("\204" ",,")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
926 ("\205" "...")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
927 ("\213" "<")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
928 ("\214" "OE")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
929 ("\221" "`")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
930 ("\222" "'")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
931 ("\223" "``")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
932 ("\224" "\"")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
933 ("\225" "*")
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
934 ("\226" "-")
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
935 ("\227" "--")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
936 ("\230" "~")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
937 ("\231" "(TM)")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
938 ("\233" ">")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
939 ("\234" "oe")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
940 ("\264" "'"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
941 "Table for MS-to-Latin1 translation.")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
942
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
943 (defcustom gnus-ignored-mime-types nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
944 "List of MIME types that should be ignored by Gnus."
33397
1c1159327046 (gnus-article-banner-alist)
Dave Love <fx@gnu.org>
parents: 33342
diff changeset
945 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
946 :group 'gnus-article-mime
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
947 :type '(repeat regexp))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
948
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
949 (defcustom gnus-unbuttonized-mime-types '(".*/.*")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
950 "List of MIME types that should not be given buttons when rendered inline.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
951 See also `gnus-buttonized-mime-types' which may override this variable.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
952 This variable is only used when `gnus-inhibit-mime-unbuttonizing' is nil."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
953 :version "21.1"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
954 :group 'gnus-article-mime
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
955 :type '(repeat regexp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
956
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
957 (defcustom gnus-buttonized-mime-types nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
958 "List of MIME types that should be given buttons when rendered inline.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
959 If set, this variable overrides `gnus-unbuttonized-mime-types'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
960 To see e.g. security buttons you could set this to
67643
1c477099d3ac Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents: 67418
diff changeset
961 `(\"multipart/signed\")'. You could also add \"multipart/alternative\" to
1c477099d3ac Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents: 67418
diff changeset
962 this list to display radio buttons that allow you to choose one of two
1c477099d3ac Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents: 67418
diff changeset
963 media types those mails include. See also `mm-discouraged-alternatives'.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
964 This variable is only used when `gnus-inhibit-mime-unbuttonizing' is nil."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
965 :version "22.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
966 :group 'gnus-article-mime
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
967 :type '(repeat regexp))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
968
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
969 (defcustom gnus-inhibit-mime-unbuttonizing nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
970 "If non-nil, all MIME parts get buttons.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
971 When nil (the default value), then some MIME parts do not get buttons,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
972 as described by the variables `gnus-buttonized-mime-types' and
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
973 `gnus-unbuttonized-mime-types'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
974 :version "22.1"
62755
0d1a48b1ca68 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents: 62428
diff changeset
975 :group 'gnus-article-mime
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
976 :type 'boolean)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
977
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
978 (defcustom gnus-body-boundary-delimiter "_"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
979 "String used to delimit header and body.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
980 This variable is used by `gnus-article-treat-body-boundary' which can
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
981 be controlled by `gnus-treat-body-boundary'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
982 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
983 :group 'gnus-article-various
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
984 :type '(choice (item :tag "None" :value nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
985 string))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
986
64735
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
987 (defcustom gnus-picon-databases '("/usr/lib/picon" "/usr/local/faces"
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
988 "/usr/share/picons")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
989 "Defines the location of the faces database.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
990 For information on obtaining this database of pretty pictures, please
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
991 see http://www.cs.indiana.edu/picons/ftp/index.html"
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
992 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
993 :type '(repeat directory)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
994 :link '(url-link :tag "download"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
995 "http://www.cs.indiana.edu/picons/ftp/index.html")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
996 :link '(custom-manual "(gnus)Picons")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
997 :group 'gnus-picon)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
998
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
999 (defun gnus-picons-installed-p ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1000 "Say whether picons are installed on your machine."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1001 (let ((installed nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1002 (dolist (database gnus-picon-databases)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1003 (when (file-exists-p database)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1004 (setq installed t)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1005 installed))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1006
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1007 (defcustom gnus-article-mime-part-function nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1008 "Function called with a MIME handle as the argument.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1009 This is meant for people who want to do something automatic based
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1010 on parts -- for instance, adding Vcard info to a database."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1011 :group 'gnus-article-mime
65342
c71b1b2d2d04 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-530
Miles Bader <miles@gnu.org>
parents: 65271
diff changeset
1012 :type '(choice (const nil)
c71b1b2d2d04 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-530
Miles Bader <miles@gnu.org>
parents: 65271
diff changeset
1013 function))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1014
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1015 (defcustom gnus-mime-multipart-functions nil
33397
1c1159327046 (gnus-article-banner-alist)
Dave Love <fx@gnu.org>
parents: 33342
diff changeset
1016 "An alist of MIME types to functions to display them."
1c1159327046 (gnus-article-banner-alist)
Dave Love <fx@gnu.org>
parents: 33342
diff changeset
1017 :version "21.1"
1c1159327046 (gnus-article-banner-alist)
Dave Love <fx@gnu.org>
parents: 33342
diff changeset
1018 :group 'gnus-article-mime
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1019 :type '(repeat (cons :format "%v" (string :tag "MIME type") function)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1020
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1021 (defcustom gnus-article-date-lapsed-new-header nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1022 "Whether the X-Sent and Date headers can coexist.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1023 When using `gnus-treat-date-lapsed', the \"X-Sent:\" header will
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1024 either replace the old \"Date:\" header (if this variable is nil), or
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1025 be added below it (otherwise)."
33397
1c1159327046 (gnus-article-banner-alist)
Dave Love <fx@gnu.org>
parents: 33342
diff changeset
1026 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1027 :group 'gnus-article-headers
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1028 :type 'boolean)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1029
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1030 (defcustom gnus-article-mime-match-handle-function 'undisplayed-alternative
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1031 "Function called with a MIME handle as the argument.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1032 This is meant for people who want to view first matched part.
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
1033 For `undisplayed-alternative' (default), the first undisplayed
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
1034 part or alternative part is used. For `undisplayed', the first
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
1035 undisplayed part is used. For a function, the first part which
50851
629f8ae0c58f (gnus-article-mime-match-handle-function): Don't quote nil and t in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 49598
diff changeset
1036 the function return t is used. For nil, the first part is
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1037 used."
33397
1c1159327046 (gnus-article-banner-alist)
Dave Love <fx@gnu.org>
parents: 33342
diff changeset
1038 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1039 :group 'gnus-article-mime
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
1040 :type '(choice
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1041 (item :tag "first" :value nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1042 (item :tag "undisplayed" :value undisplayed)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
1043 (item :tag "undisplayed or alternative"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1044 :value undisplayed-alternative)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1045 (function)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1046
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1047 (defcustom gnus-mime-action-alist
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1048 '(("save to file" . gnus-mime-save-part)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1049 ("save and strip" . gnus-mime-save-part-and-strip)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1050 ("replace with file" . gnus-mime-replace-part)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1051 ("delete part" . gnus-mime-delete-part)
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1052 ("display as text" . gnus-mime-inline-part)
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1053 ("view the part" . gnus-mime-view-part)
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1054 ("pipe to command" . gnus-mime-pipe-part)
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1055 ("toggle display" . gnus-article-press-button)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1056 ("toggle display" . gnus-article-view-part-as-charset)
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1057 ("view as type" . gnus-mime-view-part-as-type)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1058 ("view internally" . gnus-mime-view-part-internally)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1059 ("view externally" . gnus-mime-view-part-externally))
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1060 "An alist of actions that run on the MIME attachment."
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1061 :group 'gnus-article-mime
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1062 :type '(repeat (cons (string :tag "name")
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1063 (function))))
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1064
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1065 (defcustom gnus-auto-select-part 1
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1066 "Advance to next MIME part when deleting or stripping parts.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1067
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1068 When 0, point will be placed on the same part as before. When
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1069 positive (negative), move point forward (backwards) this many
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1070 parts. When nil, redisplay article."
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 92306
diff changeset
1071 :version "23.1" ;; No Gnus
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1072 :group 'gnus-article-mime
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1073 :type '(choice (const nil :tag "Redisplay article.")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1074 (const 1 :tag "Next part.")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1075 (const 0 :tag "Current part.")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1076 integer))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1077
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1078 ;;;
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1079 ;;; The treatment variables
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1080 ;;;
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1081
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1082 (defvar gnus-part-display-hook nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1083 "Hook called on parts that are to receive treatment.")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1084
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1085 (defvar gnus-article-treat-custom
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1086 '(choice (const :tag "Off" nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1087 (const :tag "On" t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1088 (const :tag "Header" head)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1089 (const :tag "First" first)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1090 (const :tag "Last" last)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1091 (integer :tag "Less")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1092 (repeat :tag "Groups" regexp)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1093 (sexp :tag "Predicate")))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1094
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1095 (defvar gnus-article-treat-head-custom
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1096 '(choice (const :tag "Off" nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1097 (const :tag "Header" head)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1098
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1099 (defvar gnus-article-treat-types '("text/plain" "text/x-verbatim"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1100 "text/x-patch")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1101 "Parts to treat.")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1102
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1103 (defvar gnus-inhibit-treatment nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1104 "Whether to inhibit treatment.")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1105
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1106 (defcustom gnus-treat-highlight-signature '(or t (typep "text/x-vcard"))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1107 "Highlight the signature.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1108 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1109 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1110 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1111 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1112 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1113 (put 'gnus-treat-highlight-signature 'highlight t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1114
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1115 (defcustom gnus-treat-buttonize 100000
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1116 "Add buttons.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1117 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1118 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1119 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1120 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1121 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1122 (put 'gnus-treat-buttonize 'highlight t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1123
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1124 (defcustom gnus-treat-buttonize-head 'head
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1125 "Add buttons to the head.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1126 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1127 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1128 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1129 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1130 :type gnus-article-treat-head-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1131 (put 'gnus-treat-buttonize-head 'highlight t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1132
85809
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
1133 (defcustom gnus-treat-emphasize 50000
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1134 "Emphasize text.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1135 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1136 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1137 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1138 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1139 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1140 (put 'gnus-treat-emphasize 'highlight t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1141
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1142 (defcustom gnus-treat-strip-cr nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1143 "Remove carriage returns.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1144 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1145 predicate. See Info node `(gnus)Customizing Articles'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1146 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1147 :group 'gnus-article-treat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1148 :link '(custom-manual "(gnus)Customizing Articles")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1149 :type gnus-article-treat-custom)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1150
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1151 (defcustom gnus-treat-unsplit-urls nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1152 "Remove newlines from within URLs.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1153 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1154 predicate. See Info node `(gnus)Customizing Articles'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1155 :version "22.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1156 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1157 :link '(custom-manual "(gnus)Customizing Articles")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1158 :type gnus-article-treat-custom)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1159
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1160 (defcustom gnus-treat-leading-whitespace nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1161 "Remove leading whitespace in headers.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1162 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1163 predicate. See Info node `(gnus)Customizing Articles'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1164 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1165 :group 'gnus-article-treat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1166 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1167 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1168
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1169 (defcustom gnus-treat-hide-headers 'head
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1170 "Hide headers.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1171 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1172 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1173 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1174 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1175 :type gnus-article-treat-head-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1176
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1177 (defcustom gnus-treat-hide-boring-headers nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1178 "Hide boring headers.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1179 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1180 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1181 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1182 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1183 :type gnus-article-treat-head-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1184
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1185 (defcustom gnus-treat-hide-signature nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1186 "Hide the signature.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1187 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1188 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1189 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1190 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1191 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1192
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1193 (defcustom gnus-treat-fill-article nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1194 "Fill the article.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1195 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1196 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1197 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1198 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1199 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1200
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1201 (defcustom gnus-treat-hide-citation nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1202 "Hide cited text.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1203 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1204 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1205 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1206 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1207 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1208
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1209 (defcustom gnus-treat-hide-citation-maybe nil
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1210 "Hide cited text.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1211 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1212 predicate. See Info node `(gnus)Customizing Articles'."
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1213 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1214 :link '(custom-manual "(gnus)Customizing Articles")
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1215 :type gnus-article-treat-custom)
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
1216
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1217 (defcustom gnus-treat-strip-list-identifiers 'head
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1218 "Strip list identifiers from `gnus-list-identifiers`.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1219 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1220 predicate. See Info node `(gnus)Customizing Articles'."
33397
1c1159327046 (gnus-article-banner-alist)
Dave Love <fx@gnu.org>
parents: 33342
diff changeset
1221 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1222 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1223 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1224 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1225
104700
9866b069527c * spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104692
diff changeset
1226 (make-obsolete-variable 'gnus-treat-strip-pgp nil
9866b069527c * spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104692
diff changeset
1227 "Gnus 5.10 (Emacs 22.1)")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1228
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1229 (defcustom gnus-treat-strip-pem nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1230 "Strip PEM signatures.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1231 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1232 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1233 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1234 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1235 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1236
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1237 (defcustom gnus-treat-strip-banner t
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1238 "Strip banners from articles.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1239 The banner to be stripped is specified in the `banner' group parameter.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1240 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1241 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1242 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1243 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1244 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1245
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1246 (defcustom gnus-treat-highlight-headers 'head
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1247 "Highlight the headers.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1248 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1249 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1250 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1251 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1252 :type gnus-article-treat-head-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1253 (put 'gnus-treat-highlight-headers 'highlight t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1254
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1255 (defcustom gnus-treat-highlight-citation t
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1256 "Highlight cited text.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1257 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1258 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1259 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1260 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1261 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1262 (put 'gnus-treat-highlight-citation 'highlight t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1263
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1264 (defcustom gnus-treat-date-ut nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1265 "Display the Date in UT (GMT).
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1266 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1267 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1268 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1269 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1270 :type gnus-article-treat-head-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1271
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1272 (defcustom gnus-treat-date-local nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1273 "Display the Date in the local timezone.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1274 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1275 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1276 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1277 :link '(custom-manual "(gnus)Customizing Articles")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1278 :type gnus-article-treat-head-custom)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1279
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1280 (defcustom gnus-treat-date-english nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1281 "Display the Date in a format that can be read aloud in English.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1282 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1283 predicate. See Info node `(gnus)Customizing Articles'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1284 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1285 :group 'gnus-article-treat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1286 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1287 :type gnus-article-treat-head-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1288
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1289 (defcustom gnus-treat-date-lapsed nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1290 "Display the Date header in a way that says how much time has elapsed.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1291 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1292 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1293 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1294 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1295 :type gnus-article-treat-head-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1296
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1297 (defcustom gnus-treat-date-original nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1298 "Display the date in the original timezone.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1299 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1300 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1301 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1302 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1303 :type gnus-article-treat-head-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1304
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1305 (defcustom gnus-treat-date-iso8601 nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1306 "Display the date in the ISO8601 format.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1307 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1308 predicate. See Info node `(gnus)Customizing Articles'."
33397
1c1159327046 (gnus-article-banner-alist)
Dave Love <fx@gnu.org>
parents: 33342
diff changeset
1309 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1310 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1311 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1312 :type gnus-article-treat-head-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1313
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1314 (defcustom gnus-treat-date-user-defined nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1315 "Display the date in a user-defined format.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1316 The format is defined by the `gnus-article-time-format' variable.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1317 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1318 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1319 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1320 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1321 :type gnus-article-treat-head-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1322
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1323 (defcustom gnus-treat-strip-headers-in-body t
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1324 "Strip the X-No-Archive header line from the beginning of the body.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1325 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1326 predicate. See Info node `(gnus)Customizing Articles'."
33397
1c1159327046 (gnus-article-banner-alist)
Dave Love <fx@gnu.org>
parents: 33342
diff changeset
1327 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1328 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1329 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1330 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1331
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1332 (defcustom gnus-treat-strip-trailing-blank-lines nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1333 "Strip trailing blank lines.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1334 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1335 predicate. See Info node `(gnus)Customizing Articles'.
66299
01b85ec4a61d Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-615
Miles Bader <miles@gnu.org>
parents: 65719
diff changeset
1336
01b85ec4a61d Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-615
Miles Bader <miles@gnu.org>
parents: 65719
diff changeset
1337 When set to t, it also strips trailing blanks in all MIME parts.
01b85ec4a61d Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-615
Miles Bader <miles@gnu.org>
parents: 65719
diff changeset
1338 Consider to use `last' instead."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1339 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1340 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1341 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1342
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1343 (defcustom gnus-treat-strip-leading-blank-lines nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1344 "Strip leading blank lines.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1345 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1346 predicate. See Info node `(gnus)Customizing Articles'.
66299
01b85ec4a61d Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-615
Miles Bader <miles@gnu.org>
parents: 65719
diff changeset
1347
01b85ec4a61d Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-615
Miles Bader <miles@gnu.org>
parents: 65719
diff changeset
1348 When set to t, it also strips trailing blanks in all MIME parts."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1349 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1350 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1351 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1352
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1353 (defcustom gnus-treat-strip-multiple-blank-lines nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1354 "Strip multiple blank lines.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1355 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1356 predicate. See Info node `(gnus)Customizing Articles'."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1357 :group 'gnus-article-treat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1358 :link '(custom-manual "(gnus)Customizing Articles")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1359 :type gnus-article-treat-custom)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1360
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1361 (defcustom gnus-treat-unfold-headers 'head
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1362 "Unfold folded header lines.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1363 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1364 predicate. See Info node `(gnus)Customizing Articles'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1365 :version "22.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1366 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1367 :link '(custom-manual "(gnus)Customizing Articles")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1368 :type gnus-article-treat-custom)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1369
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1370 (defcustom gnus-article-unfold-long-headers nil
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1371 "If non-nil, allow unfolding headers even if the header is long.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1372 If it is a regexp, only long headers matching this regexp are unfolded.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1373 If it is t, all long headers are unfolded.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1374
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1375 This variable has no effect if `gnus-treat-unfold-headers' is nil."
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 92306
diff changeset
1376 :version "23.1" ;; No Gnus
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1377 :group 'gnus-article-treat
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1378 :type '(choice (const nil)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1379 (const :tag "all" t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1380 (regexp)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1381
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1382 (defcustom gnus-treat-fold-headers nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1383 "Fold headers.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1384 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1385 predicate. See Info node `(gnus)Customizing Articles'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1386 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1387 :group 'gnus-article-treat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1388 :link '(custom-manual "(gnus)Customizing Articles")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1389 :type gnus-article-treat-custom)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1390
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1391 (defcustom gnus-treat-fold-newsgroups 'head
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1392 "Fold the Newsgroups and Followup-To headers.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1393 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1394 predicate. See Info node `(gnus)Customizing Articles'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1395 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1396 :group 'gnus-article-treat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1397 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1398 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1399
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1400 (defcustom gnus-treat-overstrike t
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1401 "Treat overstrike highlighting.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1402 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1403 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1404 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1405 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1406 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1407 (put 'gnus-treat-overstrike 'highlight t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1408
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1409 (defcustom gnus-treat-ansi-sequences (if (locate-library "ansi-color") t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1410 "Treat ANSI SGR control sequences.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1411 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1412 predicate. See Info node `(gnus)Customizing Articles'."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1413 :group 'gnus-article-treat
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1414 :link '(custom-manual "(gnus)Customizing Articles")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1415 :type gnus-article-treat-custom)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1416
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1417 (make-obsolete-variable 'gnus-treat-display-xface
104700
9866b069527c * spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104692
diff changeset
1418 'gnus-treat-display-x-face "22.1")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1419
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1420 (defcustom gnus-treat-display-x-face
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1421 (and (not noninteractive)
74984
21f28d10d73a Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 74151
diff changeset
1422 (gnus-image-type-available-p 'xbm)
21f28d10d73a Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 74151
diff changeset
1423 (if (featurep 'xemacs)
21f28d10d73a Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 74151
diff changeset
1424 (featurep 'xface)
107217
27eb4f088075 (gnus-treat-display-x-face): Protect against errors (bug#5299).
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
1425 (condition-case nil
27eb4f088075 (gnus-treat-display-x-face): Protect against errors (bug#5299).
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
1426 (and (string-match "^0x" (shell-command-to-string "uncompface"))
27eb4f088075 (gnus-treat-display-x-face): Protect against errors (bug#5299).
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
1427 (executable-find "icontopbm"))
27eb4f088075 (gnus-treat-display-x-face): Protect against errors (bug#5299).
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
1428 ;; shell-command-to-string may signal an error, e.g. if
27eb4f088075 (gnus-treat-display-x-face): Protect against errors (bug#5299).
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
1429 ;; shell-file-name is not found.
27eb4f088075 (gnus-treat-display-x-face): Protect against errors (bug#5299).
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106815
diff changeset
1430 (error nil)))
31785
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
1431 'head)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1432 "Display X-Face headers.
76820
665998d6d5de Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75521
diff changeset
1433 Valid values are nil and `head'.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1434 See Info node `(gnus)Customizing Articles' and Info node
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1435 `(gnus)X-Face' for details."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1436 :group 'gnus-article-treat
35759
952c61f346ff (gnus-article-x-face-command)
Dave Love <fx@gnu.org>
parents: 35453
diff changeset
1437 :version "21.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1438 :link '(custom-manual "(gnus)Customizing Articles")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1439 :link '(custom-manual "(gnus)X-Face")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1440 :type gnus-article-treat-head-custom
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1441 :set (lambda (symbol value)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1442 (set-default
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1443 symbol
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1444 (cond ((or (boundp symbol) (get symbol 'saved-value))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1445 value)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1446 ((boundp 'gnus-treat-display-xface)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1447 (message "\
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1448 ** gnus-treat-display-xface is an obsolete variable;\
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1449 use gnus-treat-display-x-face instead")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1450 (default-value 'gnus-treat-display-xface))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1451 ((get 'gnus-treat-display-xface 'saved-value)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1452 (message "\
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1453 ** gnus-treat-display-xface is an obsolete variable;\
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1454 use gnus-treat-display-x-face instead")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1455 (eval (car (get 'gnus-treat-display-xface 'saved-value))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1456 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1457 value)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1458 (put 'gnus-treat-display-x-face 'highlight t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1459
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1460 (defcustom gnus-treat-display-face
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1461 (and (not noninteractive)
74984
21f28d10d73a Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 74151
diff changeset
1462 (gnus-image-type-available-p 'png)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1463 'head)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1464 "Display Face headers.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1465 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1466 predicate. See Info node `(gnus)Customizing Articles' and Info
100934
ba087903e9ba (gnus-treat-display-face): Fix docstring link to point to
Tassilo Horn <tassilo@member.fsf.org>
parents: 100908
diff changeset
1467 node `(gnus)Face' for details."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1468 :group 'gnus-article-treat
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1469 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1470 :link '(custom-manual "(gnus)Customizing Articles")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1471 :link '(custom-manual "(gnus)X-Face")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1472 :type gnus-article-treat-head-custom)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1473 (put 'gnus-treat-display-face 'highlight t)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1474
74984
21f28d10d73a Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 74151
diff changeset
1475 (defcustom gnus-treat-display-smileys (gnus-image-type-available-p 'xpm)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1476 "Display smileys.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1477 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1478 predicate. See Info node `(gnus)Customizing Articles' and Info
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1479 node `(gnus)Smileys' for details."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1480 :group 'gnus-article-treat
35759
952c61f346ff (gnus-article-x-face-command)
Dave Love <fx@gnu.org>
parents: 35453
diff changeset
1481 :version "21.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1482 :link '(custom-manual "(gnus)Customizing Articles")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1483 :link '(custom-manual "(gnus)Smileys")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1484 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1485 (put 'gnus-treat-display-smileys 'highlight t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1486
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1487 (defcustom gnus-treat-from-picon
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1488 (if (and (gnus-image-type-available-p 'xpm)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1489 (gnus-picons-installed-p))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1490 'head nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1491 "Display picons in the From header.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1492 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1493 predicate. See Info node `(gnus)Customizing Articles' and Info
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1494 node `(gnus)Picons' for details."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1495 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1496 :group 'gnus-article-treat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1497 :group 'gnus-picon
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1498 :link '(custom-manual "(gnus)Customizing Articles")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1499 :link '(custom-manual "(gnus)Picons")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1500 :type gnus-article-treat-head-custom)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1501 (put 'gnus-treat-from-picon 'highlight t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1502
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1503 (defcustom gnus-treat-mail-picon
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1504 (if (and (gnus-image-type-available-p 'xpm)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1505 (gnus-picons-installed-p))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1506 'head nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1507 "Display picons in To and Cc headers.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1508 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1509 predicate. See Info node `(gnus)Customizing Articles' and Info
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1510 node `(gnus)Picons' for details."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1511 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1512 :group 'gnus-article-treat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1513 :group 'gnus-picon
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1514 :link '(custom-manual "(gnus)Customizing Articles")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1515 :link '(custom-manual "(gnus)Picons")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1516 :type gnus-article-treat-head-custom)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1517 (put 'gnus-treat-mail-picon 'highlight t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1518
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1519 (defcustom gnus-treat-newsgroups-picon
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1520 (if (and (gnus-image-type-available-p 'xpm)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1521 (gnus-picons-installed-p))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1522 'head nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1523 "Display picons in the Newsgroups and Followup-To headers.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1524 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1525 predicate. See Info node `(gnus)Customizing Articles' and Info
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1526 node `(gnus)Picons' for details."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1527 :version "22.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1528 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1529 :group 'gnus-picon
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1530 :link '(custom-manual "(gnus)Customizing Articles")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1531 :link '(custom-manual "(gnus)Picons")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1532 :type gnus-article-treat-head-custom)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1533 (put 'gnus-treat-newsgroups-picon 'highlight t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1534
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1535 (defcustom gnus-treat-body-boundary
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1536 (if (or gnus-treat-newsgroups-picon
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1537 gnus-treat-mail-picon
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1538 gnus-treat-from-picon)
85809
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
1539 ;; If there's much decoration, the user might prefer a boundery.
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
1540 'head
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
1541 nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1542 "Draw a boundary at the end of the headers.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1543 Valid values are nil and `head'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1544 See Info node `(gnus)Customizing Articles' for details."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1545 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1546 :group 'gnus-article-treat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1547 :link '(custom-manual "(gnus)Customizing Articles")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1548 :type gnus-article-treat-head-custom)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1549
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1550 (defcustom gnus-treat-capitalize-sentences nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1551 "Capitalize sentence-starting words.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1552 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1553 predicate. See Info node `(gnus)Customizing Articles'."
33397
1c1159327046 (gnus-article-banner-alist)
Dave Love <fx@gnu.org>
parents: 33342
diff changeset
1554 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1555 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1556 :link '(custom-manual "(gnus)Customizing Articles")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1557 :type gnus-article-treat-custom)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1558
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1559 (defcustom gnus-treat-wash-html nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1560 "Format as HTML.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1561 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1562 predicate. See Info node `(gnus)Customizing Articles'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1563 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1564 :group 'gnus-article-treat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1565 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1566 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1567
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1568 (defcustom gnus-treat-fill-long-lines nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1569 "Fill long lines.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1570 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1571 predicate. See Info node `(gnus)Customizing Articles'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1572 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1573 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1574 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1575
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1576 (defcustom gnus-treat-play-sounds nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1577 "Play sounds.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1578 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1579 predicate. See Info node `(gnus)Customizing Articles'."
33397
1c1159327046 (gnus-article-banner-alist)
Dave Love <fx@gnu.org>
parents: 33342
diff changeset
1580 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1581 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1582 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1583 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1584
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1585 (defcustom gnus-treat-translate nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1586 "Translate articles from one language to another.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1587 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1588 predicate. See Info node `(gnus)Customizing Articles'."
33397
1c1159327046 (gnus-article-banner-alist)
Dave Love <fx@gnu.org>
parents: 33342
diff changeset
1589 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1590 :group 'gnus-article-treat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1591 :link '(custom-manual "(gnus)Customizing Articles")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1592 :type gnus-article-treat-custom)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1593
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1594 (defcustom gnus-treat-x-pgp-sig nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1595 "Verify X-PGP-Sig.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1596 To automatically treat X-PGP-Sig, set it to head.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1597 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1598 predicate. See Info node `(gnus)Customizing Articles'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1599 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1600 :group 'gnus-article-treat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1601 :group 'mime-security
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1602 :link '(custom-manual "(gnus)Customizing Articles")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1603 :type gnus-article-treat-custom)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1604
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1605 (defvar gnus-article-encrypt-protocol-alist
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1606 '(("PGP" . mml2015-self-encrypt)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1607
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1608 ;; Set to nil if more than one protocol added to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1609 ;; gnus-article-encrypt-protocol-alist.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1610 (defcustom gnus-article-encrypt-protocol "PGP"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1611 "The protocol used for encrypt articles.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1612 It is a string, such as \"PGP\". If nil, ask user."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1613 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1614 :type 'string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1615 :group 'mime-security)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1616
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1617 (defvar gnus-article-wash-function nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1618 "Function used for converting HTML into text.")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1619
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1620 (defcustom gnus-use-idna (and (condition-case nil (require 'idna) (file-error))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1621 (mm-coding-system-p 'utf-8)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1622 (executable-find idna-program))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1623 "Whether IDNA decoding of headers is used when viewing messages.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1624 This requires GNU Libidn, and by default only enabled if it is found."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1625 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1626 :group 'gnus-article-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1627 :type 'boolean)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1628
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1629 (defcustom gnus-article-over-scroll nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1630 "If non-nil, allow scrolling the article buffer even when there no more text."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
1631 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1632 :group 'gnus-article
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1633 :type 'boolean)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1634
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1635 ;;; Internal variables
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1636
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1637 (defvar gnus-english-month-names
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1638 '("January" "February" "March" "April" "May" "June" "July" "August"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1639 "September" "October" "November" "December"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1640
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1641 (defvar article-goto-body-goes-to-point-min-p nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1642 (defvar gnus-article-wash-types nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1643 (defvar gnus-article-emphasis-alist nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1644 (defvar gnus-article-image-alist nil)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1645
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1646 (defvar gnus-article-mime-handle-alist-1 nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1647 (defvar gnus-treatment-function-alist
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1648 '((gnus-treat-x-pgp-sig gnus-article-verify-x-pgp-sig)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1649 (gnus-treat-strip-banner gnus-article-strip-banner)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1650 (gnus-treat-strip-headers-in-body gnus-article-strip-headers-in-body)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1651 (gnus-treat-highlight-signature gnus-article-highlight-signature)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1652 (gnus-treat-buttonize gnus-article-add-buttons)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1653 (gnus-treat-fill-article gnus-article-fill-cited-article)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1654 (gnus-treat-fill-long-lines gnus-article-fill-long-lines)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1655 (gnus-treat-strip-cr gnus-article-remove-cr)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1656 (gnus-treat-unsplit-urls gnus-article-unsplit-urls)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1657 (gnus-treat-date-ut gnus-article-date-ut)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1658 (gnus-treat-date-local gnus-article-date-local)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1659 (gnus-treat-date-english gnus-article-date-english)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1660 (gnus-treat-date-original gnus-article-date-original)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1661 (gnus-treat-date-user-defined gnus-article-date-user)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1662 (gnus-treat-date-iso8601 gnus-article-date-iso8601)
65130
d2334ecd8eae Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-517
Miles Bader <miles@gnu.org>
parents: 64754
diff changeset
1663 (gnus-treat-date-lapsed gnus-article-date-lapsed)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1664 (gnus-treat-display-x-face gnus-article-display-x-face)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1665 (gnus-treat-display-face gnus-article-display-face)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1666 (gnus-treat-hide-headers gnus-article-maybe-hide-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1667 (gnus-treat-hide-boring-headers gnus-article-hide-boring-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1668 (gnus-treat-hide-signature gnus-article-hide-signature)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1669 (gnus-treat-strip-list-identifiers gnus-article-hide-list-identifiers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1670 (gnus-treat-leading-whitespace gnus-article-remove-leading-whitespace)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1671 (gnus-treat-strip-pem gnus-article-hide-pem)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1672 (gnus-treat-from-picon gnus-treat-from-picon)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1673 (gnus-treat-mail-picon gnus-treat-mail-picon)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1674 (gnus-treat-newsgroups-picon gnus-treat-newsgroups-picon)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1675 (gnus-treat-highlight-headers gnus-article-highlight-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1676 (gnus-treat-highlight-signature gnus-article-highlight-signature)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1677 (gnus-treat-strip-trailing-blank-lines
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1678 gnus-article-remove-trailing-blank-lines)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1679 (gnus-treat-strip-leading-blank-lines
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1680 gnus-article-strip-leading-blank-lines)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1681 (gnus-treat-strip-multiple-blank-lines
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1682 gnus-article-strip-multiple-blank-lines)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1683 (gnus-treat-overstrike gnus-article-treat-overstrike)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1684 (gnus-treat-ansi-sequences gnus-article-treat-ansi-sequences)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1685 (gnus-treat-unfold-headers gnus-article-treat-unfold-headers)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1686 (gnus-treat-fold-newsgroups gnus-article-treat-fold-newsgroups)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1687 (gnus-treat-fold-headers gnus-article-treat-fold-headers)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1688 (gnus-treat-buttonize-head gnus-article-add-buttons-to-head)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1689 (gnus-treat-display-smileys gnus-treat-smiley)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1690 (gnus-treat-capitalize-sentences gnus-article-capitalize-sentences)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1691 (gnus-treat-wash-html gnus-article-wash-html)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1692 (gnus-treat-emphasize gnus-article-emphasize)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1693 (gnus-treat-hide-citation gnus-article-hide-citation)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1694 (gnus-treat-hide-citation-maybe gnus-article-hide-citation-maybe)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1695 (gnus-treat-highlight-citation gnus-article-highlight-citation)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1696 (gnus-treat-body-boundary gnus-article-treat-body-boundary)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1697 (gnus-treat-play-sounds gnus-earcon-display)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1698
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1699 (defvar gnus-article-mime-handle-alist nil)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
1700 (defvar article-lapsed-timer nil)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
1701 (defvar gnus-article-current-summary nil)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
1702
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1703 (defvar gnus-article-mode-syntax-table
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1704 (let ((table (copy-syntax-table text-mode-syntax-table)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1705 ;; This causes the citation match run O(2^n).
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1706 ;; (modify-syntax-entry ?- "w" table)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1707 (modify-syntax-entry ?> ")<" table)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1708 (modify-syntax-entry ?< "(>" table)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1709 ;; make M-. in article buffers work for `foo' strings
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1710 (modify-syntax-entry ?' " " table)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1711 (modify-syntax-entry ?` " " table)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1712 table)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1713 "Syntax table used in article mode buffers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1714 Initialized from `text-mode-syntax-table.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1715
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1716 (defvar gnus-save-article-buffer nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1717
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1718 (defvar gnus-number-of-articles-to-be-saved nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1719
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1720 (defvar gnus-inhibit-hiding nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1721
57265
cee5a9d8ee71 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-580
Miles Bader <miles@gnu.org>
parents: 57153
diff changeset
1722 (defvar gnus-article-edit-mode nil)
cee5a9d8ee71 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-580
Miles Bader <miles@gnu.org>
parents: 57153
diff changeset
1723
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1724 ;;; Macros for dealing with the article buffer.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1725
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1726 (defmacro gnus-with-article-headers (&rest forms)
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
1727 `(with-current-buffer gnus-article-buffer
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1728 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1729 (let ((inhibit-read-only t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1730 (inhibit-point-motion-hooks t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1731 (case-fold-search t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1732 (article-narrow-to-head)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1733 ,@forms))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1734
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1735 (put 'gnus-with-article-headers 'lisp-indent-function 0)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1736 (put 'gnus-with-article-headers 'edebug-form-spec '(body))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1737
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1738 (defmacro gnus-with-article-buffer (&rest forms)
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
1739 `(with-current-buffer gnus-article-buffer
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1740 (let ((inhibit-read-only t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1741 ,@forms)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1742
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1743 (put 'gnus-with-article-buffer 'lisp-indent-function 0)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1744 (put 'gnus-with-article-buffer 'edebug-form-spec '(body))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1745
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1746 (defun gnus-article-goto-header (header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1747 "Go to HEADER, which is a regular expression."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1748 (re-search-forward (concat "^\\(" header "\\):") nil t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1749
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1750 (defsubst gnus-article-hide-text (b e props)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1751 "Set text PROPS on the B to E region, extending `intangible' 1 past B."
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
1752 (gnus-add-text-properties-when 'article-type nil b e props)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1753 (when (memq 'intangible props)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1754 (put-text-property
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1755 (max (1- b) (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1756 b 'intangible (cddr (memq 'intangible props)))))
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
1757
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1758 (defsubst gnus-article-unhide-text (b e)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1759 "Remove hidden text properties from region between B and E."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1760 (remove-text-properties b e gnus-hidden-properties)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1761 (when (memq 'intangible gnus-hidden-properties)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1762 (put-text-property (max (1- b) (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1763 b 'intangible nil)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1764
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1765 (defun gnus-article-hide-text-type (b e type)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1766 "Hide text of TYPE between B and E."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1767 (gnus-add-wash-type type)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1768 (gnus-article-hide-text
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1769 b e (cons 'article-type (cons type gnus-hidden-properties))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1770
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1771 (defun gnus-article-unhide-text-type (b e type)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
1772 "Unhide text of TYPE between B and E."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1773 (gnus-delete-wash-type type)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1774 (remove-text-properties
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1775 b e (cons 'article-type (cons type gnus-hidden-properties)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1776 (when (memq 'intangible gnus-hidden-properties)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1777 (put-text-property (max (1- b) (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1778 b 'intangible nil)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1779
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1780 (defun gnus-article-hide-text-of-type (type)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1781 "Hide text of TYPE in the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1782 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1783 (let ((b (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1784 (e (point-max)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1785 (while (setq b (text-property-any b e 'article-type type))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1786 (add-text-properties b (incf b) gnus-hidden-properties)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1787
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1788 (defun gnus-article-delete-text-of-type (type)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1789 "Delete text of TYPE in the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1790 (save-excursion
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
1791 (let ((b (point-min)))
68129
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1792 (if (eq type 'multipart)
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1793 ;; Remove MIME buttons associated with multipart/alternative parts.
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1794 (progn
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1795 (goto-char b)
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1796 (while (if (get-text-property (point) 'gnus-part)
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1797 (setq b (point))
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1798 (when (setq b (next-single-property-change (point)
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1799 'gnus-part))
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1800 (goto-char b)
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1801 t))
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1802 (end-of-line)
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1803 (skip-chars-forward "\n")
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1804 (when (eq (get-text-property b 'article-type) 'multipart)
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1805 (delete-region b (point)))))
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1806 (while (setq b (text-property-any b (point-max) 'article-type type))
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1807 (delete-region
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1808 b (or (text-property-not-all b (point-max) 'article-type type)
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
1809 (point-max))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1810
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1811 (defun gnus-article-delete-invisible-text ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1812 "Delete all invisible text in the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1813 (save-excursion
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
1814 (let ((b (point-min)))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
1815 (while (setq b (text-property-any b (point-max) 'invisible t))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
1816 (delete-region
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
1817 b (or (text-property-not-all b (point-max) 'invisible t)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
1818 (point-max)))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1819
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1820 (defun gnus-article-text-type-exists-p (type)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1821 "Say whether any text of type TYPE exists in the buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1822 (text-property-any (point-min) (point-max) 'article-type type))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1823
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1824 (defsubst gnus-article-header-rank ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1825 "Give the rank of the string HEADER as given by `gnus-sorted-header-list'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1826 (let ((list gnus-sorted-header-list)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1827 (i 1))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1828 (while list
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1829 (if (looking-at (car list))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1830 (setq list nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1831 (setq list (cdr list))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1832 (incf i)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1833 i))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1834
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1835 (defun article-hide-headers (&optional arg delete)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1836 "Hide unwanted headers and possibly sort them as well."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1837 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1838 ;; This function might be inhibited.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1839 (unless gnus-inhibit-hiding
78546
28c0174177f4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 78369
diff changeset
1840 (let ((inhibit-read-only t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1841 (case-fold-search t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1842 (max (1+ (length gnus-sorted-header-list)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1843 (inhibit-point-motion-hooks t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1844 (cur (current-buffer))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1845 ignored visible beg)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1846 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1847 ;; `gnus-ignored-headers' and `gnus-visible-headers' may be
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1848 ;; group parameters, so we should go to the summary buffer.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1849 (when (prog1
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1850 (condition-case nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1851 (progn (set-buffer gnus-summary-buffer) t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1852 (error nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1853 (setq ignored (when (not gnus-visible-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1854 (cond ((stringp gnus-ignored-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1855 gnus-ignored-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1856 ((listp gnus-ignored-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1857 (mapconcat 'identity
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1858 gnus-ignored-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1859 "\\|"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1860 visible (cond ((stringp gnus-visible-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1861 gnus-visible-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1862 ((and gnus-visible-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1863 (listp gnus-visible-headers))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1864 (mapconcat 'identity
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1865 gnus-visible-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1866 "\\|")))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1867 (set-buffer cur))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1868 (save-restriction
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1869 ;; First we narrow to just the headers.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1870 (article-narrow-to-head)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1871 ;; Hide any "From " lines at the beginning of (mail) articles.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1872 (while (looking-at "From ")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1873 (forward-line 1))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1874 (unless (bobp)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1875 (delete-region (point-min) (point)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1876 ;; Then treat the rest of the header lines.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1877 ;; Then we use the two regular expressions
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1878 ;; `gnus-ignored-headers' and `gnus-visible-headers' to
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1879 ;; select which header lines is to remain visible in the
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1880 ;; article buffer.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1881 (while (re-search-forward "^[^ \t:]*:" nil t)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1882 (beginning-of-line)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1883 ;; Mark the rank of the header.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1884 (put-text-property
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1885 (point) (1+ (point)) 'message-rank
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1886 (if (or (and visible (looking-at visible))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1887 (and ignored
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1888 (not (looking-at ignored))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1889 (gnus-article-header-rank)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1890 (+ 2 max)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1891 (forward-line 1))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1892 (message-sort-headers-1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1893 (when (setq beg (text-property-any
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1894 (point-min) (point-max) 'message-rank (+ 2 max)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1895 ;; We delete the unwanted headers.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1896 (gnus-add-wash-type 'headers)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1897 (add-text-properties (point-min) (+ 5 (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1898 '(article-type headers dummy-invisible t))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1899 (delete-region beg (point-max))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1900
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1901 (defun article-hide-boring-headers (&optional arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1902 "Toggle hiding of headers that aren't very interesting.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1903 If given a negative prefix, always show; if given a positive prefix,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1904 always hide."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1905 (interactive (gnus-article-hidden-arg))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1906 (when (and (not (gnus-article-check-hidden-text 'boring-headers arg))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1907 (not gnus-show-all-headers))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1908 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1909 (save-restriction
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
1910 (let ((inhibit-read-only t)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1911 (inhibit-point-motion-hooks t))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1912 (article-narrow-to-head)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1913 (dolist (elem gnus-boring-article-headers)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1914 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1915 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1916 ;; Hide empty headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1917 ((eq elem 'empty)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
1918 (while (re-search-forward "^[^: \t]+:[ \t]*\n[^ \t]" nil t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1919 (forward-line -1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1920 (gnus-article-hide-text-type
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
1921 (point-at-bol)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1922 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1923 (end-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1924 (if (re-search-forward "^[^ \t]" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1925 (match-beginning 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1926 (point-max)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1927 'boring-headers)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1928 ;; Hide boring Newsgroups header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1929 ((eq elem 'newsgroups)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1930 (when (gnus-string-equal
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1931 (gnus-fetch-field "newsgroups")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1932 (gnus-group-real-name
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1933 (if (boundp 'gnus-newsgroup-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1934 gnus-newsgroup-name
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1935 "")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1936 (gnus-article-hide-header "newsgroups")))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1937 ((eq elem 'to-address)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1938 (let ((to (message-fetch-field "to"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1939 (to-address
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1940 (gnus-parameter-to-address
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1941 (if (boundp 'gnus-newsgroup-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1942 gnus-newsgroup-name ""))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1943 (when (and to to-address
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1944 (ignore-errors
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1945 (gnus-string-equal
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1946 ;; only one address in To
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1947 (nth 1 (mail-extract-address-components to))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1948 to-address)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1949 (gnus-article-hide-header "to"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1950 ((eq elem 'to-list)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1951 (let ((to (message-fetch-field "to"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1952 (to-list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1953 (gnus-parameter-to-list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1954 (if (boundp 'gnus-newsgroup-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1955 gnus-newsgroup-name ""))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1956 (when (and to to-list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1957 (ignore-errors
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1958 (gnus-string-equal
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1959 ;; only one address in To
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1960 (nth 1 (mail-extract-address-components to))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1961 to-list)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1962 (gnus-article-hide-header "to"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1963 ((eq elem 'cc-list)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1964 (let ((cc (message-fetch-field "cc"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1965 (to-list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1966 (gnus-parameter-to-list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1967 (if (boundp 'gnus-newsgroup-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1968 gnus-newsgroup-name ""))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1969 (when (and cc to-list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1970 (ignore-errors
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1971 (gnus-string-equal
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1972 ;; only one address in CC
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1973 (nth 1 (mail-extract-address-components cc))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1974 to-list)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1975 (gnus-article-hide-header "cc"))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1976 ((eq elem 'followup-to)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1977 (when (gnus-string-equal
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1978 (message-fetch-field "followup-to")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1979 (message-fetch-field "newsgroups"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1980 (gnus-article-hide-header "followup-to")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1981 ((eq elem 'reply-to)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1982 (if (gnus-group-find-parameter
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1983 gnus-newsgroup-name 'broken-reply-to)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1984 (gnus-article-hide-header "reply-to")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1985 (let ((from (message-fetch-field "from"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1986 (reply-to (message-fetch-field "reply-to")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1987 (when
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1988 (and
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1989 from reply-to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1990 (ignore-errors
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1991 (equal
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1992 (sort (mapcar
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1993 (lambda (x) (downcase (cadr x)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1994 (mail-extract-address-components from t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1995 'string<)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1996 (sort (mapcar
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1997 (lambda (x) (downcase (cadr x)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1998 (mail-extract-address-components reply-to t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
1999 'string<))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2000 (gnus-article-hide-header "reply-to")))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2001 ((eq elem 'date)
73627
e7c14a8e6688 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72673
diff changeset
2002 (let ((date (with-current-buffer gnus-original-article-buffer
e7c14a8e6688 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72673
diff changeset
2003 ;; If date in `gnus-article-buffer' is localized
e7c14a8e6688 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72673
diff changeset
2004 ;; (`gnus-treat-date-user-defined'),
e7c14a8e6688 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72673
diff changeset
2005 ;; `days-between' might fail.
e7c14a8e6688 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72673
diff changeset
2006 (message-fetch-field "date"))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2007 (when (and date
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2008 (< (days-between (current-time-string) date)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2009 4))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2010 (gnus-article-hide-header "date"))))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2011 ((eq elem 'long-to)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2012 (let ((to (message-fetch-field "to"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2013 (cc (message-fetch-field "cc")))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2014 (when (> (length to) 1024)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2015 (gnus-article-hide-header "to"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2016 (when (> (length cc) 1024)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2017 (gnus-article-hide-header "cc"))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2018 ((eq elem 'many-to)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2019 (let ((to-count 0)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2020 (cc-count 0))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2021 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2022 (while (re-search-forward "^to:" nil t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2023 (setq to-count (1+ to-count)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2024 (when (> to-count 1)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2025 (while (> to-count 0)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2026 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2027 (save-restriction
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2028 (re-search-forward "^to:" nil nil to-count)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2029 (forward-line -1)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2030 (narrow-to-region (point) (point-max))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2031 (gnus-article-hide-header "to"))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2032 (setq to-count (1- to-count))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2033 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2034 (while (re-search-forward "^cc:" nil t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2035 (setq cc-count (1+ cc-count)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2036 (when (> cc-count 1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2037 (while (> cc-count 0)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2038 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2039 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2040 (re-search-forward "^cc:" nil nil cc-count)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2041 (forward-line -1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2042 (narrow-to-region (point) (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2043 (gnus-article-hide-header "cc"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2044 (setq cc-count (1- cc-count)))))))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2045
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2046 (defun gnus-article-hide-header (header)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2047 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2048 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2049 (when (re-search-forward (concat "^" header ":") nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2050 (gnus-article-hide-text-type
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2051 (point-at-bol)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2052 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2053 (end-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2054 (if (re-search-forward "^[^ \t]" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2055 (match-beginning 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2056 (point-max)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2057 'boring-headers))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2058
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2059 (defvar gnus-article-normalized-header-length 40
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2060 "Length of normalized headers.")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2061
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2062 (defun article-normalize-headers ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2063 "Make all header lines 40 characters long."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2064 (interactive)
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
2065 (let ((inhibit-read-only t)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2066 column)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2067 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2068 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2069 (article-narrow-to-head)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2070 (while (not (eobp))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2071 (cond
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2072 ((< (setq column (- (point-at-eol) (point)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2073 gnus-article-normalized-header-length)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2074 (end-of-line)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2075 (insert (make-string
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2076 (- gnus-article-normalized-header-length column)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2077 ? )))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2078 ((> column gnus-article-normalized-header-length)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2079 (gnus-put-text-property
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2080 (progn
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2081 (forward-char gnus-article-normalized-header-length)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2082 (point))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2083 (point-at-eol)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2084 'invisible t))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2085 (t
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2086 ;; Do nothing.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2087 ))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2088 (forward-line 1))))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2089
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2090 (defun article-treat-dumbquotes ()
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2091 "Translate M****s*** sm*rtq**t*s and other symbols into proper text.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2092 Note that this function guesses whether a character is a sm*rtq**t* or
34818
2c66e24f2398 * gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34727
diff changeset
2093 not, so it should only be used interactively.
2c66e24f2398 * gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34727
diff changeset
2094
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2095 Sm*rtq**t*s are M****s***'s unilateral extension to the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2096 iso-8859-1 character map in an attempt to provide more quoting
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2097 characters. If you see something like \\222 or \\264 where
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2098 you're expecting some kind of apostrophe or quotation mark, then
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2099 try this wash."
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2100 (interactive)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2101 (article-translate-strings gnus-article-dumbquotes-map))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2102
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2103 (defun article-translate-characters (from to)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2104 "Translate all characters in the body of the article according to FROM and TO.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2105 FROM is a string of characters to translate from; to is a string of
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2106 characters to translate to."
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2107 (save-excursion
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2108 (when (article-goto-body)
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
2109 (let ((inhibit-read-only t)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2110 (x (make-string 225 ?x))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2111 (i -1))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2112 (while (< (incf i) (length x))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2113 (aset x i i))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2114 (setq i 0)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2115 (while (< i (length from))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2116 (aset x (aref from i) (aref to i))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2117 (incf i))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2118 (translate-region (point) (point-max) x)))))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
2119
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2120 (defun article-translate-strings (map)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2121 "Translate all string in the body of the article according to MAP.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2122 MAP is an alist where the elements are on the form (\"from\" \"to\")."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2123 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2124 (when (article-goto-body)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2125 (let ((inhibit-read-only t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2126 (dolist (elem map)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2127 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2128 (while (search-forward (car elem) nil t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2129 (replace-match (cadr elem)))))))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2130
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2131 (defun article-treat-overstrike ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2132 "Translate overstrikes into bold text."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2133 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2134 (save-excursion
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2135 (when (article-goto-body)
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
2136 (let ((inhibit-read-only t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2137 (while (search-forward "\b" nil t)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2138 (let ((next (char-after))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2139 (previous (char-after (- (point) 2))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2140 ;; We do the boldification/underlining by hiding the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2141 ;; overstrikes and putting the proper text property
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2142 ;; on the letters.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2143 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2144 ((eq next previous)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2145 (gnus-article-hide-text-type (- (point) 2) (point) 'overstrike)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2146 (put-text-property (point) (1+ (point)) 'face 'bold))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2147 ((eq next ?_)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2148 (gnus-article-hide-text-type
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2149 (1- (point)) (1+ (point)) 'overstrike)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2150 (put-text-property
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2151 (- (point) 2) (1- (point)) 'face 'underline))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2152 ((eq previous ?_)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2153 (gnus-article-hide-text-type (- (point) 2) (point) 'overstrike)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2154 (put-text-property
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2155 (point) (1+ (point)) 'face 'underline)))))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2156
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2157 (defun article-treat-ansi-sequences ()
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2158 "Translate ANSI SGR control sequences into overlays or extents."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2159 (interactive)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2160 (save-excursion
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2161 (when (article-goto-body)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2162 (let ((inhibit-read-only t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2163 (ansi-color-apply-on-region (point) (point-max))))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2164
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2165 (defun gnus-article-treat-unfold-headers ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2166 "Unfold folded message headers.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2167 Only the headers that fit into the current window width will be
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2168 unfolded."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2169 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2170 (gnus-with-article-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2171 (let (length)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2172 (while (not (eobp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2173 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2174 (mail-header-narrow-to-field)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2175 (let* ((header (buffer-string))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2176 (unfoldable
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2177 (or (equal gnus-article-unfold-long-headers t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2178 (and (stringp gnus-article-unfold-long-headers)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2179 (string-match gnus-article-unfold-long-headers header)))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2180 (with-temp-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2181 (insert header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2182 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2183 (while (re-search-forward "\n[\t ]" nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2184 (replace-match " " t t)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2185 (setq length (- (point-max) (point-min) 1))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2186 (when (or unfoldable
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2187 (< length (window-width)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2188 (while (re-search-forward "\n[\t ]" nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2189 (replace-match " " t t))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2190 (goto-char (point-max)))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2191
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2192 (defun gnus-article-treat-fold-headers ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2193 "Fold message headers."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2194 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2195 (gnus-with-article-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2196 (while (not (eobp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2197 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2198 (mail-header-narrow-to-field)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2199 (mail-header-fold-field)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2200 (goto-char (point-max))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2201
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2202 (defun gnus-treat-smiley ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2203 "Toggle display of textual emoticons (\"smileys\") as small graphical icons."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2204 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2205 (gnus-with-article-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2206 (if (memq 'smiley gnus-article-wash-types)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2207 (gnus-delete-images 'smiley)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2208 (article-goto-body)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2209 (let ((images (smiley-region (point) (point-max))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2210 (when images
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2211 (gnus-add-wash-type 'smiley)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2212 (dolist (image images)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2213 (gnus-add-image 'smiley image)))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2214
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2215 (defun gnus-article-remove-images ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2216 "Remove all images from the article buffer."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2217 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2218 (gnus-with-article-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2219 (dolist (elem gnus-article-image-alist)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2220 (gnus-delete-images (car elem)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2221
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2222 (defun gnus-article-treat-fold-newsgroups ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2223 "Unfold folded message headers.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2224 Only the headers that fit into the current window width will be
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2225 unfolded."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2226 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2227 (gnus-with-article-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2228 (while (gnus-article-goto-header "newsgroups\\|followup-to")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2229 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2230 (mail-header-narrow-to-field)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2231 (while (re-search-forward ", *" nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2232 (replace-match ", " t t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2233 (mail-header-fold-field)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2234 (goto-char (point-max))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2235
86340
7276bf307840 (gnus-article-truncate-lines): Use `truncate-lines'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86154
diff changeset
2236 (defcustom gnus-article-truncate-lines (default-value 'truncate-lines)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2237 "Value of `truncate-lines' in Gnus Article buffer.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2238 Valid values are nil, t, `head', `first', `last', an integer or a
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2239 predicate. See Info node `(gnus)Customizing Articles'."
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 92306
diff changeset
2240 :version "23.1" ;; No Gnus
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2241 :group 'gnus-article
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2242 ;; :link '(custom-manual "(gnus)Customizing Articles")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2243 :type 'boolean)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2244
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2245 (defun gnus-article-toggle-truncate-lines (&optional arg)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2246 "Toggle whether to fold or truncate long lines in article the buffer.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2247 If ARG is non-nil and not a number, toggle
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2248 `gnus-article-truncate-lines' too. If ARG is a number, truncate
94731
ceb867cd4907 (gnus-article-toggle-truncate-lines): Don't use `iff' in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 94662
diff changeset
2249 long lines if and only if arg is positive."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2250 (interactive "P")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2251 (cond
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2252 ((and (numberp arg) (> arg 0))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2253 (setq gnus-article-truncate-lines t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2254 ((numberp arg)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2255 (setq gnus-article-truncate-lines nil))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2256 (arg
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2257 (setq gnus-article-truncate-lines
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2258 (not gnus-article-truncate-lines))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2259 (gnus-with-article-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2260 (cond
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2261 ((and (numberp arg) (> arg 0))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2262 (setq truncate-lines nil))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2263 ((numberp arg)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2264 (setq truncate-lines t)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2265 ;; In versions of Emacs 22 (CVS) before 2006-05-26,
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2266 ;; `toggle-truncate-lines' needs an argument.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2267 (toggle-truncate-lines)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2268
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2269 (defun gnus-article-treat-body-boundary ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2270 "Place a boundary line at the end of the headers."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2271 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2272 (when (and gnus-body-boundary-delimiter
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2273 (> (length gnus-body-boundary-delimiter) 0))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2274 (gnus-with-article-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2275 (goto-char (point-max))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2276 (let ((start (point)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2277 (insert "X-Boundary: ")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2278 (gnus-add-text-properties start (point) '(invisible t intangible t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2279 (insert (let (str)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2280 (while (>= (1- (window-width)) (length str))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2281 (setq str (concat str gnus-body-boundary-delimiter)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2282 (substring str 0 (1- (window-width))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2283 "\n")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2284 (gnus-put-text-property start (point) 'gnus-decoration 'header)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2285
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2286 (defun article-fill-long-lines ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2287 "Fill lines that are wider than the window width."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2288 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2289 (save-excursion
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
2290 (let ((inhibit-read-only t)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2291 (width (window-width (get-buffer-window (current-buffer)))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2292 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2293 (article-goto-body)
43273
b8391c00e2c9 * gnus-art.el (gnus-article-edit-mode): Use define-derived-mode.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 43166
diff changeset
2294 (let ((adaptive-fill-mode nil)) ;Why? -sm
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2295 (while (not (eobp))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2296 (end-of-line)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2297 (when (>= (current-column) (min fill-column width))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2298 (narrow-to-region (min (1+ (point)) (point-max))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2299 (point-at-bol))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2300 (let ((goback (point-marker)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2301 (fill-paragraph nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2302 (goto-char (marker-position goback)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2303 (widen))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2304 (forward-line 1)))))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2305
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2306 (defun article-capitalize-sentences ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2307 "Capitalize the first word in each sentence."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2308 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2309 (save-excursion
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
2310 (let ((inhibit-read-only t)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2311 (paragraph-start "^[\n\^L]"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2312 (article-goto-body)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2313 (while (not (eobp))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2314 (capitalize-word 1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2315 (forward-sentence)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2316
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2317 (defun article-remove-cr ()
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2318 "Remove trailing CRs and then translate remaining CRs into LFs."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2319 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2320 (save-excursion
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
2321 (let ((inhibit-read-only t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2322 (goto-char (point-min))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2323 (while (re-search-forward "\r+$" nil t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2324 (replace-match "" t t))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2325 (goto-char (point-min))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2326 (while (search-forward "\r" nil t)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2327 (replace-match "\n" t t)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2328
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2329 (defun article-remove-trailing-blank-lines ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2330 "Remove all trailing blank lines from the article."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2331 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2332 (save-excursion
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
2333 (let ((inhibit-read-only t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2334 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2335 (delete-region
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2336 (point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2337 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2338 (while (and (not (bobp))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2339 (looking-at "^[ \t]*$")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2340 (not (gnus-annotation-in-region-p
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2341 (point) (point-at-eol))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2342 (forward-line -1))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2343 (forward-line 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2344 (point))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2345
86154
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85888
diff changeset
2346 (defvar gnus-face-properties-alist)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2347
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2348 (defun article-display-face (&optional force)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2349 "Display any Face headers in the header."
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2350 (interactive (list 'force))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2351 (let ((wash-face-p buffer-read-only))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2352 (gnus-with-article-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2353 ;; When displaying parts, this function can be called several times on
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2354 ;; the same article, without any intended toggle semantic (as typing `W
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2355 ;; D d' would have). So face deletion must occur only when we come from
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2356 ;; an interactive command, that is when the *Article* buffer is
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2357 ;; read-only.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2358 (if (and wash-face-p (memq 'face gnus-article-wash-types))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2359 (gnus-delete-images 'face)
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2360 (let ((from (message-fetch-field "from"))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2361 face faces)
63906
6e92df884ee6 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-464
Miles Bader <miles@gnu.org>
parents: 63873
diff changeset
2362 (save-current-buffer
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2363 (when (and wash-face-p
63906
6e92df884ee6 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-464
Miles Bader <miles@gnu.org>
parents: 63873
diff changeset
2364 (gnus-buffer-live-p gnus-original-article-buffer)
6e92df884ee6 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-464
Miles Bader <miles@gnu.org>
parents: 63873
diff changeset
2365 (not (re-search-forward "^Face:[\t ]*" nil t)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2366 (set-buffer gnus-original-article-buffer))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2367 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2368 (mail-narrow-to-head)
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2369 (when (or force
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2370 ;; Check whether this face is censored.
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2371 (not (and gnus-article-x-face-too-ugly
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2372 (or from
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2373 (setq from (message-fetch-field "from")))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2374 (string-match gnus-article-x-face-too-ugly
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2375 from))))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2376 (while (gnus-article-goto-header "Face")
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2377 (push (mail-header-field-value) faces)))))
63873
cf8b4d09b958 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-461
Miles Bader <miles@gnu.org>
parents: 63738
diff changeset
2378 (when faces
63906
6e92df884ee6 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-464
Miles Bader <miles@gnu.org>
parents: 63873
diff changeset
2379 (goto-char (point-min))
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2380 (let (png image)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2381 (unless (setq from (gnus-article-goto-header "from"))
63906
6e92df884ee6 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-464
Miles Bader <miles@gnu.org>
parents: 63873
diff changeset
2382 (insert "From:")
6e92df884ee6 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-464
Miles Bader <miles@gnu.org>
parents: 63873
diff changeset
2383 (setq from (point))
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2384 (insert " [no `from' set]\n"))
63906
6e92df884ee6 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-464
Miles Bader <miles@gnu.org>
parents: 63873
diff changeset
2385 (while faces
6e92df884ee6 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-464
Miles Bader <miles@gnu.org>
parents: 63873
diff changeset
2386 (when (setq png (gnus-convert-face-to-png (pop faces)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2387 (setq image
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2388 (apply 'gnus-create-image png 'png t
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2389 (cdr (assq 'png gnus-face-properties-alist))))
63873
cf8b4d09b958 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-461
Miles Bader <miles@gnu.org>
parents: 63738
diff changeset
2390 (goto-char from)
cf8b4d09b958 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-461
Miles Bader <miles@gnu.org>
parents: 63738
diff changeset
2391 (gnus-add-wash-type 'face)
cf8b4d09b958 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-461
Miles Bader <miles@gnu.org>
parents: 63738
diff changeset
2392 (gnus-add-image 'face image)
cf8b4d09b958 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-461
Miles Bader <miles@gnu.org>
parents: 63738
diff changeset
2393 (gnus-put-image image nil 'face))))))))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2394
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2395 (defun article-display-x-face (&optional force)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2396 "Look for an X-Face header and display it if present."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2397 (interactive (list 'force))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2398 (let ((wash-face-p buffer-read-only)) ;; When type `W f'
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2399 (gnus-with-article-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2400 ;; Delete the old process, if any.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2401 (when (process-status "article-x-face")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2402 (delete-process "article-x-face"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2403 ;; See the comment in `article-display-face'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2404 (if (and wash-face-p (memq 'xface gnus-article-wash-types))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2405 ;; We have already displayed X-Faces, so we remove them
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2406 ;; instead.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2407 (gnus-delete-images 'xface)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2408 ;; Display X-Faces.
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2409 (let ((from (message-fetch-field "from"))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2410 x-faces face)
63906
6e92df884ee6 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-464
Miles Bader <miles@gnu.org>
parents: 63873
diff changeset
2411 (save-current-buffer
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2412 (when (and wash-face-p
63906
6e92df884ee6 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-464
Miles Bader <miles@gnu.org>
parents: 63873
diff changeset
2413 (gnus-buffer-live-p gnus-original-article-buffer)
6e92df884ee6 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-464
Miles Bader <miles@gnu.org>
parents: 63873
diff changeset
2414 (not (re-search-forward "^X-Face:[\t ]*" nil t)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2415 ;; If type `W f', use gnus-original-article-buffer,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2416 ;; otherwise use the current buffer because displaying
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2417 ;; RFC822 parts calls this function too.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2418 (set-buffer gnus-original-article-buffer))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2419 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2420 (mail-narrow-to-head)
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2421 (and gnus-article-x-face-command
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2422 (or force
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2423 ;; Check whether this face is censored.
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2424 (not (and gnus-article-x-face-too-ugly
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2425 (or from
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2426 (setq from (message-fetch-field "from")))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2427 (string-match gnus-article-x-face-too-ugly
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2428 from))))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2429 (while (gnus-article-goto-header "X-Face")
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2430 (push (mail-header-field-value) x-faces)))))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2431 (when x-faces
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2432 ;; We display the face.
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2433 (cond ((functionp gnus-article-x-face-command)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2434 ;; The command is a lisp function, so we call it.
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2435 (mapc gnus-article-x-face-command x-faces))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2436 ((stringp gnus-article-x-face-command)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2437 ;; The command is a string, so we interpret the command
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2438 ;; as a, well, command, and fork it off.
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2439 (let ((process-connection-type nil))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2440 (gnus-set-process-query-on-exit-flag
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2441 (start-process
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2442 "article-x-face" nil shell-file-name
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2443 shell-command-switch gnus-article-x-face-command)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2444 nil)
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2445 ;; Sending multiple EOFs to xv doesn't work,
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2446 ;; so we only do a single external face.
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2447 (with-temp-buffer
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2448 (insert (car x-faces))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2449 (process-send-region "article-x-face"
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2450 (point-min) (point-max)))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2451 (process-send-eof "article-x-face")))
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2452 (t
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2453 (error "`%s' set to `%s' is not a function"
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2454 gnus-article-x-face-command
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86340
diff changeset
2455 'gnus-article-x-face-command)))))))))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
2456
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2457 (defun article-decode-mime-words ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2458 "Decode all MIME-encoded words in the article."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2459 (interactive)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2460 (gnus-with-article-buffer
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2461 (let ((inhibit-point-motion-hooks t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2462 (mail-parse-charset gnus-newsgroup-charset)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
2463 (mail-parse-ignored-charsets
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2464 (with-current-buffer gnus-summary-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2465 gnus-newsgroup-ignored-charsets)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2466 (mail-decode-encoded-word-region (point-min) (point-max)))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2467
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2468 (defun article-decode-charset (&optional prompt)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2469 "Decode charset-encoded text in the article.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2470 If PROMPT (the prefix), prompt for a coding system to use."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2471 (interactive "P")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2472 (let ((inhibit-point-motion-hooks t) (case-fold-search t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2473 (inhibit-read-only t)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2474 (mail-parse-charset gnus-newsgroup-charset)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
2475 (mail-parse-ignored-charsets
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2476 (save-excursion (condition-case nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2477 (set-buffer gnus-summary-buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2478 (error))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2479 gnus-newsgroup-ignored-charsets))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2480 ct cte ctl charset format)
68720
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2481 (save-excursion
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2482 (save-restriction
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2483 (article-narrow-to-head)
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2484 (setq ct (message-fetch-field "Content-Type" t)
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2485 cte (message-fetch-field "Content-Transfer-Encoding" t)
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2486 ctl (and ct (mail-header-parse-content-type ct))
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2487 charset (cond
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2488 (prompt
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2489 (mm-read-coding-system "Charset to decode: "))
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2490 (ctl
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2491 (mail-content-type-get ctl 'charset)))
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2492 format (and ctl (mail-content-type-get ctl 'format)))
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2493 (when cte
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2494 (setq cte (mail-header-strip cte)))
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2495 (if (and ctl (not (string-match "/" (car ctl))))
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2496 (setq ctl nil))
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2497 (goto-char (point-max)))
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2498 (forward-line 1)
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2499 (save-restriction
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2500 (narrow-to-region (point) (point-max))
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2501 (when (and (eq mail-parse-charset 'gnus-decoded)
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2502 (eq (mm-body-7-or-8) '8bit))
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2503 ;; The text code could have been decoded.
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2504 (setq charset mail-parse-charset))
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2505 (when (and (or (not ctl)
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2506 (equal (car ctl) "text/plain"))
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2507 (not format)) ;; article with format will decode later.
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2508 (mm-decode-body
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2509 charset (and cte (intern (downcase
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2510 (gnus-strip-whitespace cte))))
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2511 (car ctl)))))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2512
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2513 (defun article-decode-encoded-words ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2514 "Remove encoded-word encoding from headers."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2515 (let ((inhibit-point-motion-hooks t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2516 (mail-parse-charset gnus-newsgroup-charset)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
2517 (mail-parse-ignored-charsets
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2518 (save-excursion (condition-case nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2519 (set-buffer gnus-summary-buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2520 (error))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2521 gnus-newsgroup-ignored-charsets))
72605
de654a6735da Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 71379
diff changeset
2522 (inhibit-read-only t)
72653
87c011891481 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72605
diff changeset
2523 end start)
87c011891481 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72605
diff changeset
2524 (goto-char (point-min))
87c011891481 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72605
diff changeset
2525 (when (search-forward "\n\n" nil 'move)
87c011891481 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72605
diff changeset
2526 (forward-line -1))
87c011891481 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72605
diff changeset
2527 (setq end (point))
87c011891481 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72605
diff changeset
2528 (while (not (bobp))
87c011891481 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72605
diff changeset
2529 (while (progn
87c011891481 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72605
diff changeset
2530 (forward-line -1)
87c011891481 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72605
diff changeset
2531 (and (not (bobp))
87c011891481 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72605
diff changeset
2532 (memq (char-after) '(?\t ? )))))
87c011891481 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72605
diff changeset
2533 (setq start (point))
87c011891481 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72605
diff changeset
2534 (if (looking-at "\
72605
de654a6735da Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 71379
diff changeset
2535 \\(?:Resent-\\)?\\(?:From\\|Cc\\|To\\|Bcc\\|\\(?:In-\\)?Reply-To\\|Sender\
de654a6735da Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 71379
diff changeset
2536 \\|Mail-Followup-To\\|Mail-Copies-To\\|Approved\\):")
72653
87c011891481 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72605
diff changeset
2537 (funcall gnus-decode-address-function start end)
87c011891481 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72605
diff changeset
2538 (funcall gnus-decode-header-function start end))
87c011891481 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72605
diff changeset
2539 (goto-char (setq end start)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2540
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2541 (defun article-decode-group-name ()
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2542 "Decode group names in Newsgroups, Followup-To and Xref headers."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2543 (let ((inhibit-point-motion-hooks t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2544 (inhibit-read-only t)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2545 (method (gnus-find-method-for-group gnus-newsgroup-name))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2546 regexp)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2547 (when (and (or gnus-group-name-charset-method-alist
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2548 gnus-group-name-charset-group-alist)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2549 (gnus-buffer-live-p gnus-original-article-buffer))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2550 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2551 (article-narrow-to-head)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2552 (dolist (header '("Newsgroups" "Followup-To" "Xref"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2553 (with-current-buffer gnus-original-article-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2554 (goto-char (point-min)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2555 (setq regexp (concat "^" header
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2556 ":\\([^\n]*\\(?:\n[\t ]+[^\n]+\\)*\\)\n"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2557 (while (re-search-forward regexp nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2558 (replace-match (save-match-data
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2559 (gnus-decode-newsgroups
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2560 ;; XXX how to use data in article buffer?
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2561 (with-current-buffer gnus-original-article-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2562 (re-search-forward regexp nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2563 (match-string 1))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2564 gnus-newsgroup-name method))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2565 t t nil 1))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2566 (goto-char (point-min)))))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2567
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2568 (autoload 'idna-to-unicode "idna")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2569
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2570 (defun article-decode-idna-rhs ()
65719
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
2571 "Decode IDNA strings in RHS in various headers in current buffer.
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
2572 The following headers are decoded: From:, To:, Cc:, Reply-To:,
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
2573 Mail-Reply-To: and Mail-Followup-To:."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2574 (when gnus-use-idna
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2575 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2576 (let ((inhibit-point-motion-hooks t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2577 (inhibit-read-only t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2578 (article-narrow-to-head)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2579 (goto-char (point-min))
65719
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
2580 (while (re-search-forward "@[^ \t\n\r,>]*\\(xn--[-A-Za-z0-9.]*\\)[ \t\n\r,>]" nil t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2581 (let (ace unicode)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2582 (when (save-match-data
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2583 (and (setq ace (match-string 1))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2584 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2585 (and (re-search-backward "^[^ \t]" nil t)
65719
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
2586 (looking-at "From\\|To\\|Cc\\|Reply-To\\|Mail-Reply-To\\|Mail-Followup-To")))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2587 (setq unicode (idna-to-unicode ace))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2588 (unless (string= ace unicode)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2589 (replace-match unicode nil nil nil 1)))))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2590
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2591 (defun article-de-quoted-unreadable (&optional force read-charset)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2592 "Translate a quoted-printable-encoded article.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2593 If FORCE, decode the article whether it is marked as quoted-printable
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2594 or not.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2595 If READ-CHARSET, ask for a coding system."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2596 (interactive (list 'force current-prefix-arg))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2597 (save-excursion
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
2598 (let ((inhibit-read-only t) type charset)
31785
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2599 (if (gnus-buffer-live-p gnus-original-article-buffer)
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2600 (with-current-buffer gnus-original-article-buffer
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2601 (setq type
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2602 (gnus-fetch-field "content-transfer-encoding"))
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2603 (let* ((ct (gnus-fetch-field "content-type"))
68720
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2604 (ctl (and ct (mail-header-parse-content-type ct))))
31785
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2605 (setq charset (and ctl
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2606 (mail-content-type-get ctl 'charset)))
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2607 (if (stringp charset)
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2608 (setq charset (intern (downcase charset)))))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2609 (if read-charset
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2610 (setq charset (mm-read-coding-system "Charset: " charset)))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
2611 (unless charset
31785
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2612 (setq charset gnus-newsgroup-charset))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2613 (when (or force
32210
88dc0e5a0061 (article-de-quoted-unreadable)
Dave Love <fx@gnu.org>
parents: 31785
diff changeset
2614 (and type (let ((case-fold-search t))
88dc0e5a0061 (article-de-quoted-unreadable)
Dave Love <fx@gnu.org>
parents: 31785
diff changeset
2615 (string-match "quoted-printable" type))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2616 (article-goto-body)
32210
88dc0e5a0061 (article-de-quoted-unreadable)
Dave Love <fx@gnu.org>
parents: 31785
diff changeset
2617 (quoted-printable-decode-region
88dc0e5a0061 (article-de-quoted-unreadable)
Dave Love <fx@gnu.org>
parents: 31785
diff changeset
2618 (point) (point-max) (mm-charset-to-coding-system charset))))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2619
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2620 (defun article-de-base64-unreadable (&optional force read-charset)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2621 "Translate a base64 article.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2622 If FORCE, decode the article whether it is marked as base64 not.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2623 If READ-CHARSET, ask for a coding system."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2624 (interactive (list 'force current-prefix-arg))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2625 (save-excursion
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
2626 (let ((inhibit-read-only t) type charset)
31785
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2627 (if (gnus-buffer-live-p gnus-original-article-buffer)
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2628 (with-current-buffer gnus-original-article-buffer
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2629 (setq type
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2630 (gnus-fetch-field "content-transfer-encoding"))
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2631 (let* ((ct (gnus-fetch-field "content-type"))
68720
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2632 (ctl (and ct (mail-header-parse-content-type ct))))
31785
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2633 (setq charset (and ctl
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2634 (mail-content-type-get ctl 'charset)))
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2635 (if (stringp charset)
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2636 (setq charset (intern (downcase charset)))))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2637 (if read-charset
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2638 (setq charset (mm-read-coding-system "Charset: " charset)))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
2639 (unless charset
31785
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2640 (setq charset gnus-newsgroup-charset))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2641 (when (or force
32210
88dc0e5a0061 (article-de-quoted-unreadable)
Dave Love <fx@gnu.org>
parents: 31785
diff changeset
2642 (and type (let ((case-fold-search t))
88dc0e5a0061 (article-de-quoted-unreadable)
Dave Love <fx@gnu.org>
parents: 31785
diff changeset
2643 (string-match "base64" type))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2644 (article-goto-body)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2645 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2646 (narrow-to-region (point) (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2647 (base64-decode-region (point-min) (point-max))
32210
88dc0e5a0061 (article-de-quoted-unreadable)
Dave Love <fx@gnu.org>
parents: 31785
diff changeset
2648 (mm-decode-coding-region
88dc0e5a0061 (article-de-quoted-unreadable)
Dave Love <fx@gnu.org>
parents: 31785
diff changeset
2649 (point-min) (point-max) (mm-charset-to-coding-system charset)))))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2650
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2651 (eval-when-compile
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2652 (require 'rfc1843))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2653
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2654 (defun article-decode-HZ ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2655 "Translate a HZ-encoded article."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2656 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2657 (require 'rfc1843)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2658 (save-excursion
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
2659 (let ((inhibit-read-only t))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2660 (rfc1843-decode-region (point-min) (point-max)))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2661
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2662 (defun article-unsplit-urls ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2663 "Remove the newlines that some other mailers insert into URLs."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2664 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2665 (save-excursion
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2666 (let ((inhibit-read-only t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2667 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2668 (while (re-search-forward
64735
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
2669 "\\(\\(https?\\|ftp\\)://\\S-+\\) *\n\\(\\S-+\\)" nil t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2670 (replace-match "\\1\\3" t)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2671 (when (interactive-p)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2672 (gnus-treat-article nil))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2673
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2674
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2675 (defun article-wash-html (&optional read-charset)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2676 "Format an HTML article.
68207
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2677 If READ-CHARSET, ask for a coding system. If it is a number, the
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2678 charset defined in `gnus-summary-show-article-charset-alist' is used."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2679 (interactive "P")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2680 (save-excursion
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
2681 (let ((inhibit-read-only t)
31785
51cea22fd2aa Merge from Gnus trunk.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2682 charset)
68207
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2683 (if read-charset
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2684 (if (or (and (numberp read-charset)
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2685 (setq charset
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2686 (cdr
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2687 (assq read-charset
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2688 gnus-summary-show-article-charset-alist))))
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2689 (setq charset (mm-read-coding-system "Charset: ")))
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2690 (let ((gnus-summary-show-article-charset-alist
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2691 (list (cons 1 charset))))
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2692 (with-current-buffer gnus-summary-buffer
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2693 (gnus-summary-show-article 1)))
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2694 (error "No charset is given"))
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2695 (when (gnus-buffer-live-p gnus-original-article-buffer)
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2696 (with-current-buffer gnus-original-article-buffer
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2697 (let* ((ct (gnus-fetch-field "content-type"))
68720
d9dde5b81e71 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-57
Miles Bader <miles@gnu.org>
parents: 68380
diff changeset
2698 (ctl (and ct (mail-header-parse-content-type ct))))
68207
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2699 (setq charset (and ctl
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2700 (mail-content-type-get ctl 'charset)))
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2701 (when (stringp charset)
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2702 (setq charset (intern (downcase charset)))))))
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2703 (unless charset
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2704 (setq charset gnus-newsgroup-charset)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2705 (article-goto-body)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2706 (save-window-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2707 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2708 (narrow-to-region (point) (point-max))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2709 (let* ((func (or gnus-article-wash-function mm-text-html-renderer))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2710 (entry (assq func mm-text-html-washer-alist)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2711 (when entry
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2712 (setq func (cdr entry)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2713 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2714 ((functionp func)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2715 (funcall func))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2716 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2717 (apply (car func) (cdr func))))))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2718
87187
54ba9c058e4a (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87161
diff changeset
2719 ;; External.
54ba9c058e4a (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87161
diff changeset
2720 (declare-function w3-region "ext:w3-display" (st nd))
54ba9c058e4a (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87161
diff changeset
2721
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2722 (defun gnus-article-wash-html-with-w3 ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2723 "Wash the current buffer with w3."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2724 (mm-setup-w3)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2725 (let ((w3-strict-width (window-width))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2726 (url-standalone-mode t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2727 (url-gateway-unplugged t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2728 (w3-honor-stylesheets nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2729 (condition-case ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2730 (w3-region (point-min) (point-max))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2731 (error))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2732
87187
54ba9c058e4a (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87161
diff changeset
2733 ;; External.
54ba9c058e4a (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87161
diff changeset
2734 (declare-function w3m-region "ext:w3m" (start end &optional url charset))
54ba9c058e4a (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87161
diff changeset
2735
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2736 (defun gnus-article-wash-html-with-w3m ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2737 "Wash the current buffer with emacs-w3m."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
2738 (mm-setup-w3m)
68129
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
2739 (let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp)
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
2740 w3m-force-redisplay)
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
2741 (w3m-region (point-min) (point-max)))
100208
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2742 ;; Put the mark meaning this part was rendered by emacs-w3m.
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2743 (put-text-property (point-min) (point-max) 'mm-inline-text-html-with-w3m t)
68129
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
2744 (when (and mm-inline-text-html-with-w3m-keymap
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
2745 (boundp 'w3m-minor-mode-map)
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
2746 w3m-minor-mode-map)
100198
c20a057aefda * mm-view.el (mm-inline-text-html-render-with-w3m): Put special keymap on links.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98398
diff changeset
2747 (if (and (boundp 'w3m-link-map)
c20a057aefda * mm-view.el (mm-inline-text-html-render-with-w3m): Put special keymap on links.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98398
diff changeset
2748 w3m-link-map)
100208
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2749 (let* ((start (point-min))
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2750 (end (point-max))
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2751 (on (get-text-property start 'w3m-href-anchor))
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2752 (map (copy-keymap w3m-link-map))
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2753 next)
100198
c20a057aefda * mm-view.el (mm-inline-text-html-render-with-w3m): Put special keymap on links.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98398
diff changeset
2754 (set-keymap-parent map w3m-minor-mode-map)
100208
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2755 (while (< start end)
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2756 (if on
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2757 (progn
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2758 (setq next (or (text-property-any start end
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2759 'w3m-href-anchor nil)
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2760 end))
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2761 (put-text-property start next 'keymap map))
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2762 (setq next (or (text-property-not-all start end
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2763 'w3m-href-anchor nil)
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2764 end))
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2765 (put-text-property start next 'keymap w3m-minor-mode-map))
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2766 (setq start next
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2767 on (not on))))
c5f2603d7595 * mm-view.el (mm-inline-text-html-render-with-w3m): Make it simple and fast.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100198
diff changeset
2768 (put-text-property (point-min) (point-max) 'keymap w3m-minor-mode-map))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
2769
86154
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85888
diff changeset
2770 (defvar charset) ;; Bound by `article-wash-html'.
68207
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2771
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2772 (defun gnus-article-wash-html-with-w3m-standalone ()
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2773 "Wash the current buffer with w3m."
68380
e1843613ecb8 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-14
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
2774 (if (mm-w3m-standalone-supports-m17n-p)
e1843613ecb8 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-14
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
2775 (progn
e1843613ecb8 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-14
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
2776 (unless (mm-coding-system-p charset) ;; Bound by `article-wash-html'.
e1843613ecb8 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-14
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
2777 ;; The default.
e1843613ecb8 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-14
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
2778 (setq charset 'iso-8859-1))
e1843613ecb8 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-14
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
2779 (let ((coding-system-for-write charset)
e1843613ecb8 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-14
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
2780 (coding-system-for-read charset))
e1843613ecb8 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-14
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
2781 (call-process-region
e1843613ecb8 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-14
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
2782 (point-min) (point-max)
e1843613ecb8 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-14
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
2783 "w3m" t t nil "-dump" "-T" "text/html"
e1843613ecb8 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-14
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
2784 "-I" (symbol-name charset) "-O" (symbol-name charset))))
e1843613ecb8 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-14
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
2785 (mm-inline-wash-with-stdin nil "w3m" "-dump" "-T" "text/html")))
68207
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
2786
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2787 (defvar gnus-article-browse-html-temp-list nil
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2788 "List of temporary files created by `gnus-article-browse-html-parts'.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2789 Internal variable.")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2790
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2791 (defcustom gnus-article-browse-delete-temp 'ask
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2792 "What to do with temporary files from `gnus-article-browse-html-parts'.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2793 If nil, don't delete temporary files. If it is t, delete them on
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2794 exit from the summary buffer. If it is the symbol `file', query
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2795 on each file, if it is `ask' ask once when exiting from the
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2796 summary buffer."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2797 :group 'gnus-article
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 92306
diff changeset
2798 :version "23.1" ;; No Gnus
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2799 :type '(choice (const :tag "Don't delete" nil)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2800 (const :tag "Don't ask" t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2801 (const :tag "Ask" ask)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2802 (const :tag "Ask for each file" file)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2803
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2804 ;; Cf. mm-postponed-undisplay-list / mm-destroy-postponed-undisplay-list.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2805
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2806 (defun gnus-article-browse-delete-temp-files (&optional how)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2807 "Delete temp-files created by `gnus-article-browse-html-parts'."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2808 (when (and gnus-article-browse-html-temp-list
108855
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2809 (progn
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2810 (or how (setq how gnus-article-browse-delete-temp))
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2811 (if (eq how 'ask)
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2812 (let ((files (length gnus-article-browse-html-temp-list)))
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2813 (gnus-y-or-n-p (format
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2814 "Delete all %s temporary HTML file%s? "
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2815 files
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2816 (if (> files 1) "s" ""))))
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2817 how)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2818 (dolist (file gnus-article-browse-html-temp-list)
108855
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2819 (cond ((file-directory-p file)
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2820 (when (or (not (eq how 'file))
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2821 (gnus-y-or-n-p
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2822 (format
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2823 "Delete temporary HTML file(s) in directory `%s'? "
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2824 (file-name-as-directory file))))
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2825 (gnus-delete-directory file)))
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2826 ((file-exists-p file)
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2827 (when (or (not (eq how 'file))
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2828 (gnus-y-or-n-p
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2829 (format "Delete temporary HTML file `%s'? " file)))
8661a29f6131 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108533
diff changeset
2830 (delete-file file)))))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2831 ;; Also remove file from the list when not deleted or if file doesn't
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2832 ;; exist anymore.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2833 (setq gnus-article-browse-html-temp-list nil))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2834 gnus-article-browse-html-temp-list)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2835
107715
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2836 (defun gnus-article-browse-html-save-cid-content (cid handles directory)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2837 "Find CID content in HANDLES and save it in a file in DIRECTORY.
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2838 Return file name."
107578
3ca642fe505f 2010-03-30 Katsumi Yamaoka <yamaoka@jpl.org>
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107473
diff changeset
2839 (save-match-data
107715
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2840 (let (file type)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2841 (catch 'found
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2842 (dolist (handle handles)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2843 (cond
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2844 ((not (listp handle)))
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2845 ((equal (mm-handle-media-supertype handle) "multipart")
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2846 (when (setq file (gnus-article-browse-html-save-cid-content
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2847 cid handle directory))
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2848 (throw 'found file)))
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2849 ((equal (concat "<" cid ">") (mm-handle-id handle))
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2850 (setq file
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2851 (expand-file-name
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2852 (or (mail-content-type-get
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2853 (mm-handle-disposition handle) 'filename)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2854 (mail-content-type-get
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2855 (setq type (mm-handle-type handle)) 'name)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2856 (concat
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2857 (make-temp-name "cid")
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2858 (car (rassoc (car type) mailcap-mime-extensions))))
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2859 directory))
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2860 (mm-save-part-to-file handle file)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2861 (throw 'found file))))))))
107578
3ca642fe505f 2010-03-30 Katsumi Yamaoka <yamaoka@jpl.org>
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107473
diff changeset
2862
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2863 (defun gnus-article-browse-html-parts (list &optional header)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2864 "View all \"text/html\" parts from LIST.
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2865 Recurse into multiparts. The optional HEADER that should be a decoded
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2866 message header will be added to the bodies of the \"text/html\" parts."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2867 ;; Internal function used by `gnus-article-browse-html-article'.
107715
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2868 (let (type file charset content cid-dir tmp-file showed)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2869 ;; Find and show the html-parts.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2870 (dolist (handle list)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
2871 ;; If HTML, show it:
87300
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2872 (cond ((not (listp handle)))
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2873 ((or (equal (car (setq type (mm-handle-type handle))) "text/html")
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2874 (and (equal (car type) "message/external-body")
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2875 (or header
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2876 (setq file (or (mail-content-type-get type 'name)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2877 (mail-content-type-get
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2878 (mm-handle-disposition handle)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2879 'filename))))
87300
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2880 (or (mm-handle-cache handle)
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2881 (condition-case code
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2882 (progn (mm-extern-cache-contents handle) t)
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2883 (error
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2884 (gnus-message 3 "%s" (error-message-string code))
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2885 (when (>= gnus-verbose 3) (sit-for 2))
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2886 nil)))
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2887 (progn
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2888 (setq handle (mm-handle-cache handle)
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2889 type (mm-handle-type handle))
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2890 (equal (car type) "text/html"))))
107715
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2891 (setq charset (mail-content-type-get type 'charset)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2892 content (mm-get-part handle))
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2893 (with-temp-buffer
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2894 (if (eq charset 'gnus-decoded)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2895 (mm-enable-multibyte)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2896 (mm-disable-multibyte))
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2897 (insert content)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2898 ;; resolve cid contents
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2899 (let ((case-fold-search t)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2900 cid-file)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2901 (goto-char (point-min))
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2902 (while (re-search-forward "\
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2903 <img[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*src=\"\\(cid:\\([^\"]+\\)\\)\""
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2904 nil t)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2905 (unless cid-dir
108287
c0d13767677a Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107715
diff changeset
2906 (setq cid-dir (mm-make-temp-file "cid" t))
107715
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2907 (add-to-list 'gnus-article-browse-html-temp-list cid-dir))
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2908 (setq file nil
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2909 content nil)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2910 (when (setq cid-file
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2911 (gnus-article-browse-html-save-cid-content
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2912 (match-string 2)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2913 (with-current-buffer gnus-article-buffer
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2914 gnus-article-mime-handles)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2915 cid-dir))
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2916 (replace-match (concat "file://" cid-file)
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2917 nil nil nil 1))))
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2918 (unless content (setq content (buffer-string))))
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2919 (when (or charset header (not file))
87300
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2920 (setq tmp-file (mm-make-temp-file
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2921 ;; Do we need to care for 8.3 filenames?
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
2922 "mm-" nil ".html")))
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2923 ;; Add a meta html tag to specify charset and a header.
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2924 (cond
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2925 (header
107715
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2926 (let (title eheader body hcharset coding force-charset)
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2927 (with-temp-buffer
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2928 (mm-enable-multibyte)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2929 (setq case-fold-search t)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2930 (insert header "\n")
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2931 (setq title (message-fetch-field "subject"))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2932 (goto-char (point-min))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2933 (while (re-search-forward "\\(<\\)\\|\\(>\\)\\|&" nil t)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2934 (replace-match (cond ((match-beginning 1) "&lt;")
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2935 ((match-beginning 2) "&gt;")
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2936 (t "&amp;"))))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2937 (goto-char (point-min))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2938 (insert "<pre>\n")
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2939 (goto-char (point-max))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2940 (insert "</pre>\n<hr>\n")
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2941 ;; We have to examine charset one by one since
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2942 ;; charset specified in parts might be different.
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2943 (if (eq charset 'gnus-decoded)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2944 (setq charset 'utf-8
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2945 eheader (mm-encode-coding-string (buffer-string)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2946 charset)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2947 title (when title
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2948 (mm-encode-coding-string title charset))
107715
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2949 body (mm-encode-coding-string content charset)
107581
1e23ce3cbd8b 2010-03-30 Martin Stjernholm <mast@lysator.liu.se>
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107578
diff changeset
2950 force-charset t)
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2951 (setq hcharset (mm-find-mime-charset-region (point-min)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2952 (point-max)))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2953 (cond ((= (length hcharset) 1)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2954 (setq hcharset (car hcharset)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2955 coding (mm-charset-to-coding-system
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2956 hcharset)))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2957 ((> (length hcharset) 1)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2958 (setq hcharset 'utf-8
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2959 coding hcharset)))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2960 (if coding
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2961 (if charset
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2962 (progn
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2963 (setq body
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2964 (mm-charset-to-coding-system charset))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2965 (if (eq coding body)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2966 (setq eheader (mm-encode-coding-string
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2967 (buffer-string) coding)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2968 title (when title
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2969 (mm-encode-coding-string
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2970 title coding))
107715
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2971 body content)
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2972 (setq charset 'utf-8
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2973 eheader (mm-encode-coding-string
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2974 (buffer-string) charset)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2975 title (when title
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2976 (mm-encode-coding-string
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2977 title charset))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2978 body (mm-encode-coding-string
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2979 (mm-decode-coding-string
107715
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2980 content body)
107581
1e23ce3cbd8b 2010-03-30 Martin Stjernholm <mast@lysator.liu.se>
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107578
diff changeset
2981 charset)
1e23ce3cbd8b 2010-03-30 Martin Stjernholm <mast@lysator.liu.se>
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107578
diff changeset
2982 force-charset t)))
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2983 (setq charset hcharset
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2984 eheader (mm-encode-coding-string
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2985 (buffer-string) coding)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2986 title (when title
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2987 (mm-encode-coding-string
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2988 title coding))
107715
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2989 body content))
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2990 (setq eheader (mm-string-as-unibyte (buffer-string))
107715
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
2991 body content)))
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2992 (erase-buffer)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2993 (mm-disable-multibyte)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2994 (insert body)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2995 (when charset
107581
1e23ce3cbd8b 2010-03-30 Martin Stjernholm <mast@lysator.liu.se>
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107578
diff changeset
2996 (mm-add-meta-html-tag handle charset force-charset))
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2997 (when title
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2998 (goto-char (point-min))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
2999 (unless (search-forward "<title>" nil t)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3000 (re-search-forward "<head>\\s-*" nil t)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3001 (insert "<title>" title "</title>\n")))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3002 (goto-char (point-min))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3003 (or (re-search-forward
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3004 "<body\\(?:\\s-+[^>]+\\|\\s-*\\)>\\s-*" nil t)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3005 (re-search-forward
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3006 "</head\\(?:\\s-+[^>]+\\|\\s-*\\)>\\s-*" nil t))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3007 (insert eheader)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3008 (mm-write-region (point-min) (point-max)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3009 tmp-file nil nil nil 'binary t))))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3010 (charset
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3011 (mm-with-unibyte-buffer
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3012 (insert (if (eq charset 'gnus-decoded)
107715
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
3013 (mm-encode-coding-string content
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
3014 (setq charset 'utf-8))
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
3015 content))
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3016 (if (or (mm-add-meta-html-tag handle charset)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3017 (not file))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3018 (mm-write-region (point-min) (point-max)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3019 tmp-file nil nil nil 'binary t)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3020 (setq tmp-file nil))))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3021 (tmp-file
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3022 (mm-save-part-to-file handle tmp-file)))
87300
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
3023 (when tmp-file
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
3024 (add-to-list 'gnus-article-browse-html-temp-list tmp-file))
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
3025 (add-hook 'gnus-summary-prepare-exit-hook
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
3026 'gnus-article-browse-delete-temp-files)
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
3027 (add-hook 'gnus-exit-gnus-hook
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
3028 (lambda ()
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
3029 (gnus-article-browse-delete-temp-files t)))
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
3030 ;; FIXME: Warn if there's an <img> tag?
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
3031 (browse-url-of-file (or tmp-file (expand-file-name file)))
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
3032 (setq showed t))
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
3033 ;; If multipart, recurse
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3034 ((equal (mm-handle-media-supertype handle) "multipart")
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3035 (when (gnus-article-browse-html-parts handle header)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3036 (setq showed t)))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3037 ((equal (mm-handle-media-type handle) "message/rfc822")
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3038 (mm-with-multibyte-buffer
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3039 (mm-insert-part handle)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3040 (setq handle (mm-dissect-buffer t t))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3041 (when (and (bufferp (car handle))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3042 (stringp (car (mm-handle-type handle))))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3043 (setq handle (list handle)))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3044 (when header
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3045 (article-decode-encoded-words)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3046 (let ((gnus-visible-headers
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3047 (or (get 'gnus-visible-headers 'standard-value)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3048 gnus-visible-headers)))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3049 (article-hide-headers))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3050 (goto-char (point-min))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3051 (search-forward "\n\n" nil 'move)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3052 (skip-chars-backward "\t\n ")
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3053 (setq header (buffer-substring (point-min) (point)))))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3054 (when (prog1
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3055 (gnus-article-browse-html-parts handle header)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3056 (mm-destroy-parts handle))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3057 (setq showed t)))))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3058 showed))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3059
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3060 (defun gnus-article-browse-html-article (&optional arg)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3061 "View \"text/html\" parts of the current article with a WWW browser.
107715
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
3062 Inline images embedded in a message using the cid scheme, as they are
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
3063 generally considered to be safe, will be processed properly.
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3064 The message header is added to the beginning of every html part unless
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3065 the prefix argument ARG is given.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3066
107715
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
3067 Warning: Spammers use links to images (using the http scheme) in HTML
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
3068 articles to verify whether you have read the message. As
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
3069 `gnus-article-browse-html-article' passes the HTML content to the
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
3070 browser without eliminating these \"web bugs\" you should only
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
3071 use it for mails from trusted senders.
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
3072
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
3073 If you always want to display HTML parts in the browser, set
107715
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
3074 `mm-text-html-renderer' to nil.
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
3075
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
3076 This command creates temporary files to pass HTML contents including
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
3077 images if any to the browser, and deletes them when exiting the group
19e22195d54e (gnus-article-browse-html-save-cid-content): Rename from
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107581
diff changeset
3078 \(if you want)."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3079 ;; Cf. `mm-w3m-safe-url-regexp'
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3080 (interactive "P")
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3081 (if arg
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3082 (gnus-summary-show-article)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3083 (let ((gnus-visible-headers (or (get 'gnus-visible-headers 'standard-value)
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
3084 gnus-visible-headers))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
3085 ;; As we insert a <hr>, there's no need for the body boundary.
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
3086 (gnus-treat-body-boundary nil))
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3087 (gnus-summary-show-article)))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3088 (with-current-buffer gnus-article-buffer
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3089 (let ((header (unless arg
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3090 (save-restriction
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3091 (widen)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3092 (buffer-substring-no-properties
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3093 (goto-char (point-min))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3094 (if (search-forward "\n\n" nil t)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3095 (match-beginning 0)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3096 (goto-char (point-max))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3097 (skip-chars-backward "\t\n ")
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3098 (point))))))
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3099 parts)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3100 (set-buffer gnus-original-article-buffer)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3101 (setq parts (mm-dissect-buffer t t))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3102 ;; If singlepart, enforce a list.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3103 (when (and (bufferp (car parts))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3104 (stringp (car (mm-handle-type parts))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3105 (setq parts (list parts)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3106 ;; Process the list
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3107 (unless (gnus-article-browse-html-parts parts header)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3108 (gnus-error 3 "Mail doesn't contain a \"text/html\" part!"))
87454
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3109 (mm-destroy-parts parts)
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3110 (unless arg
0cbc451989a7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87300
diff changeset
3111 (gnus-summary-show-article)))))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3112
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3113 (defun article-hide-list-identifiers ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3114 "Remove list identifies from the Subject header.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3115 The `gnus-list-identifiers' variable specifies what to do."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3116 (interactive)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3117 (let ((inhibit-point-motion-hooks t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3118 (regexp (if (consp gnus-list-identifiers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3119 (mapconcat 'identity gnus-list-identifiers " *\\|")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3120 gnus-list-identifiers))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3121 (inhibit-read-only t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3122 (when regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3123 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3124 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3125 (article-narrow-to-head)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3126 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3127 (while (re-search-forward
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3128 (concat "^Subject: +\\(R[Ee]: +\\)*\\(" regexp " *\\)")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3129 nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3130 (delete-region (match-beginning 2) (match-end 0))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3131 (beginning-of-line))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3132 (when (re-search-forward
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3133 "^Subject: +\\(\\(R[Ee]: +\\)+\\)R[Ee]: +" nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3134 (delete-region (match-beginning 1) (match-end 1))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3135
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3136 (defun article-hide-pem (&optional arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3137 "Toggle hiding of any PEM headers and signatures in the current article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3138 If given a negative prefix, always show; if given a positive prefix,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3139 always hide."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3140 (interactive (gnus-article-hidden-arg))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3141 (unless (gnus-article-check-hidden-text 'pem arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3142 (save-excursion
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3143 (let ((inhibit-read-only t) end)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3144 (goto-char (point-min))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3145 ;; Hide the horrendously ugly "header".
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3146 (when (and (search-forward
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3147 "\n-----BEGIN PRIVACY-ENHANCED MESSAGE-----\n"
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3148 nil t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3149 (setq end (1+ (match-beginning 0))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3150 (gnus-add-wash-type 'pem)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3151 (gnus-article-hide-text-type
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3152 end
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3153 (if (search-forward "\n\n" nil t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3154 (match-end 0)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3155 (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3156 'pem)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3157 ;; Hide the trailer as well
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3158 (when (search-forward "\n-----END PRIVACY-ENHANCED MESSAGE-----\n"
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3159 nil t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3160 (gnus-article-hide-text-type
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3161 (match-beginning 0) (match-end 0) 'pem)))))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3162
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3163 (defun article-strip-banner ()
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3164 "Strip the banners specified by the `banner' group parameter and by
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3165 `gnus-article-address-banner-alist'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3166 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3167 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3168 (save-restriction
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3169 (let ((inhibit-point-motion-hooks t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3170 (when (gnus-parameter-banner gnus-newsgroup-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3171 (article-really-strip-banner
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3172 (gnus-parameter-banner gnus-newsgroup-name)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3173 (when gnus-article-address-banner-alist
68940
808f636eb13e Revision: emacs@sv.gnu.org/emacs--devo--0--patch-93
Miles Bader <miles@gnu.org>
parents: 68720
diff changeset
3174 ;; Note that the From header is decoded here, so it is
808f636eb13e Revision: emacs@sv.gnu.org/emacs--devo--0--patch-93
Miles Bader <miles@gnu.org>
parents: 68720
diff changeset
3175 ;; required that the *-extract-address-components function
808f636eb13e Revision: emacs@sv.gnu.org/emacs--devo--0--patch-93
Miles Bader <miles@gnu.org>
parents: 68720
diff changeset
3176 ;; supports non-ASCII text.
68944
5e2a9bb28073 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-94
Miles Bader <miles@gnu.org>
parents: 68940
diff changeset
3177 (let ((from (save-restriction
5e2a9bb28073 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-94
Miles Bader <miles@gnu.org>
parents: 68940
diff changeset
3178 (widen)
5e2a9bb28073 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-94
Miles Bader <miles@gnu.org>
parents: 68940
diff changeset
3179 (article-narrow-to-head)
5e2a9bb28073 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-94
Miles Bader <miles@gnu.org>
parents: 68940
diff changeset
3180 (mail-fetch-field "from"))))
5e2a9bb28073 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-94
Miles Bader <miles@gnu.org>
parents: 68940
diff changeset
3181 (when (and from
5e2a9bb28073 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-94
Miles Bader <miles@gnu.org>
parents: 68940
diff changeset
3182 (setq from
5e2a9bb28073 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-94
Miles Bader <miles@gnu.org>
parents: 68940
diff changeset
3183 (cadr (funcall gnus-extract-address-components
5e2a9bb28073 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-94
Miles Bader <miles@gnu.org>
parents: 68940
diff changeset
3184 from))))
5e2a9bb28073 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-94
Miles Bader <miles@gnu.org>
parents: 68940
diff changeset
3185 (catch 'found
5e2a9bb28073 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-94
Miles Bader <miles@gnu.org>
parents: 68940
diff changeset
3186 (dolist (pair gnus-article-address-banner-alist)
5e2a9bb28073 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-94
Miles Bader <miles@gnu.org>
parents: 68940
diff changeset
3187 (when (string-match (car pair) from)
5e2a9bb28073 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-94
Miles Bader <miles@gnu.org>
parents: 68940
diff changeset
3188 (throw 'found
5e2a9bb28073 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-94
Miles Bader <miles@gnu.org>
parents: 68940
diff changeset
3189 (article-really-strip-banner (cdr pair)))))))))))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3190
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3191 (defun article-really-strip-banner (banner)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3192 "Strip the banner specified by the argument."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3193 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3194 (save-restriction
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3195 (let ((inhibit-point-motion-hooks t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3196 (gnus-signature-limit nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3197 (inhibit-read-only t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3198 (article-goto-body)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3199 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3200 ((eq banner 'signature)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3201 (when (gnus-article-narrow-to-signature)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3202 (widen)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3203 (forward-line -1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3204 (delete-region (point) (point-max))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3205 ((symbolp banner)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3206 (if (setq banner (cdr (assq banner gnus-article-banner-alist)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3207 (while (re-search-forward banner nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3208 (delete-region (match-beginning 0) (match-end 0)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3209 ((stringp banner)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3210 (while (re-search-forward banner nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3211 (delete-region (match-beginning 0) (match-end 0)))))))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3212
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3213 (defun article-babel ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3214 "Translate article using an online translation service."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3215 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3216 (require 'babel)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3217 (gnus-with-article-buffer
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3218 (when (article-goto-body)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3219 (let* ((start (point))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3220 (end (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3221 (orig (buffer-substring start end))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3222 (trans (babel-as-string orig)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3223 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3224 (narrow-to-region start end)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3225 (delete-region start end)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3226 (insert trans))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3227
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3228 (defun article-hide-signature (&optional arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3229 "Hide the signature in the current article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3230 If given a negative prefix, always show; if given a positive prefix,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3231 always hide."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3232 (interactive (gnus-article-hidden-arg))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3233 (unless (gnus-article-check-hidden-text 'signature arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3234 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3235 (save-restriction
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
3236 (let ((inhibit-read-only t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3237 (when (gnus-article-narrow-to-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3238 (gnus-article-hide-text-type
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3239 (point-min) (point-max) 'signature))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3240 (gnus-set-mode-line 'article))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3241
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3242 (defun article-strip-headers-in-body ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3243 "Strip offensive headers from bodies."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3244 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3245 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3246 (article-goto-body)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3247 (let ((case-fold-search t))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3248 (when (looking-at "x-no-archive:")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3249 (gnus-delete-line)))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3250
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3251 (defun article-strip-leading-blank-lines ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3252 "Remove all blank lines from the beginning of the article."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3253 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3254 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3255 (let ((inhibit-point-motion-hooks t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3256 (inhibit-read-only t))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3257 (when (article-goto-body)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3258 (while (and (not (eobp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3259 (looking-at "[ \t]*$"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3260 (gnus-delete-line))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3261
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3262 (defun article-narrow-to-head ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3263 "Narrow the buffer to the head of the message.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3264 Point is left at the beginning of the narrowed-to region."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3265 (narrow-to-region
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3266 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3267 (if (search-forward "\n\n" nil 1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3268 (1- (point))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3269 (point-max)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3270 (goto-char (point-min)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3271
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3272 (defun article-goto-body ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3273 "Place point at the start of the body."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3274 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3275 (cond
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3276 ;; This variable is only bound when dealing with separate
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3277 ;; MIME body parts.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3278 (article-goto-body-goes-to-point-min-p
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3279 t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3280 ((search-forward "\n\n" nil t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3281 t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3282 (t
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3283 (goto-char (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3284 nil)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3285
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3286 (defun article-strip-multiple-blank-lines ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3287 "Replace consecutive blank lines with one empty line."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3288 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3289 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3290 (let ((inhibit-point-motion-hooks t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3291 (inhibit-read-only t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3292 ;; First make all blank lines empty.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3293 (article-goto-body)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3294 (while (re-search-forward "^[ \t]+$" nil t)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3295 (unless (gnus-annotation-in-region-p
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3296 (match-beginning 0) (match-end 0))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3297 (replace-match "" nil t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3298 ;; Then replace multiple empty lines with a single empty line.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3299 (article-goto-body)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3300 (while (re-search-forward "\n\n\\(\n+\\)" nil t)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3301 (unless (gnus-annotation-in-region-p
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3302 (match-beginning 0) (match-end 0))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3303 (delete-region (match-beginning 1) (match-end 1)))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3304
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3305 (defun article-strip-leading-space ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3306 "Remove all white space from the beginning of the lines in the article."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3307 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3308 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3309 (let ((inhibit-point-motion-hooks t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3310 (inhibit-read-only t))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3311 (article-goto-body)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3312 (while (re-search-forward "^[ \t]+" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3313 (replace-match "" t t)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3314
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3315 (defun article-strip-trailing-space ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3316 "Remove all white space from the end of the lines in the article."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3317 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3318 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3319 (let ((inhibit-point-motion-hooks t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3320 (inhibit-read-only t))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3321 (article-goto-body)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3322 (while (re-search-forward "[ \t]+$" nil t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3323 (replace-match "" t t)))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3324
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3325 (defun article-strip-blank-lines ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3326 "Strip leading, trailing and multiple blank lines."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3327 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3328 (article-strip-leading-blank-lines)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3329 (article-remove-trailing-blank-lines)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3330 (article-strip-multiple-blank-lines))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3331
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3332 (defun article-strip-all-blank-lines ()
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3333 "Strip all blank lines."
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3334 (interactive)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3335 (save-excursion
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3336 (let ((inhibit-point-motion-hooks t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3337 (inhibit-read-only t))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3338 (article-goto-body)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3339 (while (re-search-forward "^[ \t]*\n" nil t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3340 (replace-match "" t t)))))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3341
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3342 (defun gnus-article-narrow-to-signature ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3343 "Narrow to the signature; return t if a signature is found, else nil."
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3344 (let ((inhibit-point-motion-hooks t))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3345 (when (gnus-article-search-signature)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3346 (forward-line 1)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3347 ;; Check whether we have some limits to what we consider
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3348 ;; to be a signature.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3349 (let ((limits (if (listp gnus-signature-limit) gnus-signature-limit
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3350 (list gnus-signature-limit)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3351 limit limited)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3352 (while (setq limit (pop limits))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3353 (if (or (and (integerp limit)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3354 (< (- (point-max) (point)) limit))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3355 (and (floatp limit)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3356 (< (count-lines (point) (point-max)) limit))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3357 (and (functionp limit)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3358 (funcall limit))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3359 (and (stringp limit)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3360 (not (re-search-forward limit nil t))))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3361 () ; This limit did not succeed.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3362 (setq limited t
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3363 limits nil)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3364 (unless limited
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3365 (narrow-to-region (point) (point-max))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3366 t)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3367
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3368 (defun gnus-article-search-signature ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3369 "Search the current buffer for the signature separator.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3370 Put point at the beginning of the signature separator."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3371 (let ((cur (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3372 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3373 (if (if (stringp gnus-signature-separator)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3374 (re-search-backward gnus-signature-separator nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3375 (let ((seps gnus-signature-separator))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3376 (while (and seps
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3377 (not (re-search-backward (car seps) nil t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3378 (pop seps))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3379 seps))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3380 t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3381 (goto-char cur)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3382 nil)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3383
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3384 (defun gnus-article-hidden-arg ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3385 "Return the current prefix arg as a number, or 0 if no prefix."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3386 (list (if current-prefix-arg
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3387 (prefix-numeric-value current-prefix-arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3388 0)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3389
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3390 (defun gnus-article-check-hidden-text (type arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3391 "Return nil if hiding is necessary.
42206
0f4506820432 Doc fix.
Pavel Janík <Pavel@Janik.cz>
parents: 39335
diff changeset
3392 Arg can be nil or a number. nil and positive means hide, negative
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3393 means show, 0 means toggle."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3394 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3395 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3396 (let ((hide (gnus-article-hidden-text-p type)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3397 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3398 ((or (null arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3399 (> arg 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3400 nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3401 ((< arg 0)
34833
aaf69bc74739 * gnus-art.el (gnus-article-check-hidden-text): Return t.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34818
diff changeset
3402 (gnus-article-show-hidden-text type)
aaf69bc74739 * gnus-art.el (gnus-article-check-hidden-text): Return t.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34818
diff changeset
3403 t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3404 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3405 (if (eq hide 'hidden)
34833
aaf69bc74739 * gnus-art.el (gnus-article-check-hidden-text): Return t.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34818
diff changeset
3406 (progn
aaf69bc74739 * gnus-art.el (gnus-article-check-hidden-text): Return t.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34818
diff changeset
3407 (gnus-article-show-hidden-text type)
aaf69bc74739 * gnus-art.el (gnus-article-check-hidden-text): Return t.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34818
diff changeset
3408 t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3409 nil)))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3410
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3411 (defun gnus-article-hidden-text-p (type)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3412 "Say whether the current buffer contains hidden text of type TYPE."
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3413 (let ((pos (text-property-any (point-min) (point-max) 'article-type type)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3414 (while (and pos
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3415 (not (get-text-property pos 'invisible))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3416 (not (get-text-property pos 'dummy-invisible)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3417 (setq pos
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3418 (text-property-any (1+ pos) (point-max) 'article-type type)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3419 (if pos
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3420 'hidden
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3421 nil)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3422
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
3423 (defun gnus-article-show-hidden-text (type &optional dummy)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3424 "Show all hidden text of type TYPE.
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
3425 Originally it is hide instead of DUMMY."
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
3426 (let ((inhibit-read-only t)
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
3427 (inhibit-point-motion-hooks t))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
3428 (gnus-remove-text-properties-when
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
3429 'article-type type
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
3430 (point-min) (point-max)
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
3431 (cons 'article-type (cons type
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3432 gnus-hidden-properties)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3433 (gnus-delete-wash-type type)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3434
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3435 (defconst article-time-units
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3436 `((year . ,(* 365.25 24 60 60))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3437 (week . ,(* 7 24 60 60))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3438 (day . ,(* 24 60 60))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3439 (hour . ,(* 60 60))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3440 (minute . 60)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3441 (second . 1))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3442 "Mapping from time units to seconds.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3443
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3444 (defun gnus-article-forward-header ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3445 "Move point to the start of the next header.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3446 If the current header is a continuation header, this can be several
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3447 lines forward."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3448 (let ((ended nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3449 (while (not ended)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3450 (forward-line 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3451 (if (looking-at "[ \t]+[^ \t]")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3452 (forward-line 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3453 (setq ended t)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3454
62099
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3455 (defun article-date-ut (&optional type highlight)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3456 "Convert DATE date to universal time in the current article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3457 If TYPE is `local', convert to local time; if it is `lapsed', output
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3458 how much time has lapsed since DATE. For `lapsed', the value of
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3459 `gnus-article-date-lapsed-new-header' says whether the \"X-Sent:\" header
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3460 should replace the \"Date:\" one, or should be added below it."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3461 (interactive (list 'ut t))
62099
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3462 (let* ((tdate-regexp "^Date:[ \t]\\|^X-Sent:[ \t]")
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3463 (date-regexp (cond ((not gnus-article-date-lapsed-new-header)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3464 tdate-regexp)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3465 ((eq type 'lapsed)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3466 "^X-Sent:[ \t]")
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3467 (article-lapsed-timer
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3468 "^Date:[ \t]")
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3469 (t
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3470 tdate-regexp)))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3471 (case-fold-search t)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3472 (inhibit-read-only t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3473 (inhibit-point-motion-hooks t)
62099
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3474 pos date bface eface)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3475 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3476 (save-restriction
62099
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3477 (widen)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3478 (goto-char (point-min))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3479 (while (or (setq date (get-text-property (setq pos (point))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3480 'original-date))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3481 (when (setq pos (next-single-property-change
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3482 (point) 'original-date))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3483 (setq date (get-text-property pos 'original-date))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3484 t))
101165
a22ed49b5bef Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100934
diff changeset
3485 (narrow-to-region
a22ed49b5bef Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100934
diff changeset
3486 pos (if (setq pos (text-property-any pos (point-max)
a22ed49b5bef Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100934
diff changeset
3487 'original-date nil))
a22ed49b5bef Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100934
diff changeset
3488 (progn
a22ed49b5bef Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100934
diff changeset
3489 (goto-char pos)
a22ed49b5bef Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100934
diff changeset
3490 (if (or (bolp) (eobp))
a22ed49b5bef Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100934
diff changeset
3491 (point)
a22ed49b5bef Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100934
diff changeset
3492 (1+ (point))))
a22ed49b5bef Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100934
diff changeset
3493 (point-max)))
62099
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3494 (goto-char (point-min))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3495 (when (re-search-forward tdate-regexp nil t)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3496 (setq bface (get-text-property (point-at-bol) 'face)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3497 eface (get-text-property (1- (point-at-eol)) 'face)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3498 (goto-char (point-min))
62099
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3499 (setq pos nil)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3500 ;; Delete any old Date headers.
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3501 (while (re-search-forward date-regexp nil t)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3502 (if pos
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3503 (delete-region (point-at-bol) (progn
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3504 (gnus-article-forward-header)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3505 (point)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3506 (delete-region (point-at-bol) (progn
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3507 (gnus-article-forward-header)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3508 (forward-char -1)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3509 (point)))
62099
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3510 (setq pos (point))))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3511 (when (and (not pos)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3512 (re-search-forward tdate-regexp nil t))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3513 (forward-line 1))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3514 (gnus-goto-char pos)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3515 (insert (article-make-date-line date (or type 'ut)))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3516 (unless pos
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3517 (insert "\n")
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3518 (forward-line -1))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3519 ;; Do highlighting.
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3520 (beginning-of-line)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3521 (when (looking-at "\\([^:]+\\): *\\(.*\\)$")
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3522 (put-text-property (match-beginning 1) (1+ (match-end 1))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3523 'face bface)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3524 (put-text-property (match-beginning 2) (match-end 2)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3525 'face eface))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3526 (put-text-property (point-min) (1- (point-max)) 'original-date date)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3527 (goto-char (point-max))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3528 (widen))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3529
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3530 (defun article-make-date-line (date type)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3531 "Return a DATE line of TYPE."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3532 (unless (memq type '(local ut original user iso8601 lapsed english))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3533 (error "Unknown conversion type: %s" type))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3534 (condition-case ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3535 (let ((time (date-to-time date)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3536 (cond
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3537 ;; Convert to the local timezone.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3538 ((eq type 'local)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3539 (concat "Date: " (message-make-date time)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3540 ;; Convert to Universal Time.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3541 ((eq type 'ut)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3542 (concat "Date: "
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3543 (substring
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3544 (message-make-date
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3545 (let* ((e (parse-time-string date))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3546 (tm (apply 'encode-time e))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3547 (ms (car tm))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3548 (ls (- (cadr tm) (car (current-time-zone time)))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3549 (cond ((< ls 0) (list (1- ms) (+ ls 65536)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3550 ((> ls 65535) (list (1+ ms) (- ls 65536)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3551 (t (list ms ls)))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3552 0 -5)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3553 "UT"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3554 ;; Get the original date from the article.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3555 ((eq type 'original)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3556 (concat "Date: " (if (string-match "\n+$" date)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3557 (substring date 0 (match-beginning 0))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3558 date)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3559 ;; Let the user define the format.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3560 ((eq type 'user)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3561 (let ((format (or (condition-case nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3562 (with-current-buffer gnus-summary-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3563 gnus-article-time-format)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3564 (error nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3565 gnus-article-time-format)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3566 (if (functionp format)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3567 (funcall format time)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3568 (concat "Date: " (format-time-string format time)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3569 ;; ISO 8601.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3570 ((eq type 'iso8601)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3571 (let ((tz (car (current-time-zone time))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3572 (concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3573 "Date: "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3574 (format-time-string "%Y%m%dT%H%M%S" time)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3575 (format "%s%02d%02d"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3576 (if (> tz 0) "+" "-") (/ (abs tz) 3600)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3577 (/ (% (abs tz) 3600) 60)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3578 ;; Do an X-Sent lapsed format.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3579 ((eq type 'lapsed)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3580 ;; If the date is seriously mangled, the timezone functions are
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3581 ;; liable to bug out, so we ignore all errors.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3582 (let* ((now (current-time))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3583 (real-time (subtract-time now time))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3584 (real-sec (and real-time
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3585 (+ (* (float (car real-time)) 65536)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3586 (cadr real-time))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3587 (sec (and real-time (abs real-sec)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3588 num prev)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3589 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3590 ((null real-time)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3591 "X-Sent: Unknown")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3592 ((zerop sec)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3593 "X-Sent: Now")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3594 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3595 (concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3596 "X-Sent: "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3597 ;; This is a bit convoluted, but basically we go
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3598 ;; through the time units for years, weeks, etc,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3599 ;; and divide things to see whether that results
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3600 ;; in positive answers.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3601 (mapconcat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3602 (lambda (unit)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3603 (if (zerop (setq num (ffloor (/ sec (cdr unit)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3604 ;; The (remaining) seconds are too few to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3605 ;; be divided into this time unit.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3606 ""
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3607 ;; It's big enough, so we output it.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3608 (setq sec (- sec (* num (cdr unit))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3609 (prog1
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3610 (concat (if prev ", " "") (int-to-string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3611 (floor num))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3612 " " (symbol-name (car unit))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3613 (if (> num 1) "s" ""))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3614 (setq prev t))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3615 article-time-units "")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3616 ;; If dates are odd, then it might appear like the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3617 ;; article was sent in the future.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3618 (if (> real-sec 0)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3619 " ago"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3620 " in the future"))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3621 ;; Display the date in proper English
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3622 ((eq type 'english)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3623 (let ((dtime (decode-time time)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3624 (concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3625 "Date: the "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3626 (number-to-string (nth 3 dtime))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3627 (let ((digit (% (nth 3 dtime) 10)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3628 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3629 ((memq (nth 3 dtime) '(11 12 13)) "th")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3630 ((= digit 1) "st")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3631 ((= digit 2) "nd")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3632 ((= digit 3) "rd")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3633 (t "th")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3634 " of "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3635 (nth (1- (nth 4 dtime)) gnus-english-month-names)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3636 " "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3637 (number-to-string (nth 5 dtime))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3638 " at "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3639 (format "%02d" (nth 2 dtime))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3640 ":"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3641 (format "%02d" (nth 1 dtime)))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3642 (error
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3643 (format "Date: %s (from Gnus)" date))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3644
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3645 (defun article-date-local (&optional highlight)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3646 "Convert the current article date to the local timezone."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3647 (interactive (list t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3648 (article-date-ut 'local highlight))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3649
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3650 (defun article-date-english (&optional highlight)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3651 "Convert the current article date to something that is proper English."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3652 (interactive (list t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3653 (article-date-ut 'english highlight))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3654
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3655 (defun article-date-original (&optional highlight)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3656 "Convert the current article date to what it was originally.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3657 This is only useful if you have used some other date conversion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3658 function and want to see what the date was before converting."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3659 (interactive (list t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3660 (article-date-ut 'original highlight))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3661
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3662 (defun article-date-lapsed (&optional highlight)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3663 "Convert the current article date to time lapsed since it was sent."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3664 (interactive (list t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3665 (article-date-ut 'lapsed highlight))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3666
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3667 (defun article-update-date-lapsed ()
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3668 "Function to be run from a timer to update the lapsed time line."
63026
81ee906cdd23 (article-update-date-lapsed): Use `save-match-data'.
Luc Teirlinck <teirllm@auburn.edu>
parents: 62978
diff changeset
3669 (save-match-data
81ee906cdd23 (article-update-date-lapsed): Use `save-match-data'.
Luc Teirlinck <teirllm@auburn.edu>
parents: 62978
diff changeset
3670 (let (deactivate-mark)
81ee906cdd23 (article-update-date-lapsed): Use `save-match-data'.
Luc Teirlinck <teirllm@auburn.edu>
parents: 62978
diff changeset
3671 (save-excursion
81ee906cdd23 (article-update-date-lapsed): Use `save-match-data'.
Luc Teirlinck <teirllm@auburn.edu>
parents: 62978
diff changeset
3672 (ignore-errors
81ee906cdd23 (article-update-date-lapsed): Use `save-match-data'.
Luc Teirlinck <teirllm@auburn.edu>
parents: 62978
diff changeset
3673 (walk-windows
81ee906cdd23 (article-update-date-lapsed): Use `save-match-data'.
Luc Teirlinck <teirllm@auburn.edu>
parents: 62978
diff changeset
3674 (lambda (w)
81ee906cdd23 (article-update-date-lapsed): Use `save-match-data'.
Luc Teirlinck <teirllm@auburn.edu>
parents: 62978
diff changeset
3675 (set-buffer (window-buffer w))
81ee906cdd23 (article-update-date-lapsed): Use `save-match-data'.
Luc Teirlinck <teirllm@auburn.edu>
parents: 62978
diff changeset
3676 (when (eq major-mode 'gnus-article-mode)
81ee906cdd23 (article-update-date-lapsed): Use `save-match-data'.
Luc Teirlinck <teirllm@auburn.edu>
parents: 62978
diff changeset
3677 (let ((mark (point-marker)))
81ee906cdd23 (article-update-date-lapsed): Use `save-match-data'.
Luc Teirlinck <teirllm@auburn.edu>
parents: 62978
diff changeset
3678 (goto-char (point-min))
81ee906cdd23 (article-update-date-lapsed): Use `save-match-data'.
Luc Teirlinck <teirllm@auburn.edu>
parents: 62978
diff changeset
3679 (when (re-search-forward "^X-Sent:" nil t)
81ee906cdd23 (article-update-date-lapsed): Use `save-match-data'.
Luc Teirlinck <teirllm@auburn.edu>
parents: 62978
diff changeset
3680 (article-date-lapsed t))
81ee906cdd23 (article-update-date-lapsed): Use `save-match-data'.
Luc Teirlinck <teirllm@auburn.edu>
parents: 62978
diff changeset
3681 (goto-char (marker-position mark))
81ee906cdd23 (article-update-date-lapsed): Use `save-match-data'.
Luc Teirlinck <teirllm@auburn.edu>
parents: 62978
diff changeset
3682 (move-marker mark nil))))
81ee906cdd23 (article-update-date-lapsed): Use `save-match-data'.
Luc Teirlinck <teirllm@auburn.edu>
parents: 62978
diff changeset
3683 nil 'visible))))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3684
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3685 (defun gnus-start-date-timer (&optional n)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3686 "Start a timer to update the X-Sent header in the article buffers.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3687 The numerical prefix says how frequently (in seconds) the function
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3688 is to run."
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3689 (interactive "p")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3690 (unless n
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3691 (setq n 1))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3692 (gnus-stop-date-timer)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3693 (setq article-lapsed-timer
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3694 (run-at-time 1 n 'article-update-date-lapsed)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3695
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3696 (defun gnus-stop-date-timer ()
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3697 "Stop the X-Sent timer."
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3698 (interactive)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3699 (when article-lapsed-timer
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3700 (nnheader-cancel-timer article-lapsed-timer)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3701 (setq article-lapsed-timer nil)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3702
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3703 (defun article-date-user (&optional highlight)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3704 "Convert the current article date to the user-defined format.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3705 This format is defined by the `gnus-article-time-format' variable."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3706 (interactive (list t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3707 (article-date-ut 'user highlight))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3708
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3709 (defun article-date-iso8601 (&optional highlight)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3710 "Convert the current article date to ISO8601."
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3711 (interactive (list t))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3712 (article-date-ut 'iso8601 highlight))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3713
62099
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3714 (defmacro gnus-article-save-original-date (&rest forms)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3715 "Save the original date as a text property and evaluate FORMS."
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3716 `(let* ((case-fold-search t)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3717 (start (progn
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3718 (goto-char (point-min))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3719 (when (and (re-search-forward "^date:[\t\n ]+" nil t)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3720 (not (bolp)))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3721 (match-end 0))))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3722 (date (when (and start
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
3723 (re-search-forward "[\t ]*\n\\(?:[^\t ]\\|\\'\\)"
62099
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3724 nil t))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3725 (buffer-substring-no-properties start
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3726 (match-beginning 0)))))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3727 (goto-char (point-max))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3728 (skip-chars-backward "\n")
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3729 (put-text-property (point-min) (point) 'original-date date)
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3730 ,@forms
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3731 (goto-char (point-max))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3732 (skip-chars-backward "\n")
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3733 (put-text-property (point-min) (point) 'original-date date)))
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
3734
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3735 ;; (defun article-show-all ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3736 ;; "Show all hidden text in the article buffer."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3737 ;; (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3738 ;; (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3739 ;; (let ((inhibit-read-only t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3740 ;; (gnus-article-unhide-text (point-min) (point-max)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3741
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3742 (defun article-remove-leading-whitespace ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3743 "Remove excessive whitespace from all headers."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3744 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3745 (save-excursion
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3746 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3747 (let ((inhibit-read-only t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3748 (article-narrow-to-head)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3749 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3750 (while (re-search-forward "^[^ :]+: \\([ \t]+\\)" nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3751 (delete-region (match-beginning 1) (match-end 1)))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3752
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3753 (defun article-emphasize (&optional arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3754 "Emphasize text according to `gnus-emphasis-alist'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3755 (interactive (gnus-article-hidden-arg))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3756 (unless (gnus-article-check-hidden-text 'emphasis arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3757 (save-excursion
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
3758 (let ((alist (or
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3759 (condition-case nil
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
3760 (with-current-buffer gnus-summary-buffer
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
3761 gnus-article-emphasis-alist)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3762 (error))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3763 gnus-emphasis-alist))
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
3764 (inhibit-read-only t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3765 (props (append '(article-type emphasis)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3766 gnus-hidden-properties))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3767 regexp elem beg invisible visible face)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3768 (article-goto-body)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3769 (setq beg (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3770 (while (setq elem (pop alist))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3771 (goto-char beg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3772 (setq regexp (car elem)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3773 invisible (nth 1 elem)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3774 visible (nth 2 elem)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3775 face (nth 3 elem))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3776 (while (re-search-forward regexp nil t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3777 (when (and (match-beginning visible) (match-beginning invisible))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3778 (gnus-article-hide-text
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3779 (match-beginning invisible) (match-end invisible) props)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3780 (gnus-article-unhide-text-type
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3781 (match-beginning visible) (match-end visible) 'emphasis)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3782 (gnus-put-overlay-excluding-newlines
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3783 (match-beginning visible) (match-end visible) 'face face)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3784 (gnus-add-wash-type 'emphasis)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3785 (goto-char (match-end invisible)))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3786
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3787 (defun gnus-article-setup-highlight-words (&optional highlight-words)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3788 "Setup newsgroup emphasis alist."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3789 (unless gnus-article-emphasis-alist
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3790 (let ((name (and gnus-newsgroup-name
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3791 (gnus-group-real-name gnus-newsgroup-name))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3792 (make-local-variable 'gnus-article-emphasis-alist)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
3793 (setq gnus-article-emphasis-alist
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
3794 (nconc
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3795 (let ((alist gnus-group-highlight-words-alist) elem highlight)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3796 (while (setq elem (pop alist))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3797 (when (and name (string-match (car elem) name))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3798 (setq alist nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3799 highlight (copy-sequence (cdr elem)))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3800 highlight)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3801 (copy-sequence highlight-words)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3802 (if gnus-newsgroup-name
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
3803 (copy-sequence (gnus-group-find-parameter
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3804 gnus-newsgroup-name 'highlight-words t)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3805 gnus-emphasis-alist)))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3806
86154
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85888
diff changeset
3807 (defvar gnus-summary-article-menu)
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85888
diff changeset
3808 (defvar gnus-summary-post-menu)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3809
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3810 ;;; Saving functions.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3811
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3812 (defun gnus-article-save (save-buffer file &optional num)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3813 "Save the currently selected article."
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3814 (when (or (get gnus-default-article-saver :headers)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3815 (not gnus-save-all-headers))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3816 ;; Remove headers according to `gnus-saved-headers' or the value
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3817 ;; of the `:headers' property that the saver function might have.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3818 (let ((gnus-visible-headers
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3819 (or (symbol-value (get gnus-default-article-saver :headers))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3820 gnus-saved-headers gnus-visible-headers))
96654
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
3821 ;; Ignore group parameter. See `article-hide-headers'.
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
3822 (gnus-summary-buffer nil))
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
3823 (with-current-buffer save-buffer
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3824 (article-hide-headers 1 t))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3825 (save-window-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3826 (if (not gnus-default-article-saver)
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
3827 (error "No default saver is defined")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3828 ;; !!! Magic! The saving functions all save
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
3829 ;; `gnus-save-article-buffer' (or so they think), but we
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3830 ;; bind that variable to our save-buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3831 (set-buffer gnus-article-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3832 (let* ((gnus-save-article-buffer save-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3833 (filename
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3834 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3835 ((not gnus-prompt-before-saving) 'default)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3836 ((eq gnus-prompt-before-saving 'always) nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3837 (t file)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3838 (gnus-number-of-articles-to-be-saved
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3839 (when (eq gnus-prompt-before-saving t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3840 num))) ; Magic
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3841 (set-buffer gnus-article-current-summary)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3842 (funcall gnus-default-article-saver filename)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3843
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3844 (defun gnus-read-save-file-name (prompt &optional filename
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3845 function group headers variable
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3846 dir-var)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3847 (let ((default-name
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3848 (funcall function group headers (symbol-value variable)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3849 result)
33077
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3850 (setq result
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
3851 (expand-file-name
33077
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3852 (cond
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3853 ((eq filename 'default)
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3854 default-name)
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3855 ((eq filename t)
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3856 default-name)
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3857 (filename filename)
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3858 (t
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3859 (when (symbol-value dir-var)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3860 (setq default-name (expand-file-name
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3861 (file-name-nondirectory default-name)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3862 (symbol-value dir-var))))
33077
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3863 (let* ((split-name (gnus-get-split-value gnus-split-methods))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3864 (prompt
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3865 (format prompt
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3866 (if (and gnus-number-of-articles-to-be-saved
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3867 (> gnus-number-of-articles-to-be-saved 1))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3868 (format "these %d articles"
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3869 gnus-number-of-articles-to-be-saved)
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3870 "this article")))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3871 (file
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3872 ;; Let the split methods have their say.
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3873 (cond
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3874 ;; No split name was found.
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3875 ((null split-name)
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3876 (read-file-name
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3877 (concat prompt " (default "
65682
c16795de963a 2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents: 65616
diff changeset
3878 (file-name-nondirectory default-name) "): ")
33077
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3879 (file-name-directory default-name)
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3880 default-name))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3881 ;; A single group name is returned.
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3882 ((stringp split-name)
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3883 (setq default-name
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3884 (funcall function split-name headers
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3885 (symbol-value variable)))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3886 (read-file-name
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3887 (concat prompt " (default "
65682
c16795de963a 2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents: 65616
diff changeset
3888 (file-name-nondirectory default-name) "): ")
33077
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3889 (file-name-directory default-name)
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3890 default-name))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3891 ;; A single split name was found
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3892 ((= 1 (length split-name))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3893 (let* ((name (expand-file-name
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3894 (car split-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3895 gnus-article-save-directory))
33077
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3896 (dir (cond ((file-directory-p name)
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3897 (file-name-as-directory name))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3898 ((file-exists-p name) name)
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3899 (t gnus-article-save-directory))))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3900 (read-file-name
65682
c16795de963a 2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents: 65616
diff changeset
3901 (concat prompt " (default " name "): ")
33077
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3902 dir name)))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3903 ;; A list of splits was found.
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3904 (t
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3905 (setq split-name (nreverse split-name))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3906 (let (result)
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3907 (let ((file-name-history
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3908 (nconc split-name file-name-history)))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3909 (setq result
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3910 (expand-file-name
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3911 (read-file-name
65682
c16795de963a 2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents: 65616
diff changeset
3912 (concat prompt " (`M-p' for defaults): ")
33077
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3913 gnus-article-save-directory
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3914 (car split-name))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3915 gnus-article-save-directory)))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3916 (car (push result file-name-history)))))))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3917 ;; Create the directory.
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3918 (gnus-make-directory (file-name-directory file))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3919 ;; If we have read a directory, we append the default file name.
33077
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3920 (when (file-directory-p file)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3921 (setq file (expand-file-name (file-name-nondirectory
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3922 default-name)
33077
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3923 (file-name-as-directory file))))
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3924 ;; Possibly translate some characters.
32b7991182cf Fix 2000-10-27 change properly.
Dave Love <fx@gnu.org>
parents: 33003
diff changeset
3925 (nnheader-translate-file-chars file))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3926 (gnus-make-directory (file-name-directory result))
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3927 (when variable
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3928 (set variable result))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3929 (when dir-var
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3930 (set dir-var (file-name-directory result)))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3931 result))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3932
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3933 (defun gnus-article-archive-name (group)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3934 "Return the first instance of an \"Archive-name\" in the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3935 (let ((case-fold-search t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3936 (when (re-search-forward "archive-name: *\\([^ \n\t]+\\)[ \t]*$" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3937 (nnheader-concat gnus-article-save-directory
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3938 (match-string 1)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3939
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3940 (defun gnus-article-nndoc-name (group)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3941 "If GROUP is an nndoc group, return the name of the parent group."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3942 (when (eq (car (gnus-find-method-for-group group)) 'nndoc)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3943 (gnus-group-get-parameter group 'save-article-group)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3944
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3945 (defun gnus-summary-save-in-rmail (&optional filename)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3946 "Append this article to Rmail file.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3947 Optional argument FILENAME specifies file name.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3948 Directory to save to is default to `gnus-article-save-directory'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3949 (setq filename (gnus-read-save-file-name
65682
c16795de963a 2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents: 65616
diff changeset
3950 "Save %s in rmail file" filename
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3951 gnus-rmail-save-name gnus-newsgroup-name
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3952 gnus-current-headers 'gnus-newsgroup-last-rmail))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3953 (gnus-eval-in-buffer-window gnus-save-article-buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3954 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3955 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3956 (widen)
102026
55b8ba83f74b (rmail-output-to-rmail-file): Remove autoload added in previous change.
Glenn Morris <rgm@gnu.org>
parents: 102018
diff changeset
3957 ;; Note that unlike gnus-summary-save-in-mail, there is no
55b8ba83f74b (rmail-output-to-rmail-file): Remove autoload added in previous change.
Glenn Morris <rgm@gnu.org>
parents: 102018
diff changeset
3958 ;; check to see if filename is Babyl. Rmail in Emacs 23 does
55b8ba83f74b (rmail-output-to-rmail-file): Remove autoload added in previous change.
Glenn Morris <rgm@gnu.org>
parents: 102018
diff changeset
3959 ;; not use Babyl.
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3960 (gnus-output-to-rmail filename))))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3961 filename)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3962
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3963 (defun gnus-summary-save-in-mail (&optional filename)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3964 "Append this article to Unix mail file.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3965 Optional argument FILENAME specifies file name.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3966 Directory to save to is default to `gnus-article-save-directory'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3967 (setq filename (gnus-read-save-file-name
65682
c16795de963a 2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents: 65616
diff changeset
3968 "Save %s in Unix mail file" filename
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3969 gnus-mail-save-name gnus-newsgroup-name
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3970 gnus-current-headers 'gnus-newsgroup-last-mail))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3971 (gnus-eval-in-buffer-window gnus-save-article-buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3972 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3973 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3974 (widen)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3975 (if (and (file-readable-p filename)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
3976 (file-regular-p filename)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3977 (mail-file-babyl-p filename))
102026
55b8ba83f74b (rmail-output-to-rmail-file): Remove autoload added in previous change.
Glenn Morris <rgm@gnu.org>
parents: 102018
diff changeset
3978 (gnus-output-to-rmail filename)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3979 (gnus-output-to-mail filename)))))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3980 filename)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3981
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3982 (put 'gnus-summary-save-in-file :decode t)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
3983 (put 'gnus-summary-save-in-file :headers 'gnus-saved-headers)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3984 (defun gnus-summary-save-in-file (&optional filename overwrite)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3985 "Append this article to file.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3986 Optional argument FILENAME specifies file name.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3987 Directory to save to is default to `gnus-article-save-directory'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3988 (setq filename (gnus-read-save-file-name
65682
c16795de963a 2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents: 65616
diff changeset
3989 "Save %s in file" filename
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3990 gnus-file-save-name gnus-newsgroup-name
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3991 gnus-current-headers 'gnus-newsgroup-last-file))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3992 (gnus-eval-in-buffer-window gnus-save-article-buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3993 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3994 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3995 (widen)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3996 (when (and overwrite
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3997 (file-exists-p filename))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3998 (delete-file filename))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
3999 (gnus-output-to-file filename))))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4000 filename)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4001
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4002 (put 'gnus-summary-write-to-file :decode t)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4003 (put 'gnus-summary-write-to-file :function 'gnus-summary-save-in-file)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4004 (put 'gnus-summary-write-to-file :headers 'gnus-saved-headers)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4005 (defun gnus-summary-write-to-file (&optional filename)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4006 "Write this article to a file, overwriting it if the file exists.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4007 Optional argument FILENAME specifies file name.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4008 The directory to save in defaults to `gnus-article-save-directory'."
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4009 (setq filename (gnus-read-save-file-name
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4010 "Save %s in file" filename
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4011 gnus-file-save-name gnus-newsgroup-name
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4012 gnus-current-headers nil 'gnus-newsgroup-last-directory))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4013 (gnus-summary-save-in-file filename t))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4014
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4015 (put 'gnus-summary-save-body-in-file :decode t)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4016 (defun gnus-summary-save-body-in-file (&optional filename overwrite)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4017 "Append this article body to a file.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4018 Optional argument FILENAME specifies file name.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4019 The directory to save in defaults to `gnus-article-save-directory'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4020 (setq filename (gnus-read-save-file-name
65682
c16795de963a 2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents: 65616
diff changeset
4021 "Save %s body in file" filename
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4022 gnus-file-save-name gnus-newsgroup-name
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4023 gnus-current-headers 'gnus-newsgroup-last-file))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4024 (gnus-eval-in-buffer-window gnus-save-article-buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4025 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4026 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4027 (widen)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4028 (when (article-goto-body)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4029 (narrow-to-region (point) (point-max)))
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4030 (when (and overwrite
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4031 (file-exists-p filename))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4032 (delete-file filename))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4033 (gnus-output-to-file filename))))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4034 filename)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4035
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4036 (put 'gnus-summary-write-body-to-file :decode t)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4037 (put 'gnus-summary-write-body-to-file
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4038 :function 'gnus-summary-save-body-in-file)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4039 (defun gnus-summary-write-body-to-file (&optional filename)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4040 "Write this article body to a file, overwriting it if the file exists.
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4041 Optional argument FILENAME specifies file name.
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4042 The directory to save in defaults to `gnus-article-save-directory'."
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4043 (setq filename (gnus-read-save-file-name
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4044 "Save %s body in file" filename
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4045 gnus-file-save-name gnus-newsgroup-name
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4046 gnus-current-headers nil 'gnus-newsgroup-last-directory))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4047 (gnus-summary-save-body-in-file filename t))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
4048
96498
1f27a4bf06f5 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95586
diff changeset
4049 (put 'gnus-summary-save-in-pipe :decode t)
1f27a4bf06f5 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95586
diff changeset
4050 (put 'gnus-summary-save-in-pipe :headers 'gnus-saved-headers)
97033
51b8e9670c45 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96654
diff changeset
4051 (defun gnus-summary-save-in-pipe (&optional command raw)
51b8e9670c45 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96654
diff changeset
4052 "Pipe this article to subprocess COMMAND.
51b8e9670c45 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96654
diff changeset
4053 Valid values for COMMAND include:
51b8e9670c45 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96654
diff changeset
4054 a string
51b8e9670c45 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96654
diff changeset
4055 The executable command name and possibly arguments.
51b8e9670c45 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96654
diff changeset
4056 nil
51b8e9670c45 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96654
diff changeset
4057 You will be prompted for the command in the minibuffer.
51b8e9670c45 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96654
diff changeset
4058 the symbol `default'
51b8e9670c45 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96654
diff changeset
4059 It will be replaced with the command which the variable
51b8e9670c45 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96654
diff changeset
4060 `gnus-summary-pipe-output-default-command' holds or the command
51b8e9670c45 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96654
diff changeset
4061 last used for saving.
51b8e9670c45 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96654
diff changeset
4062 Non-nil value for RAW overrides `:decode' and `:headers' properties
51b8e9670c45 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96654
diff changeset
4063 and the raw article including all headers will be piped."
97350
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4064 (let ((article (gnus-summary-article-number))
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4065 (decode (unless raw
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4066 (get 'gnus-summary-save-in-pipe :decode)))
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4067 save-buffer default)
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4068 (if article
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4069 (if (vectorp (gnus-summary-article-header article))
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4070 (save-current-buffer
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4071 (gnus-summary-select-article decode decode nil article)
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4072 (insert-buffer-substring
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4073 (prog1
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4074 (if decode
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4075 gnus-article-buffer
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4076 gnus-original-article-buffer)
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4077 (setq save-buffer
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4078 (nnheader-set-temp-buffer " *Gnus Save*"))))
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4079 ;; Remove unwanted headers.
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4080 (when (and (not raw)
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4081 (or (get 'gnus-summary-save-in-pipe :headers)
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4082 (not gnus-save-all-headers)))
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4083 (let ((gnus-visible-headers
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4084 (or (symbol-value (get 'gnus-summary-save-in-pipe
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4085 :headers))
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4086 gnus-saved-headers gnus-visible-headers))
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4087 (gnus-summary-buffer nil))
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4088 (article-hide-headers 1 t))))
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4089 (error "%d is not a real article" article))
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4090 (error "No article to pipe"))
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4091 (setq default (or gnus-summary-pipe-output-default-command
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4092 gnus-last-shell-command))
96498
1f27a4bf06f5 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95586
diff changeset
4093 (unless (stringp command)
1f27a4bf06f5 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95586
diff changeset
4094 (setq command
1f27a4bf06f5 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95586
diff changeset
4095 (if (and (eq command 'default) default)
1f27a4bf06f5 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95586
diff changeset
4096 default
97350
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4097 (gnus-read-shell-command "Shell command on this article: "
f0689cd563e3 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97033
diff changeset
4098 default))))
96498
1f27a4bf06f5 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95586
diff changeset
4099 (when (string-equal command "")
1f27a4bf06f5 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95586
diff changeset
4100 (if default
1f27a4bf06f5 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95586
diff changeset
4101 (setq command default)
96654
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
4102 (error "A command is required")))
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
4103 (gnus-eval-in-buffer-window save-buffer
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
4104 (save-restriction
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
4105 (widen)
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
4106 (shell-command-on-region (point-min) (point-max) command nil)))
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
4107 (gnus-kill-buffer save-buffer))
96498
1f27a4bf06f5 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95586
diff changeset
4108 (setq gnus-summary-pipe-output-default-command command))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4109
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4110 (defun gnus-summary-pipe-to-muttprint (&optional command)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4111 "Pipe this article to muttprint."
96654
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
4112 (unless (stringp command)
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
4113 (setq command (read-string
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
4114 "Print using command: " gnus-summary-muttprint-program
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
4115 nil gnus-summary-muttprint-program)))
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
4116 (let ((gnus-summary-pipe-output-default-command
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
4117 gnus-summary-pipe-output-default-command))
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
4118 (gnus-summary-save-in-pipe command))
0b339c48424c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 96498
diff changeset
4119 (setq gnus-summary-muttprint-program command))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4120
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4121 ;;; Article file names when saving.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4122
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4123 (defun gnus-capitalize-newsgroup (newsgroup)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4124 "Capitalize NEWSGROUP name."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4125 (when (not (zerop (length newsgroup)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4126 (concat (char-to-string (upcase (aref newsgroup 0)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4127 (substring newsgroup 1))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4128
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4129 (defun gnus-Numeric-save-name (newsgroup headers &optional last-file)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4130 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4131 If variable `gnus-use-long-file-name' is non-nil, it is ~/News/News.group/num.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4132 Otherwise, it is like ~/News/news/group/num."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4133 (let ((default
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4134 (expand-file-name
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4135 (concat (if (gnus-use-long-file-name 'not-save)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4136 (gnus-capitalize-newsgroup newsgroup)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4137 (gnus-newsgroup-directory-form newsgroup))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4138 "/" (int-to-string (mail-header-number headers)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4139 gnus-article-save-directory)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4140 (if (and last-file
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4141 (string-equal (file-name-directory default)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4142 (file-name-directory last-file))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4143 (string-match "^[0-9]+$" (file-name-nondirectory last-file)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4144 default
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4145 (or last-file default))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4146
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4147 (defun gnus-numeric-save-name (newsgroup headers &optional last-file)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4148 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4149 If variable `gnus-use-long-file-name' is non-nil, it is
74151
a74b0c78f3ac (gnus-article-x-face-command, gnus-numeric-save-name):
Juanma Barranquero <lekktu@gmail.com>
parents: 73627
diff changeset
4150 ~/News/news.group/num. Otherwise, it is like ~/News/news/group/num."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4151 (let ((default
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4152 (expand-file-name
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4153 (concat (if (gnus-use-long-file-name 'not-save)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4154 newsgroup
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4155 (gnus-newsgroup-directory-form newsgroup))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4156 "/" (int-to-string (mail-header-number headers)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4157 gnus-article-save-directory)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4158 (if (and last-file
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4159 (string-equal (file-name-directory default)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4160 (file-name-directory last-file))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4161 (string-match "^[0-9]+$" (file-name-nondirectory last-file)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4162 default
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4163 (or last-file default))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4164
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4165 (defun gnus-plain-save-name (newsgroup headers &optional last-file)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4166 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4167 If variable `gnus-use-long-file-name' is non-nil, it is
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4168 ~/News/news.group. Otherwise, it is like ~/News/news/group/news."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4169 (or last-file
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4170 (expand-file-name
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4171 (if (gnus-use-long-file-name 'not-save)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4172 newsgroup
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4173 (file-relative-name
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4174 (expand-file-name "news" (gnus-newsgroup-directory-form newsgroup))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4175 default-directory))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4176 gnus-article-save-directory)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4177
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4178 (defun gnus-sender-save-name (newsgroup headers &optional last-file)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4179 "Generate file name from sender."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4180 (let ((from (mail-header-from headers)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4181 (expand-file-name
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4182 (if (and from (string-match "\\([^ <]+\\)@" from))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4183 (match-string 1 from)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4184 "nobody")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4185 gnus-article-save-directory)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4186
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4187 (defun article-verify-x-pgp-sig ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4188 "Verify X-PGP-Sig."
87300
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
4189 ;; <ftp://ftp.isc.org/pub/pgpcontrol/FORMAT>
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4190 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4191 (if (gnus-buffer-live-p gnus-original-article-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4192 (let ((sig (with-current-buffer gnus-original-article-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4193 (gnus-fetch-field "X-PGP-Sig")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4194 items info headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4195 (when (and sig
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4196 mml2015-use
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4197 (mml2015-clear-verify-function))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4198 (with-temp-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4199 (insert-buffer-substring gnus-original-article-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4200 (setq items (split-string sig))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4201 (message-narrow-to-head)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4202 (let ((inhibit-point-motion-hooks t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4203 (case-fold-search t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4204 ;; Don't verify multiple headers.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4205 (setq headers (mapconcat (lambda (header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4206 (concat header ": "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4207 (mail-fetch-field header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4208 "\n"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4209 (split-string (nth 1 items) ",") "")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4210 (delete-region (point-min) (point-max))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4211 (insert "-----BEGIN PGP SIGNED MESSAGE-----\n\n")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4212 (insert "X-Signed-Headers: " (nth 1 items) "\n")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4213 (insert headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4214 (widen)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4215 (forward-line)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4216 (while (not (eobp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4217 (if (looking-at "^-")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4218 (insert "- "))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4219 (forward-line))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4220 (insert "\n-----BEGIN PGP SIGNATURE-----\n")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4221 (insert "Version: " (car items) "\n\n")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4222 (insert (mapconcat 'identity (cddr items) "\n"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4223 (insert "\n-----END PGP SIGNATURE-----\n")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4224 (let ((mm-security-handle (list (format "multipart/signed"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4225 (mml2015-clean-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4226 (let ((coding-system-for-write (or gnus-newsgroup-charset
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4227 'iso-8859-1)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4228 (funcall (mml2015-clear-verify-function)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4229 (setq info
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4230 (or (mm-handle-multipart-ctl-parameter
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4231 mm-security-handle 'gnus-details)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4232 (mm-handle-multipart-ctl-parameter
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4233 mm-security-handle 'gnus-info)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4234 (when info
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4235 (let ((inhibit-read-only t) bface eface)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4236 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4237 (message-narrow-to-head)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4238 (goto-char (point-max))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4239 (forward-line -1)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4240 (setq bface (get-text-property (point-at-bol) 'face)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4241 eface (get-text-property (1- (point-at-eol)) 'face))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4242 (message-remove-header "X-Gnus-PGP-Verify")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4243 (if (re-search-forward "^X-PGP-Sig:" nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4244 (forward-line)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4245 (goto-char (point-max)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4246 (narrow-to-region (point) (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4247 (insert "X-Gnus-PGP-Verify: " info "\n")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4248 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4249 (forward-line)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4250 (while (not (eobp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4251 (if (not (looking-at "^[ \t]"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4252 (insert " "))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4253 (forward-line))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4254 ;; Do highlighting.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4255 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4256 (when (looking-at "\\([^:]+\\): *")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4257 (put-text-property (match-beginning 1) (1+ (match-end 1))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4258 'face bface)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4259 (put-text-property (match-end 0) (point-max)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4260 'face eface)))))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4261
107473
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107217
diff changeset
4262 (autoload 'canlock-verify "canlock" nil t) ;; for Emacs 21.
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107217
diff changeset
4263
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4264 (defun article-verify-cancel-lock ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4265 "Verify Cancel-Lock header."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4266 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4267 (if (gnus-buffer-live-p gnus-original-article-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4268 (canlock-verify gnus-original-article-buffer)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4269
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4270 (eval-and-compile
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4271 (mapc
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4272 (lambda (func)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4273 (let (afunc gfunc)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4274 (if (consp func)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4275 (setq afunc (car func)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4276 gfunc (cdr func))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4277 (setq afunc func
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4278 gfunc (intern (format "gnus-%s" func))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4279 (defalias gfunc
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4280 (when (fboundp afunc)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4281 `(lambda (&optional interactive &rest args)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4282 ,(documentation afunc t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4283 (interactive (list t))
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
4284 (with-current-buffer gnus-article-buffer
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4285 (if interactive
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4286 (call-interactively ',afunc)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4287 (apply ',afunc args))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4288 '(article-hide-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4289 article-verify-x-pgp-sig
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4290 article-verify-cancel-lock
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4291 article-hide-boring-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4292 article-treat-overstrike
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4293 article-treat-ansi-sequences
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4294 article-fill-long-lines
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4295 article-capitalize-sentences
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4296 article-remove-cr
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4297 article-remove-leading-whitespace
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4298 article-display-x-face
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4299 article-display-face
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4300 article-de-quoted-unreadable
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4301 article-de-base64-unreadable
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4302 article-decode-HZ
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4303 article-wash-html
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4304 article-unsplit-urls
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4305 article-hide-list-identifiers
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4306 article-strip-banner
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4307 article-babel
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4308 article-hide-pem
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4309 article-hide-signature
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4310 article-strip-headers-in-body
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4311 article-remove-trailing-blank-lines
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4312 article-strip-leading-blank-lines
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4313 article-strip-multiple-blank-lines
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4314 article-strip-leading-space
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4315 article-strip-trailing-space
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4316 article-strip-blank-lines
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4317 article-strip-all-blank-lines
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4318 article-date-local
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4319 article-date-english
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4320 article-date-iso8601
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4321 article-date-original
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4322 article-date-ut
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4323 article-decode-mime-words
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4324 article-decode-charset
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4325 article-decode-encoded-words
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4326 article-date-user
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4327 article-date-lapsed
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4328 article-emphasize
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4329 article-treat-dumbquotes
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4330 article-normalize-headers
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4331 ;;(article-show-all . gnus-article-show-all-headers)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4332 )))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4333
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4334 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4335 ;;; Gnus article mode
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4336 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4337
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4338 (put 'gnus-article-mode 'mode-class 'special)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4339
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4340 (set-keymap-parent gnus-article-mode-map widget-keymap)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4341
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4342 (gnus-define-keys gnus-article-mode-map
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4343 " " gnus-article-goto-next-page
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4344 "\177" gnus-article-goto-prev-page
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4345 [delete] gnus-article-goto-prev-page
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4346 [backspace] gnus-article-goto-prev-page
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4347 "\C-c^" gnus-article-refer-article
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4348 "h" gnus-article-show-summary
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4349 "s" gnus-article-show-summary
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4350 "\C-c\C-m" gnus-article-mail
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4351 "?" gnus-article-describe-briefly
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4352 "<" beginning-of-buffer
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4353 ">" end-of-buffer
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4354 "\C-c\C-i" gnus-info-find-node
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4355 "\C-c\C-b" gnus-bug
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4356 "R" gnus-article-reply-with-original
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4357 "F" gnus-article-followup-with-original
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
4358 "\C-hk" gnus-article-describe-key
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
4359 "\C-hc" gnus-article-describe-key-briefly
87859
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
4360 "\C-hb" gnus-article-describe-bindings
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4361
104068
a86fc864e9fc Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 103352
diff changeset
4362 "e" gnus-article-read-summary-keys
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4363 "\C-d" gnus-article-read-summary-keys
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4364 "\M-*" gnus-article-read-summary-keys
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4365 "\M-#" gnus-article-read-summary-keys
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4366 "\M-^" gnus-article-read-summary-keys
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4367 "\M-g" gnus-article-read-summary-keys)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4368
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4369 (substitute-key-definition
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
4370 'undefined 'gnus-article-read-summary-keys gnus-article-mode-map)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4371
87696
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
4372 (gnus-define-keys (gnus-article-send-map "S" gnus-article-mode-map)
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
4373 "W" gnus-article-wide-reply-with-original)
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
4374 (if (featurep 'xemacs)
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
4375 (set-keymap-default-binding gnus-article-send-map
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
4376 'gnus-article-read-summary-send-keys)
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
4377 (define-key gnus-article-send-map [t] 'gnus-article-read-summary-send-keys))
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
4378
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4379 (defun gnus-article-make-menu-bar ()
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4380 (unless (boundp 'gnus-article-commands-menu)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4381 (gnus-summary-make-menu-bar))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4382 (gnus-turn-off-edit-menu 'article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4383 (unless (boundp 'gnus-article-article-menu)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4384 (easy-menu-define
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4385 gnus-article-article-menu gnus-article-mode-map ""
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4386 '("Article"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4387 ["Scroll forwards" gnus-article-goto-next-page t]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4388 ["Scroll backwards" gnus-article-goto-prev-page t]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4389 ["Show summary" gnus-article-show-summary t]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4390 ["Fetch Message-ID at point" gnus-article-refer-article t]
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4391 ["Mail to address at point" gnus-article-mail t]
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4392 ["Send a bug report" gnus-bug t]))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4393
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4394 (easy-menu-define
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4395 gnus-article-treatment-menu gnus-article-mode-map ""
33691
936c632692fd (gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents: 33397
diff changeset
4396 ;; Fixme: this should use :active (and maybe :visible).
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4397 '("Treatment"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4398 ["Hide headers" gnus-article-hide-headers t]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4399 ["Hide signature" gnus-article-hide-signature t]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4400 ["Hide citation" gnus-article-hide-citation t]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4401 ["Treat overstrike" gnus-article-treat-overstrike t]
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4402 ["Treat ANSI sequences" gnus-article-treat-ansi-sequences t]
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4403 ["Remove carriage return" gnus-article-remove-cr t]
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4404 ["Remove leading whitespace" gnus-article-remove-leading-whitespace t]
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4405 ["Remove quoted-unreadable" gnus-article-de-quoted-unreadable t]
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4406 ["Remove base64" gnus-article-de-base64-unreadable t]
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4407 ["Treat html" gnus-article-wash-html t]
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4408 ["Remove newlines from within URLs" gnus-article-unsplit-urls t]
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4409 ["Decode HZ" gnus-article-decode-HZ t]))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4410
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4411 ;; Note "Commands" menu is defined in gnus-sum.el for consistency
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4412
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4413 ;; Note "Post" menu is defined in gnus-sum.el for consistency
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4414
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4415 (gnus-run-hooks 'gnus-article-menu-hook)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4416
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4417 (defun gnus-article-mode ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4418 "Major mode for displaying an article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4419
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4420 All normal editing commands are switched off.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4421
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4422 The following commands are available in addition to all summary mode
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4423 commands:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4424 \\<gnus-article-mode-map>
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4425 \\[gnus-article-next-page]\t Scroll the article one page forwards
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4426 \\[gnus-article-prev-page]\t Scroll the article one page backwards
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4427 \\[gnus-article-refer-article]\t Go to the article referred to by an article id near point
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4428 \\[gnus-article-show-summary]\t Display the summary buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4429 \\[gnus-article-mail]\t Send a reply to the address near point
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4430 \\[gnus-article-describe-briefly]\t Describe the current mode briefly
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4431 \\[gnus-info-find-node]\t Go to the Gnus info node"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4432 (interactive)
63689
376c123a5378 (gnus-article-mode): Use kill-all-local-variables.
Lute Kamstra <lute@gnu.org>
parents: 63491
diff changeset
4433 (kill-all-local-variables)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4434 (gnus-simplify-mode-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4435 (setq mode-name "Article")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4436 (setq major-mode 'gnus-article-mode)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4437 (make-local-variable 'minor-mode-alist)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4438 (use-local-map gnus-article-mode-map)
35957
a35d9c07d074 2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 35838
diff changeset
4439 (when (gnus-visual-p 'article-menu 'menu)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4440 (gnus-article-make-menu-bar)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4441 (when gnus-summary-tool-bar-map
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4442 (set (make-local-variable 'tool-bar-map) gnus-summary-tool-bar-map)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4443 (gnus-update-format-specifications nil 'article-mode)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4444 (set (make-local-variable 'page-delimiter) gnus-page-delimiter)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4445 (set (make-local-variable 'gnus-page-broken) nil)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4446 (make-local-variable 'gnus-button-marker-list)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4447 (make-local-variable 'gnus-article-current-summary)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4448 (make-local-variable 'gnus-article-mime-handles)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4449 (make-local-variable 'gnus-article-decoded-p)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4450 (make-local-variable 'gnus-article-mime-handle-alist)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4451 (make-local-variable 'gnus-article-wash-types)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4452 (make-local-variable 'gnus-article-image-alist)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4453 (make-local-variable 'gnus-article-charset)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4454 (make-local-variable 'gnus-article-ignored-charsets)
78006
a8c400af8ac9 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 77979
diff changeset
4455 ;; Prevent Emacs 22 from displaying non-break space with `nobreak-space'
a8c400af8ac9 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 77979
diff changeset
4456 ;; face.
63738
aa5963346291 (gnus-article-mode): Set `nobreak-char-display', not `show-nonbreak-escape'.
Juanma Barranquero <lekktu@gmail.com>
parents: 63689
diff changeset
4457 (set (make-local-variable 'nobreak-char-display) nil)
70044
027c07dcdee5 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-225
Miles Bader <miles@gnu.org>
parents: 69949
diff changeset
4458 (setq cursor-in-non-selected-windows nil)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4459 (setq truncate-lines gnus-article-truncate-lines)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4460 (gnus-set-default-directory)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4461 (buffer-disable-undo)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4462 (setq buffer-read-only t
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4463 show-trailing-whitespace nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4464 (set-syntax-table gnus-article-mode-syntax-table)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4465 (mm-enable-multibyte)
62890
4b7fa3ee8e9e Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-336
Miles Bader <miles@gnu.org>
parents: 62755
diff changeset
4466 (gnus-run-mode-hooks 'gnus-article-mode-hook))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4467
72673
afe113527b71 (gnus-button-regexp, gnus-button-marker-list)
Reiner Steib <Reiner.Steib@gmx.de>
parents: 72653
diff changeset
4468 (defvar gnus-button-marker-list nil
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4469 "Regexp matching any of the regexps from `gnus-button-alist'.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4470 Internal variable.")
72673
afe113527b71 (gnus-button-regexp, gnus-button-marker-list)
Reiner Steib <Reiner.Steib@gmx.de>
parents: 72653
diff changeset
4471
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4472 (defun gnus-article-setup-buffer ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4473 "Initialize the article buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4474 (let* ((name (if gnus-single-article-buffer "*Article*"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4475 (concat "*Article " gnus-newsgroup-name "*")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4476 (original
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4477 (progn (string-match "\\*Article" name)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4478 (concat " *Original Article"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4479 (substring name (match-end 0))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4480 (setq gnus-article-buffer name)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4481 (setq gnus-original-article-buffer original)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4482 (setq gnus-article-mime-handle-alist nil)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4483 (with-current-buffer gnus-summary-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4484 ;; This might be a variable local to the summary buffer.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4485 (unless gnus-single-article-buffer
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4486 (setq gnus-article-buffer name)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4487 (setq gnus-original-article-buffer original)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4488 (gnus-set-global-variables)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4489 (gnus-article-setup-highlight-words)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4490 ;; Init original article buffer.
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
4491 (with-current-buffer (gnus-get-buffer-create gnus-original-article-buffer)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4492 (mm-enable-multibyte)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4493 (setq major-mode 'gnus-original-article-mode)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4494 (make-local-variable 'gnus-original-article))
59764
472e5513512f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-58
Miles Bader <miles@gnu.org>
parents: 58857
diff changeset
4495 (if (and (get-buffer name)
472e5513512f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-58
Miles Bader <miles@gnu.org>
parents: 58857
diff changeset
4496 (with-current-buffer name
472e5513512f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-58
Miles Bader <miles@gnu.org>
parents: 58857
diff changeset
4497 (if gnus-article-edit-mode
472e5513512f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-58
Miles Bader <miles@gnu.org>
parents: 58857
diff changeset
4498 (if (y-or-n-p "Article mode edit in progress; discard? ")
472e5513512f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-58
Miles Bader <miles@gnu.org>
parents: 58857
diff changeset
4499 (progn
472e5513512f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-58
Miles Bader <miles@gnu.org>
parents: 58857
diff changeset
4500 (set-buffer-modified-p nil)
472e5513512f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-58
Miles Bader <miles@gnu.org>
parents: 58857
diff changeset
4501 (gnus-kill-buffer name)
472e5513512f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-58
Miles Bader <miles@gnu.org>
parents: 58857
diff changeset
4502 (message "")
472e5513512f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-58
Miles Bader <miles@gnu.org>
parents: 58857
diff changeset
4503 nil)
472e5513512f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-58
Miles Bader <miles@gnu.org>
parents: 58857
diff changeset
4504 (error "Action aborted"))
472e5513512f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-58
Miles Bader <miles@gnu.org>
parents: 58857
diff changeset
4505 t)))
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
4506 (with-current-buffer name
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4507 (set (make-local-variable 'gnus-article-edit-mode) nil)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4508 (when gnus-article-mime-handles
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4509 (mm-destroy-parts gnus-article-mime-handles)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4510 (setq gnus-article-mime-handles nil))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4511 ;; Set it to nil in article-buffer!
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
4512 (setq gnus-article-mime-handle-alist nil)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4513 (buffer-disable-undo)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4514 (setq buffer-read-only t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4515 ;; This list just keeps growing if we don't reset it.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4516 (setq gnus-button-marker-list nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4517 (unless (eq major-mode 'gnus-article-mode)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4518 (gnus-article-mode))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4519 (current-buffer))
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
4520 (with-current-buffer (gnus-get-buffer-create name)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4521 (gnus-article-mode)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4522 (make-local-variable 'gnus-summary-buffer)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4523 (setq gnus-summary-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4524 (gnus-summary-buffer-name gnus-newsgroup-name))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4525 (gnus-summary-set-local-parameters gnus-newsgroup-name)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4526 (current-buffer)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4527
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4528 ;; Set article window start at LINE, where LINE is the number of lines
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4529 ;; from the head of the article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4530 (defun gnus-article-set-window-start (&optional line)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4531 (let ((article-window (gnus-get-buffer-window gnus-article-buffer t)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4532 (when article-window
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4533 (set-window-start
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4534 article-window
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
4535 (with-current-buffer gnus-article-buffer
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4536 (goto-char (point-min))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4537 (if (not line)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4538 (point-min)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4539 (gnus-message 6 "Moved to bookmark")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4540 (search-forward "\n\n" nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4541 (forward-line line)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4542 (point)))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4543
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4544 (defun gnus-article-prepare (article &optional all-headers header)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4545 "Prepare ARTICLE in article mode buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4546 ARTICLE should either be an article number or a Message-ID.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4547 If ARTICLE is an id, HEADER should be the article headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4548 If ALL-HEADERS is non-nil, no headers are hidden."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4549 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4550 ;; Make sure we start in a summary buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4551 (unless (eq major-mode 'gnus-summary-mode)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4552 (set-buffer gnus-summary-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4553 (setq gnus-summary-buffer (current-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4554 (let* ((gnus-article (if header (mail-header-number header) article))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4555 (summary-buffer (current-buffer))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4556 (gnus-tmp-internal-hook gnus-article-internal-prepare-hook)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4557 (group gnus-newsgroup-name)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4558 result)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4559 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4560 (gnus-article-setup-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4561 (set-buffer gnus-article-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4562 ;; Deactivate active regions.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4563 (when (and (boundp 'transient-mark-mode)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4564 transient-mark-mode)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4565 (setq mark-active nil))
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
4566 (if (not (setq result (let ((inhibit-read-only t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4567 (gnus-request-article-this-buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4568 article group))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4569 ;; There is no such article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4570 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4571 (when (and (numberp article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4572 (not (memq article gnus-newsgroup-sparse)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4573 (setq gnus-article-current
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4574 (cons gnus-newsgroup-name article))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4575 (set-buffer gnus-summary-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4576 (setq gnus-current-article article)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4577 (if (and (memq article gnus-newsgroup-undownloaded)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4578 (not (gnus-online (gnus-find-method-for-group
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4579 gnus-newsgroup-name))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4580 (progn
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4581 (gnus-summary-set-agent-mark article)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4582 (message "Message marked for downloading"))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4583 (gnus-summary-mark-article article gnus-canceled-mark)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4584 (unless (memq article gnus-newsgroup-sparse)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4585 (gnus-error 1 "No such article (may have expired or been canceled)")))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4586 (if (or (eq result 'pseudo)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4587 (eq result 'nneething))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4588 (progn
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
4589 (with-current-buffer summary-buffer
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4590 (push article gnus-newsgroup-history)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4591 (setq gnus-last-article gnus-current-article
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4592 gnus-current-article 0
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4593 gnus-current-headers nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4594 gnus-article-current nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4595 (if (eq result 'nneething)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4596 (gnus-configure-windows 'summary)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4597 (gnus-configure-windows 'article))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4598 (gnus-set-global-variables))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4599 (let ((gnus-article-mime-handle-alist-1
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4600 gnus-article-mime-handle-alist))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4601 (gnus-set-mode-line 'article)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4602 ;; The result from the `request' was an actual article -
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4603 ;; or at least some text that is now displayed in the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4604 ;; article buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4605 (when (and (numberp article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4606 (not (eq article gnus-current-article)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4607 ;; Seems like a new article has been selected.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4608 ;; `gnus-current-article' must be an article number.
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
4609 (with-current-buffer summary-buffer
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4610 (push article gnus-newsgroup-history)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4611 (setq gnus-last-article gnus-current-article
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4612 gnus-current-article article
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4613 gnus-current-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4614 (gnus-summary-article-header gnus-current-article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4615 gnus-article-current
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4616 (cons gnus-newsgroup-name gnus-current-article))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4617 (unless (vectorp gnus-current-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4618 (setq gnus-current-headers nil))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4619 (gnus-summary-goto-subject gnus-current-article)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4620 (when (gnus-summary-show-thread)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4621 ;; If the summary buffer really was folded, the
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4622 ;; previous goto may not actually have gone to
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4623 ;; the right article, but the thread root instead.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4624 ;; So we go again.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4625 (gnus-summary-goto-subject gnus-current-article))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4626 (gnus-run-hooks 'gnus-mark-article-hook)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4627 (gnus-set-mode-line 'summary)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4628 (when (gnus-visual-p 'article-highlight 'highlight)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4629 (gnus-run-hooks 'gnus-visual-mark-article-hook))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4630 ;; Set the global newsgroup variables here.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4631 (gnus-set-global-variables)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4632 (setq gnus-have-all-headers
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
4633 (or all-headers gnus-show-all-headers))))
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
4634 (save-excursion
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
4635 (gnus-configure-windows 'article))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4636 (when (or (numberp article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4637 (stringp article))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4638 (gnus-article-prepare-display)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4639 ;; Do page break.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4640 (goto-char (point-min))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4641 (when gnus-break-pages
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4642 (gnus-narrow-to-page)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4643 (let ((gnus-article-mime-handle-alist-1
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4644 gnus-article-mime-handle-alist))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4645 (gnus-set-mode-line 'article))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4646 (article-goto-body)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4647 (unless (bobp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4648 (forward-line -1))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4649 (set-window-point (get-buffer-window (current-buffer)) (point))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4650 (gnus-configure-windows 'article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4651 t))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4652
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4653 ;;;###autoload
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4654 (defun gnus-article-prepare-display ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4655 "Make the current buffer look like a nice article."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4656 ;; Hooks for getting information from the article.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4657 ;; This hook must be called before being narrowed.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4658 (let ((gnus-article-buffer (current-buffer))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4659 buffer-read-only
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4660 (inhibit-read-only t))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4661 (unless (eq major-mode 'gnus-article-mode)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4662 (gnus-article-mode))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4663 (setq buffer-read-only nil
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4664 gnus-article-wash-types nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4665 gnus-article-image-alist nil)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4666 (gnus-run-hooks 'gnus-tmp-internal-hook)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4667 (when gnus-display-mime-function
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4668 (funcall gnus-display-mime-function))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4669 (gnus-run-hooks 'gnus-article-prepare-hook)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4670
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4671 ;;;
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4672 ;;; Gnus Sticky Article Mode
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4673 ;;;
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4674
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4675 (define-derived-mode gnus-sticky-article-mode gnus-article-mode "StickyArticle"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4676 "Mode for sticky articles."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4677 ;; Release bindings that won't work.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4678 (substitute-key-definition 'gnus-article-read-summary-keys 'undefined
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4679 gnus-sticky-article-mode-map)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4680 (substitute-key-definition 'gnus-article-refer-article 'undefined
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4681 gnus-sticky-article-mode-map)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4682 (dolist (k '("e" "h" "s" "F" "R"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4683 (define-key gnus-sticky-article-mode-map k nil))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4684 (define-key gnus-sticky-article-mode-map "k" 'gnus-kill-sticky-article-buffer)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4685 (define-key gnus-sticky-article-mode-map "q" 'bury-buffer)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4686 (define-key gnus-sticky-article-mode-map "\C-hc" 'describe-key-briefly)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4687 (define-key gnus-sticky-article-mode-map "\C-hk" 'describe-key))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4688
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4689 (defun gnus-sticky-article (arg)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4690 "Make the current article sticky.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4691 If a prefix ARG is given, ask for a name for this sticky article buffer."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4692 (interactive "P")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4693 (gnus-summary-show-thread)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4694 (gnus-summary-select-article nil nil 'pseudo)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4695 (let (new-art-buf-name)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4696 (gnus-eval-in-buffer-window gnus-article-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4697 (setq new-art-buf-name
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4698 (concat
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4699 "*Sticky Article: "
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4700 (if arg
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4701 (read-from-minibuffer "Sticky article buffer name: ")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4702 (gnus-with-article-headers
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4703 (gnus-article-goto-header "subject")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4704 (setq new-art-buf-name
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4705 (buffer-substring-no-properties
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4706 (line-beginning-position) (line-end-position)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4707 (goto-char (point-min))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4708 (gnus-article-goto-header "from")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4709 (setq new-art-buf-name
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4710 (concat
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4711 new-art-buf-name ", "
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4712 (buffer-substring-no-properties
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4713 (line-beginning-position) (line-end-position))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4714 (goto-char (point-min))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4715 (gnus-article-goto-header "date")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4716 (setq new-art-buf-name
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4717 (concat
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4718 new-art-buf-name ", "
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4719 (buffer-substring-no-properties
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4720 (line-beginning-position) (line-end-position))))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4721 "*"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4722 (if (and (gnus-buffer-live-p new-art-buf-name)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4723 (with-current-buffer new-art-buf-name
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4724 (eq major-mode 'gnus-sticky-article-mode)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4725 (switch-to-buffer new-art-buf-name)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4726 (setq new-art-buf-name (rename-buffer new-art-buf-name t)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4727 (gnus-sticky-article-mode))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4728 (setq gnus-article-buffer new-art-buf-name))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4729 (gnus-summary-recenter)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4730 (gnus-summary-position-point))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4731
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4732 (defun gnus-kill-sticky-article-buffer (&optional buffer)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4733 "Kill the given sticky article BUFFER.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4734 If none is given, assume the current buffer and kill it if it has
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4735 `gnus-sticky-article-mode'."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4736 (interactive)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4737 (unless buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4738 (setq buffer (current-buffer)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4739 (with-current-buffer buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4740 (when (eq major-mode 'gnus-sticky-article-mode)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4741 (gnus-kill-buffer buffer))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4742
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4743 (defun gnus-kill-sticky-article-buffers (arg)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4744 "Kill all sticky article buffers.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4745 If a prefix ARG is given, ask for confirmation."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4746 (interactive "P")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4747 (dolist (buf (gnus-buffers))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4748 (with-current-buffer buf
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4749 (when (eq major-mode 'gnus-sticky-article-mode)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4750 (if (not arg)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4751 (gnus-kill-buffer buf)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4752 (when (yes-or-no-p (concat "Kill buffer " (buffer-name buf) "? "))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4753 (gnus-kill-buffer buf)))))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4754
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4755 ;;;
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4756 ;;; Gnus MIME viewing functions
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4757 ;;;
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4758
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4759 (defvar gnus-mime-button-line-format "%{%([%p. %d%T]%)%}%e\n"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4760 "Format of the MIME buttons.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4761
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4762 Valid specifiers include:
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4763 %t The MIME type
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4764 %T MIME type, along with additional info
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4765 %n The `name' parameter
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4766 %d The description, if any
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4767 %l The length of the encoded part
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4768 %p The part identifier number
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4769 %e Dots if the part isn't displayed
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4770
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4771 General format specifiers can also be used. See Info node
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4772 `(gnus)Formatting Variables'.")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4773
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4774 (defvar gnus-mime-button-line-format-alist
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4775 '((?t gnus-tmp-type ?s)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4776 (?T gnus-tmp-type-long ?s)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4777 (?n gnus-tmp-name ?s)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4778 (?d gnus-tmp-description ?s)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4779 (?p gnus-tmp-id ?s)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4780 (?l gnus-tmp-length ?d)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4781 (?e gnus-tmp-dots ?s)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4782
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4783 (defvar gnus-mime-button-commands
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4784 '((gnus-article-press-button "\r" "Toggle Display")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4785 (gnus-mime-view-part "v" "View Interactively...")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4786 (gnus-mime-view-part-as-type "t" "View As Type...")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4787 (gnus-mime-view-part-as-charset "C" "View As charset...")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4788 (gnus-mime-save-part "o" "Save...")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4789 (gnus-mime-save-part-and-strip "\C-o" "Save and Strip")
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4790 (gnus-mime-replace-part "r" "Replace part")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4791 (gnus-mime-delete-part "d" "Delete part")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4792 (gnus-mime-copy-part "c" "View As Text, In Other Buffer")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4793 (gnus-mime-inline-part "i" "View As Text, In This Buffer")
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4794 (gnus-mime-view-part-internally "E" "View Internally") ;; Why `E'?
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4795 (gnus-mime-view-part-externally "e" "View Externally")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4796 (gnus-mime-print-part "p" "Print")
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
4797 (gnus-mime-pipe-part "|" "Pipe To Command...")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4798 (gnus-mime-action-on-part "." "Take action on the part...")))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4799
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4800 (defun gnus-article-mime-part-status ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4801 (if gnus-article-mime-handle-alist-1
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4802 (if (eq 1 (length gnus-article-mime-handle-alist-1))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4803 " (1 part)"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4804 (format " (%d parts)" (length gnus-article-mime-handle-alist-1)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4805 ""))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4806
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4807 (defvar gnus-mime-button-map
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4808 (let ((map (make-sparse-keymap)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4809 (define-key map gnus-mouse-2 'gnus-article-push-button)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4810 (define-key map gnus-down-mouse-3 'gnus-mime-button-menu)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4811 (dolist (c gnus-mime-button-commands)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4812 (define-key map (cadr c) (car c)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4813 map))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4814
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4815 (easy-menu-define
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4816 gnus-mime-button-menu gnus-mime-button-map "MIME button menu."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4817 `("MIME Part"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4818 ,@(mapcar (lambda (c)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4819 (vector (caddr c) (car c) :active t))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4820 gnus-mime-button-commands)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4821
104692
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4822 (defmacro gnus-bind-safe-url-regexp (&rest body)
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4823 "Bind `mm-w3m-safe-url-regexp' according to `gnus-safe-html-newsgroups'."
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4824 `(let ((mm-w3m-safe-url-regexp
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4825 (let ((group (if (and (eq major-mode 'gnus-article-mode)
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4826 (gnus-buffer-live-p
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4827 gnus-article-current-summary))
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4828 (with-current-buffer gnus-article-current-summary
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4829 gnus-newsgroup-name)
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4830 gnus-newsgroup-name)))
108533
de6d3e5f8e8e Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108290
diff changeset
4831 (if (cond ((not group)
de6d3e5f8e8e Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108290
diff changeset
4832 ;; Maybe we're in a mml-preview buffer
de6d3e5f8e8e Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108290
diff changeset
4833 ;; and no group is selected.
de6d3e5f8e8e Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108290
diff changeset
4834 t)
de6d3e5f8e8e Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108290
diff changeset
4835 ((stringp gnus-safe-html-newsgroups)
104692
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4836 (string-match gnus-safe-html-newsgroups group))
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4837 ((consp gnus-safe-html-newsgroups)
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4838 (member group gnus-safe-html-newsgroups)))
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4839 nil
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4840 mm-w3m-safe-url-regexp))))
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4841 ,@body))
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4842
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4843 (defun gnus-mime-button-menu (event prefix)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4844 "Construct a context-sensitive menu of MIME commands."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4845 (interactive "e\nP")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4846 (save-window-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4847 (let ((pos (event-start event)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4848 (select-window (posn-window pos))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4849 (goto-char (posn-point pos))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4850 (gnus-article-check-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4851 (popup-menu gnus-mime-button-menu nil prefix))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4852
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4853 (defun gnus-mime-view-all-parts (&optional handles)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4854 "View all the MIME parts."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4855 (interactive)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4856 (with-current-buffer gnus-article-buffer
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4857 (let ((handles (or handles gnus-article-mime-handles))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
4858 (mail-parse-charset gnus-newsgroup-charset)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
4859 (mail-parse-ignored-charsets
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4860 (with-current-buffer gnus-summary-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4861 gnus-newsgroup-ignored-charsets)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4862 (when handles
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4863 (mm-remove-parts handles)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4864 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4865 (or (search-forward "\n\n") (goto-char (point-max)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4866 (let ((inhibit-read-only t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4867 (delete-region (point) (point-max))
104692
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
4868 (gnus-bind-safe-url-regexp (mm-display-parts handles)))))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4869
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4870 (defun gnus-article-jump-to-part (n)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4871 "Jump to MIME part N."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4872 (interactive "P")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4873 (pop-to-buffer gnus-article-buffer)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4874 ;; FIXME: why is it necessary?
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4875 (sit-for 0)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4876 (let ((parts (length gnus-article-mime-handle-alist)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4877 (or n (setq n
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4878 (string-to-number
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4879 (read-string ;; Emacs 21 doesn't have `read-number'.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4880 (format "Jump to part (2..%s): " parts)))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4881 (unless (and (integerp n) (<= n parts) (>= n 1))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4882 (setq n
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4883 (progn
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4884 (gnus-message 7 "Invalid part `%s', using %s instead."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4885 n parts)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4886 parts)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4887 (gnus-message 9 "Jumping to part %s." n)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4888 (cond ((>= gnus-auto-select-part 1)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4889 (while (and (<= n parts)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4890 (not (gnus-article-goto-part n)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4891 (setq n (1+ n))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4892 ((< gnus-auto-select-part 0)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4893 (while (and (>= n 1)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4894 (not (gnus-article-goto-part n)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4895 (setq n (1- n))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4896 (t
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4897 (gnus-article-goto-part n)))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4898
108962
98ae5d8b7b72 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108855
diff changeset
4899 (defvar gnus-mime-buttonized-part-id nil
98ae5d8b7b72 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108855
diff changeset
4900 "ID of a mime part that should be buttonized.
98ae5d8b7b72 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108855
diff changeset
4901 `gnus-mime-save-part-and-strip' and `gnus-mime-delete-part' bind it.")
98ae5d8b7b72 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108855
diff changeset
4902
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4903 (eval-when-compile
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4904 (defsubst gnus-article-edit-part (handles &optional current-id)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4905 "Edit an article in order to delete a mime part.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4906 This function is exclusively used by `gnus-mime-save-part-and-strip'
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4907 and `gnus-mime-delete-part', and not provided at run-time normally."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4908 (gnus-article-edit-article
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4909 `(lambda ()
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4910 (buffer-disable-undo)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4911 (erase-buffer)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4912 (let ((mail-parse-charset (or gnus-article-charset
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4913 ',gnus-newsgroup-charset))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4914 (mail-parse-ignored-charsets
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4915 (or gnus-article-ignored-charsets
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4916 ',gnus-newsgroup-ignored-charsets))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4917 (mbl mml-buffer-list))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4918 (setq mml-buffer-list nil)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4919 (insert-buffer-substring gnus-original-article-buffer)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4920 (mime-to-mml ',handles)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4921 (setq gnus-article-mime-handles nil)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4922 (let ((mbl1 mml-buffer-list))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4923 (setq mml-buffer-list mbl)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4924 (set (make-local-variable 'mml-buffer-list) mbl1))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4925 (gnus-make-local-hook 'kill-buffer-hook)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4926 (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4927 `(lambda (no-highlight)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4928 (let ((mail-parse-charset (or gnus-article-charset
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4929 ',gnus-newsgroup-charset))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4930 (message-options message-options)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4931 (message-options-set-recipient)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4932 (mail-parse-ignored-charsets
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4933 (or gnus-article-ignored-charsets
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4934 ',gnus-newsgroup-ignored-charsets)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4935 (mml-to-mime)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4936 (mml-destroy-buffers)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4937 (remove-hook 'kill-buffer-hook
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4938 'mml-destroy-buffers t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4939 (kill-local-variable 'mml-buffer-list))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4940 (gnus-summary-edit-article-done
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4941 ,(or (mail-header-references gnus-current-headers) "")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4942 ,(gnus-group-read-only-p)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4943 ,gnus-summary-buffer no-highlight))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4944 t)
108962
98ae5d8b7b72 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108855
diff changeset
4945 ;; Force buttonizing this part.
98ae5d8b7b72 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108855
diff changeset
4946 (let ((gnus-mime-buttonized-part-id current-id))
98ae5d8b7b72 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108855
diff changeset
4947 (gnus-article-edit-done))
105253
baa4e6ac9e46 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 105167
diff changeset
4948 (gnus-configure-windows 'article)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4949 (when (and current-id (integerp gnus-auto-select-part))
108962
98ae5d8b7b72 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108855
diff changeset
4950 (gnus-article-jump-to-part
98ae5d8b7b72 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108855
diff changeset
4951 (min (max (+ current-id gnus-auto-select-part) 1)
98ae5d8b7b72 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108855
diff changeset
4952 (with-current-buffer gnus-article-buffer
98ae5d8b7b72 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108855
diff changeset
4953 (length gnus-article-mime-handle-alist)))))))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4954
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4955 (defun gnus-mime-replace-part (file)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4956 "Replace MIME part under point with an external body."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4957 ;; Useful if file has already been saved to disk
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4958 (interactive
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4959 (list
93726
3e95f26e3241 (gnus-mime-replace-part): Remove unnecessary use of mm-with-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
4960 (read-file-name "Replace MIME part with file: "
3e95f26e3241 (gnus-mime-replace-part): Remove unnecessary use of mm-with-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
4961 (or mm-default-directory default-directory)
3e95f26e3241 (gnus-mime-replace-part): Remove unnecessary use of mm-with-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
4962 nil nil)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4963 (gnus-mime-save-part-and-strip file))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4964
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4965 (defun gnus-mime-save-part-and-strip (&optional file)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4966 "Save the MIME part under point then replace it with an external body.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4967 If FILE is given, use it for the external part."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4968 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4969 (gnus-article-check-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4970 (when (gnus-group-read-only-p)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4971 (error "The current group does not support deleting of parts"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4972 (when (mm-complicated-handles gnus-article-mime-handles)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4973 (error "\
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
4974 The current article has a complicated MIME structure, giving up..."))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4975 (let* ((data (get-text-property (point) 'gnus-data))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4976 (id (get-text-property (point) 'gnus-part))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4977 param
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4978 (handles gnus-article-mime-handles))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4979 (unless file
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4980 (setq file
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4981 (and data (mm-save-part data "Delete MIME part and save to: "))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4982 (when file
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4983 (with-current-buffer (mm-handle-buffer data)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4984 (erase-buffer)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4985 (insert "Content-Type: " (mm-handle-media-type data))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4986 (mml-insert-parameter-string (cdr (mm-handle-type data))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4987 '(charset))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4988 ;; Add a filename for the sake of saving the part again.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4989 (mml-insert-parameter
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4990 (mail-header-encode-parameter "name" (file-name-nondirectory file)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4991 (insert "\n")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4992 (insert "Content-ID: " (message-make-message-id) "\n")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4993 (insert "Content-Transfer-Encoding: binary\n")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4994 (insert "\n"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4995 (setcdr data
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4996 (cdr (mm-make-handle nil
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4997 `("message/external-body"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4998 (access-type . "LOCAL-FILE")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
4999 (name . ,file)))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5000 ;; (set-buffer gnus-summary-buffer)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5001 (gnus-article-edit-part handles id))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5002
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5003 ;; A function like `gnus-summary-save-parts' (`X m', `<MIME> <Extract all
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5004 ;; parts...>') but with stripping would be nice.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5005
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5006 (defun gnus-mime-delete-part ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5007 "Delete the MIME part under point.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5008 Replace it with some information about the removed part."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5009 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5010 (gnus-article-check-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5011 (when (gnus-group-read-only-p)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5012 (error "The current group does not support deleting of parts"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5013 (when (mm-complicated-handles gnus-article-mime-handles)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5014 (error "\
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5015 The current article has a complicated MIME structure, giving up..."))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5016 (when (or gnus-expert-user
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5017 (gnus-yes-or-no-p "\
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5018 Deleting parts may malfunction or destroy the article; continue? "))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5019 (let* ((data (get-text-property (point) 'gnus-data))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5020 (id (get-text-property (point) 'gnus-part))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5021 (handles gnus-article-mime-handles)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5022 (none "(none)")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5023 (description
87300
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
5024 (let ((desc (mm-handle-description data)))
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
5025 (when desc
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
5026 (mail-decode-encoded-word-string desc))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5027 (filename
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5028 (or (mail-content-type-get (mm-handle-disposition data) 'filename)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5029 none))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5030 (type (mm-handle-media-type data)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5031 (unless data
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5032 (error "No MIME part under point"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5033 (with-current-buffer (mm-handle-buffer data)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5034 (let ((bsize (format "%s" (buffer-size))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5035 (erase-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5036 (insert
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5037 (concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5038 ",----\n"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5039 "| The following attachment has been deleted:\n"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5040 "|\n"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5041 "| Type: " type "\n"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5042 "| Filename: " filename "\n"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5043 "| Size (encoded): " bsize " Byte\n"
87300
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
5044 (when description
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
5045 (concat "| Description: " description "\n"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5046 "`----\n"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5047 (setcdr data
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5048 (cdr (mm-make-handle
103352
827a8db0b5ad Synch with Gnus trunk:
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 102054
diff changeset
5049 nil `("text/plain" (charset . gnus-decoded)) nil nil
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5050 (list "attachment")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5051 (format "Deleted attachment (%s bytes)" bsize))))))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5052 ;; (set-buffer gnus-summary-buffer)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5053 (gnus-article-edit-part handles id))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5054
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5055 (defun gnus-mime-save-part ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5056 "Save the MIME part under point."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5057 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5058 (gnus-article-check-buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5059 (let ((data (get-text-property (point) 'gnus-data)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5060 (when data
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5061 (mm-save-part data))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5062
108290
afc774335f7e Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108287
diff changeset
5063 (defun gnus-mime-pipe-part (&optional cmd)
afc774335f7e Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108287
diff changeset
5064 "Pipe the MIME part under point to a process.
afc774335f7e Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108287
diff changeset
5065 Use CMD as the process."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5066 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5067 (gnus-article-check-buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5068 (let ((data (get-text-property (point) 'gnus-data)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5069 (when data
108290
afc774335f7e Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108287
diff changeset
5070 (mm-pipe-part data cmd))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5071
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5072 (defun gnus-mime-view-part ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5073 "Interactively choose a viewing method for the MIME part under point."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5074 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5075 (gnus-article-check-buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5076 (let ((data (get-text-property (point) 'gnus-data)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5077 (when data
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5078 (setq gnus-article-mime-handles
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5079 (mm-merge-handles
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5080 gnus-article-mime-handles (setq data (copy-sequence data))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5081 (mm-interactively-view-part data))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5082
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5083 (defun gnus-mime-view-part-as-type-internal ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5084 (gnus-article-check-buffer)
70377
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5085 (let* ((handle (get-text-property (point) 'gnus-data))
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5086 (name (or
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5087 ;; Content-Type: foo/bar; name=...
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5088 (mail-content-type-get (mm-handle-type handle) 'name)
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5089 ;; Content-Disposition: attachment; filename=...
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5090 (cdr (assq 'filename (cdr (mm-handle-disposition handle))))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5091 (def-type (and name (mm-default-file-encoding name))))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5092 (or (and def-type (cons def-type 0))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5093 (and handle
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5094 (equal (mm-handle-media-supertype handle) "text")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5095 '("text/plain" . 0))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5096 '("application/octet-stream" . 0))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5097
70377
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5098 (defun gnus-mime-view-part-as-type (&optional mime-type pred)
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5099 "Choose a MIME media type, and view the part as such.
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5100 If non-nil, PRED is a predicate to use during completion to limit the
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5101 available media-types."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5102 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5103 (unless mime-type
70377
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5104 (setq mime-type
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5105 (let ((default (gnus-mime-view-part-as-type-internal)))
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5106 (completing-read
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5107 (format "View as MIME type (default %s): "
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5108 (car default))
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5109 (mapcar #'list (mailcap-mime-types))
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5110 pred nil nil nil
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5111 (car default)))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5112 (gnus-article-check-buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5113 (let ((handle (get-text-property (point) 'gnus-data)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5114 (when handle
69572
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
5115 (when (equal (mm-handle-media-type handle) "message/external-body")
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
5116 (unless (mm-handle-cache handle)
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
5117 (mm-extern-cache-contents handle))
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
5118 (setq handle (mm-handle-cache handle)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5119 (setq handle
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5120 (mm-make-handle (mm-handle-buffer handle)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5121 (cons mime-type (cdr (mm-handle-type handle)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5122 (mm-handle-encoding handle)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5123 (mm-handle-undisplayer handle)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5124 (mm-handle-disposition handle)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5125 (mm-handle-description handle)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5126 nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5127 (mm-handle-id handle)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5128 (setq gnus-article-mime-handles
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5129 (mm-merge-handles gnus-article-mime-handles handle))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5130 (when (mm-handle-displayed-p handle)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5131 (mm-remove-part handle))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5132 (gnus-mm-display-part handle))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5133
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5134 (defun gnus-mime-copy-part (&optional handle arg)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5135 "Put the MIME part under point into a new buffer.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5136 If `auto-compression-mode' is enabled, compressed files like .gz and .bz2
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5137 are decompressed."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5138 (interactive (list nil current-prefix-arg))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5139 (gnus-article-check-buffer)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5140 (unless handle
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5141 (setq handle (get-text-property (point) 'gnus-data)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5142 (when handle
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5143 (let ((filename (or (mail-content-type-get (mm-handle-type handle)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5144 'name)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5145 (mail-content-type-get (mm-handle-disposition handle)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5146 'filename)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5147 contents dont-decode charset coding-system)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5148 (mm-with-unibyte-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5149 (mm-insert-part handle)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5150 (setq contents (or (condition-case nil
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5151 (mm-decompress-buffer filename nil 'sig)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5152 (error
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5153 (setq dont-decode t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5154 nil))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5155 (buffer-string))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5156 (setq filename (cond (filename (file-name-nondirectory filename))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5157 (dont-decode "*raw data*")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5158 (t "*decoded*")))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5159 (cond
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5160 (dont-decode)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5161 ((not arg)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5162 (unless (setq charset (mail-content-type-get
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5163 (mm-handle-type handle) 'charset))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5164 (unless (setq coding-system (mm-with-unibyte-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5165 (insert contents)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5166 (mm-find-buffer-file-coding-system)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5167 (setq charset gnus-newsgroup-charset))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5168 ((numberp arg)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5169 (setq charset (or (cdr (assq arg
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5170 gnus-summary-show-article-charset-alist))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5171 (mm-read-coding-system "Charset: ")))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5172 (switch-to-buffer (generate-new-buffer filename))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5173 (if (or coding-system
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5174 (and charset
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5175 (setq coding-system (mm-charset-to-coding-system charset))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5176 (not (eq charset 'ascii))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5177 (progn
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5178 (mm-enable-multibyte)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5179 (insert (mm-decode-coding-string contents coding-system))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5180 (setq buffer-file-coding-system
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5181 (if (boundp 'last-coding-system-used)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5182 (symbol-value 'last-coding-system-used)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5183 coding-system)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5184 (mm-disable-multibyte)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5185 (insert contents)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5186 (setq buffer-file-coding-system mm-binary-coding-system))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5187 ;; We do it this way to make `normal-mode' set the appropriate mode.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5188 (unwind-protect
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5189 (progn
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5190 (setq buffer-file-name (expand-file-name filename))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5191 (normal-mode))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5192 (setq buffer-file-name nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5193 (goto-char (point-min)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5194
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5195 (defun gnus-mime-print-part (&optional handle filename)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5196 "Print the MIME part under point."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5197 (interactive (list nil (ps-print-preprint current-prefix-arg)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5198 (gnus-article-check-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5199 (let* ((handle (or handle (get-text-property (point) 'gnus-data)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5200 (contents (and handle (mm-get-part handle)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5201 (file (mm-make-temp-file (expand-file-name "mm." mm-tmp-directory)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5202 (printer (mailcap-mime-info (mm-handle-media-type handle) "print")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5203 (when contents
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5204 (if printer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5205 (unwind-protect
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5206 (progn
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5207 (mm-save-part-to-file handle file)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5208 (call-process shell-file-name nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5209 (generate-new-buffer " *mm*")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5210 nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5211 shell-command-switch
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5212 (mm-mailcap-command
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5213 printer file (mm-handle-type handle))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5214 (delete-file file))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5215 (with-temp-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5216 (insert contents)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5217 (gnus-print-buffer))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5218 (ps-despool filename)))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5219
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5220 (defun gnus-mime-inline-part (&optional handle arg)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5221 "Insert the MIME part under point into the current buffer.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5222 Compressed files like .gz and .bz2 are decompressed."
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5223 (interactive (list nil current-prefix-arg))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5224 (gnus-article-check-buffer)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5225 (unless handle
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5226 (setq handle (get-text-property (point) 'gnus-data)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5227 (when handle
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5228 (let ((b (point))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5229 (inhibit-read-only t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5230 contents charset coding-system)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5231 (if (and (not arg) (mm-handle-undisplayer handle))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5232 (mm-remove-part handle)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5233 (mm-with-unibyte-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5234 (mm-insert-part handle)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5235 (setq contents
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5236 (or (mm-decompress-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5237 (or (mail-content-type-get (mm-handle-type handle)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5238 'name)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5239 (mail-content-type-get (mm-handle-disposition handle)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5240 'filename))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5241 nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5242 (buffer-string))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5243 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5244 ((not arg)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5245 (unless (setq charset (mail-content-type-get
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5246 (mm-handle-type handle) 'charset))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5247 (unless (setq coding-system
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5248 (mm-with-unibyte-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5249 (insert contents)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5250 (mm-find-buffer-file-coding-system)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5251 (setq charset gnus-newsgroup-charset))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5252 ((numberp arg)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5253 (if (mm-handle-undisplayer handle)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5254 (mm-remove-part handle))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5255 (setq charset
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5256 (or (cdr (assq arg
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5257 gnus-summary-show-article-charset-alist))
59955
0b36e2f36bf5 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-82
Miles Bader <miles@gnu.org>
parents: 59806
diff changeset
5258 (mm-read-coding-system "Charset: "))))
0b36e2f36bf5 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-82
Miles Bader <miles@gnu.org>
parents: 59806
diff changeset
5259 (t
0b36e2f36bf5 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-82
Miles Bader <miles@gnu.org>
parents: 59806
diff changeset
5260 (if (mm-handle-undisplayer handle)
61537
18b52f2ea5dc Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-256
Miles Bader <miles@gnu.org>
parents: 61487
diff changeset
5261 (mm-remove-part handle))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5262 (forward-line 2)
61537
18b52f2ea5dc Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-256
Miles Bader <miles@gnu.org>
parents: 61487
diff changeset
5263 (mm-insert-inline
18b52f2ea5dc Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-256
Miles Bader <miles@gnu.org>
parents: 61487
diff changeset
5264 handle
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5265 (if (or coding-system
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5266 (and charset
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5267 (setq coding-system
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5268 (mm-charset-to-coding-system charset))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5269 (not (eq coding-system 'ascii))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5270 (mm-decode-coding-string contents coding-system)
61537
18b52f2ea5dc Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-256
Miles Bader <miles@gnu.org>
parents: 61487
diff changeset
5271 (mm-string-to-multibyte contents)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5272 (goto-char b)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5273
98113
95e740c93248 * gnus-art.el (gnus-mime-set-charset-parameters): Add new argument
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98105
diff changeset
5274 (defun gnus-mime-set-charset-parameters (handle charset)
95e740c93248 * gnus-art.el (gnus-mime-set-charset-parameters): Add new argument
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98105
diff changeset
5275 "Set CHARSET to parameters in HANDLE.
95e740c93248 * gnus-art.el (gnus-mime-set-charset-parameters): Add new argument
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98105
diff changeset
5276 CHARSET may either be a string or a symbol."
95e740c93248 * gnus-art.el (gnus-mime-set-charset-parameters): Add new argument
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98105
diff changeset
5277 (unless (stringp charset)
95e740c93248 * gnus-art.el (gnus-mime-set-charset-parameters): Add new argument
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98105
diff changeset
5278 (setq charset (symbol-name charset)))
77309
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5279 (if (stringp (car handle))
98113
95e740c93248 * gnus-art.el (gnus-mime-set-charset-parameters): Add new argument
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98105
diff changeset
5280 (dolist (h (cdr handle))
95e740c93248 * gnus-art.el (gnus-mime-set-charset-parameters): Add new argument
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98105
diff changeset
5281 (gnus-mime-set-charset-parameters h charset))
77309
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5282 (let* ((type (mm-handle-type (if (equal (mm-handle-media-type handle)
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5283 "message/external-body")
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5284 (progn
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5285 (unless (mm-handle-cache handle)
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5286 (mm-extern-cache-contents handle))
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5287 (mm-handle-cache handle))
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5288 handle)))
98113
95e740c93248 * gnus-art.el (gnus-mime-set-charset-parameters): Add new argument
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98105
diff changeset
5289 (param (assq 'charset (cdr type))))
95e740c93248 * gnus-art.el (gnus-mime-set-charset-parameters): Add new argument
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98105
diff changeset
5290 (if param
95e740c93248 * gnus-art.el (gnus-mime-set-charset-parameters): Add new argument
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98105
diff changeset
5291 (setcdr param charset)
95e740c93248 * gnus-art.el (gnus-mime-set-charset-parameters): Add new argument
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98105
diff changeset
5292 (setcdr type (cons (cons 'charset charset) (cdr type)))))))
77309
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5293
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5294 (defun gnus-mime-view-part-as-charset (&optional handle arg)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5295 "Insert the MIME part under point into the current buffer using the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5296 specified charset."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5297 (interactive (list nil current-prefix-arg))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5298 (gnus-article-check-buffer)
69949
d0312c3f2374 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-214
Miles Bader <miles@gnu.org>
parents: 69944
diff changeset
5299 (let ((handle (or handle (get-text-property (point) 'gnus-data)))
d0312c3f2374 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-214
Miles Bader <miles@gnu.org>
parents: 69944
diff changeset
5300 (fun (get-text-property (point) 'gnus-callback))
d0312c3f2374 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-214
Miles Bader <miles@gnu.org>
parents: 69944
diff changeset
5301 (gnus-newsgroup-ignored-charsets 'gnus-all)
98113
95e740c93248 * gnus-art.el (gnus-mime-set-charset-parameters): Add new argument
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98105
diff changeset
5302 charset form preferred parts)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5303 (when handle
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5304 (when (prog1
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5305 (and fun
98113
95e740c93248 * gnus-art.el (gnus-mime-set-charset-parameters): Add new argument
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98105
diff changeset
5306 (setq charset
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5307 (or (cdr (assq
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5308 arg
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5309 gnus-summary-show-article-charset-alist))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5310 (mm-read-coding-system "Charset: "))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5311 (if (mm-handle-undisplayer handle)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5312 (mm-remove-part handle)))
98113
95e740c93248 * gnus-art.el (gnus-mime-set-charset-parameters): Add new argument
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 98105
diff changeset
5313 (gnus-mime-set-charset-parameters handle charset)
77309
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5314 (when (and (consp (setq form (cdr-safe fun)))
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5315 (setq form (ignore-errors
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5316 (assq 'gnus-mime-display-alternative form)))
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5317 (setq preferred (caddr form))
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5318 (progn
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5319 (when (eq (car preferred) 'quote)
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5320 (setq preferred (cadr preferred)))
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5321 (not (equal preferred
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5322 (get-text-property (point) 'gnus-data))))
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5323 (setq parts (get-text-property (point) 'gnus-part))
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5324 (setq parts (cdr (assq parts
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5325 gnus-article-mime-handle-alist)))
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5326 (equal (mm-handle-media-type parts) "multipart/alternative")
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5327 (setq parts (reverse (cdr parts))))
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5328 (setcar (cddr form)
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5329 (list 'quote (or (cadr (member preferred parts))
56cc03f5f68c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76820
diff changeset
5330 (car parts)))))
69949
d0312c3f2374 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-214
Miles Bader <miles@gnu.org>
parents: 69944
diff changeset
5331 (funcall fun handle)))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5332
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5333 (defun gnus-mime-view-part-externally (&optional handle)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5334 "View the MIME part under point with an external viewer."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5335 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5336 (gnus-article-check-buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5337 (let* ((handle (or handle (get-text-property (point) 'gnus-data)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5338 (mm-user-display-methods nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5339 (mm-inlined-types nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5340 (mail-parse-charset gnus-newsgroup-charset)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
5341 (mail-parse-ignored-charsets
70377
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5342 (with-current-buffer gnus-summary-buffer
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5343 gnus-newsgroup-ignored-charsets))
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5344 (type (mm-handle-media-type handle))
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5345 (method (mailcap-mime-info type))
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5346 (mm-enable-external t))
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5347 (if (not (stringp method))
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5348 (gnus-mime-view-part-as-type
78006
a8c400af8ac9 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 77979
diff changeset
5349 nil (lambda (types) (stringp (mailcap-mime-info (car types)))))
70377
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5350 (when handle
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5351 (if (mm-handle-undisplayer handle)
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5352 (mm-remove-part handle)
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5353 (mm-display-part handle))))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5354
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5355 (defun gnus-mime-view-part-internally (&optional handle)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5356 "View the MIME part under point with an internal viewer.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5357 If no internal viewer is available, use an external viewer."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5358 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5359 (gnus-article-check-buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5360 (let* ((handle (or handle (get-text-property (point) 'gnus-data)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5361 (mm-inlined-types '(".*"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5362 (mm-inline-large-images t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5363 (mail-parse-charset gnus-newsgroup-charset)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
5364 (mail-parse-ignored-charsets
70377
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5365 (with-current-buffer gnus-summary-buffer
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5366 gnus-newsgroup-ignored-charsets))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5367 (inhibit-read-only t))
70377
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5368 (if (not (mm-inlinable-p handle))
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5369 (gnus-mime-view-part-as-type
78006
a8c400af8ac9 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 77979
diff changeset
5370 nil (lambda (types) (mm-inlinable-p handle (car types))))
70377
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5371 (when handle
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5372 (if (mm-handle-undisplayer handle)
1b78f3a87f16 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-265
Miles Bader <miles@gnu.org>
parents: 70044
diff changeset
5373 (mm-remove-part handle)
104692
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
5374 (gnus-bind-safe-url-regexp (mm-display-part handle)))))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5375
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5376 (defun gnus-mime-action-on-part (&optional action)
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5377 "Do something with the MIME attachment at \(point\)."
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5378 (interactive
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5379 (list (completing-read "Action: " gnus-mime-action-alist nil t)))
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5380 (gnus-article-check-buffer)
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5381 (let ((action-pair (assoc action gnus-mime-action-alist)))
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5382 (if action-pair
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5383 (funcall (cdr action-pair)))))
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5384
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5385 (defun gnus-article-part-wrapper (n function &optional no-handle interactive)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5386 "Call FUNCTION on MIME part N.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5387 Unless NO-HANDLE, call FUNCTION with N-th MIME handle as it's only argument.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5388 If INTERACTIVE, call FUNCTION interactivly."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5389 (let (window frame)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5390 ;; Check whether the article is displayed.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5391 (unless (and (gnus-buffer-live-p gnus-article-buffer)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5392 (setq window (get-buffer-window gnus-article-buffer t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5393 (frame-visible-p (setq frame (window-frame window))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5394 (error "No article is displayed"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5395 (with-current-buffer gnus-article-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5396 ;; Check whether the article displays the right contents.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5397 (unless (with-current-buffer gnus-summary-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5398 (eq gnus-current-article (gnus-summary-article-number)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5399 (error "You should select the right article first"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5400 (if n
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5401 (setq n (prefix-numeric-value n))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5402 (let ((pt (point)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5403 (setq n (or (get-text-property pt 'gnus-part)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5404 (and (not (bobp))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5405 (get-text-property (1- pt) 'gnus-part))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5406 (get-text-property (prog2
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5407 (forward-line 1)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5408 (point)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5409 (goto-char pt))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5410 'gnus-part)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5411 (get-text-property
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5412 (or (and (setq pt (previous-single-property-change
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5413 pt 'gnus-part))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5414 (1- pt))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5415 (next-single-property-change (point) 'gnus-part)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5416 (point))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5417 'gnus-part)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5418 1))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5419 ;; Check whether the specified part exists.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5420 (when (> n (length gnus-article-mime-handle-alist))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5421 (error "No such part")))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5422 (unless
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5423 (progn
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5424 ;; To select the window is needed so that the cursor
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5425 ;; might be visible on the MIME button.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5426 (select-window (prog1
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5427 window
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5428 (setq window (selected-window))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5429 ;; Article may be displayed in the other frame.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5430 (gnus-select-frame-set-input-focus
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5431 (prog1
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5432 frame
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5433 (setq frame (selected-frame))))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5434 (when (gnus-article-goto-part n)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5435 ;; We point the cursor and the arrow at the MIME button
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5436 ;; when the `function' prompt the user for something.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5437 (let ((cursor-in-non-selected-windows t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5438 (overlay-arrow-string "=>")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5439 (overlay-arrow-position (point-marker)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5440 (unwind-protect
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5441 (cond
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5442 ((and no-handle interactive)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5443 (call-interactively function))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5444 (no-handle
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5445 (funcall function))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5446 (interactive
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5447 (call-interactively
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5448 function
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5449 (cdr (assq n gnus-article-mime-handle-alist))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5450 (t
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5451 (funcall function
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5452 (cdr (assq n gnus-article-mime-handle-alist)))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5453 (set-marker overlay-arrow-position nil)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5454 (unless gnus-auto-select-part
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5455 (gnus-select-frame-set-input-focus frame)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5456 (select-window window))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5457 t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5458 (if gnus-inhibit-mime-unbuttonizing
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5459 ;; This is the default though the program shouldn't reach here.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5460 (error "No such part")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5461 ;; The part which doesn't have the MIME button is selected.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5462 ;; So, we display all the buttons and redo it.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5463 (let ((gnus-inhibit-mime-unbuttonizing t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5464 (gnus-summary-show-article)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5465 (gnus-article-part-wrapper n function no-handle))))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5466
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5467 (defun gnus-article-pipe-part (n)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5468 "Pipe MIME part N, which is the numerical prefix."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5469 (interactive "P")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5470 (gnus-article-part-wrapper n 'mm-pipe-part))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5471
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5472 (defun gnus-article-save-part (n)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5473 "Save MIME part N, which is the numerical prefix."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5474 (interactive "P")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5475 (gnus-article-part-wrapper n 'mm-save-part))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5476
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5477 (defun gnus-article-interactively-view-part (n)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5478 "View MIME part N interactively, which is the numerical prefix."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5479 (interactive "P")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5480 (gnus-article-part-wrapper n 'mm-interactively-view-part))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5481
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5482 (defun gnus-article-copy-part (n)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5483 "Copy MIME part N, which is the numerical prefix."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5484 (interactive "P")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5485 (gnus-article-part-wrapper n 'gnus-mime-copy-part))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5486
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5487 (defun gnus-article-view-part-as-charset (n)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5488 "View MIME part N using a specified charset.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5489 N is the numerical prefix."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5490 (interactive "P")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5491 (gnus-article-part-wrapper n 'gnus-mime-view-part-as-charset))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5492
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5493 (defun gnus-article-view-part-externally (n)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5494 "View MIME part N externally, which is the numerical prefix."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5495 (interactive "P")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5496 (gnus-article-part-wrapper n 'gnus-mime-view-part-externally))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5497
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5498 (defun gnus-article-inline-part (n)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5499 "Inline MIME part N, which is the numerical prefix."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5500 (interactive "P")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5501 (gnus-article-part-wrapper n 'gnus-mime-inline-part))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5502
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5503 (defun gnus-article-save-part-and-strip (n)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5504 "Save MIME part N and replace it with an external body.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5505 N is the numerical prefix."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5506 (interactive "P")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5507 (gnus-article-part-wrapper n 'gnus-mime-save-part-and-strip t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5508
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5509 (defun gnus-article-replace-part (n)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5510 "Replace MIME part N with an external body.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5511 N is the numerical prefix."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5512 (interactive "P")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5513 (gnus-article-part-wrapper n 'gnus-mime-replace-part t t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5514
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5515 (defun gnus-article-delete-part (n)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5516 "Delete MIME part N and add some information about the removed part.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5517 N is the numerical prefix."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5518 (interactive "P")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5519 (gnus-article-part-wrapper n 'gnus-mime-delete-part t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5520
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5521 (defun gnus-article-view-part-as-type (n)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5522 "Choose a MIME media type, and view part N as such.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5523 N is the numerical prefix."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5524 (interactive "P")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5525 (gnus-article-part-wrapper n 'gnus-mime-view-part-as-type t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5526
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5527 (defun gnus-article-mime-match-handle-first (condition)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5528 (if condition
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5529 (let (n)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5530 (dolist (ihandle gnus-article-mime-handle-alist)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
5531 (if (and (cond
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5532 ((functionp condition)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5533 (funcall condition (cdr ihandle)))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
5534 ((eq condition 'undisplayed)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5535 (not (or (mm-handle-undisplayer (cdr ihandle))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5536 (equal (mm-handle-media-type (cdr ihandle))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5537 "multipart/alternative"))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5538 ((eq condition 'undisplayed-alternative)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5539 (not (mm-handle-undisplayer (cdr ihandle))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5540 (t t))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5541 (gnus-article-goto-part (car ihandle))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5542 (or (not n) (< (car ihandle) n)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5543 (setq n (car ihandle))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5544 (or n 1))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5545 1))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5546
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5547 (defun gnus-article-view-part (&optional n)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5548 "View MIME part N, which is the numerical prefix."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5549 (interactive "P")
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5550 (with-current-buffer gnus-article-buffer
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
5551 (or (numberp n) (setq n (gnus-article-mime-match-handle-first
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5552 gnus-article-mime-match-handle-function)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5553 (when (> n (length gnus-article-mime-handle-alist))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5554 (error "No such part"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5555 (let ((handle (cdr (assq n gnus-article-mime-handle-alist))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5556 (when (gnus-article-goto-part n)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5557 (if (equal (car handle) "multipart/alternative")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5558 (gnus-article-press-button)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5559 (when (eq (gnus-mm-display-part handle) 'internal)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5560 (gnus-set-window-start)))))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5561
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5562 (defsubst gnus-article-mime-total-parts ()
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5563 (if (bufferp (car gnus-article-mime-handles))
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5564 1 ;; single part
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5565 (1- (length gnus-article-mime-handles))))
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5566
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5567 (defun gnus-mm-display-part (handle)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5568 "Display HANDLE and fix MIME button."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5569 (let ((id (get-text-property (point) 'gnus-part))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5570 (point (point))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5571 (inhibit-read-only t))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5572 (forward-line 1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5573 (prog1
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5574 (let ((window (selected-window))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5575 (mail-parse-charset gnus-newsgroup-charset)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
5576 (mail-parse-ignored-charsets
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5577 (if (gnus-buffer-live-p gnus-summary-buffer)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5578 (with-current-buffer gnus-summary-buffer
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5579 gnus-newsgroup-ignored-charsets)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5580 nil)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5581 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5582 (unwind-protect
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5583 (let ((win (gnus-get-buffer-window (current-buffer) t))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5584 (beg (point)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5585 (when win
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5586 (select-window win))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5587 (goto-char point)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5588 (forward-line)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5589 (if (mm-handle-displayed-p handle)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5590 ;; This will remove the part.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5591 (mm-display-part handle)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5592 (save-restriction
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5593 (narrow-to-region (point)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5594 (if (eobp) (point) (1+ (point))))
104692
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
5595 (gnus-bind-safe-url-regexp (mm-display-part handle))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5596 ;; We narrow to the part itself and
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5597 ;; then call the treatment functions.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5598 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5599 (forward-line 1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5600 (narrow-to-region (point) (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5601 (gnus-treat-article
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5602 nil id
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5603 (gnus-article-mime-total-parts)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5604 (mm-handle-media-type handle)))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5605 (if (window-live-p window)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5606 (select-window window)))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5607 (goto-char point)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5608 (gnus-delete-line)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5609 (gnus-insert-mime-button
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5610 handle id (list (mm-handle-displayed-p handle)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5611 (goto-char point))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5612
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5613 (defun gnus-article-goto-part (n)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5614 "Go to MIME part N."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5615 (gnus-goto-char (text-property-any (point-min) (point-max) 'gnus-part n)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5616
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5617 (defun gnus-insert-mime-button (handle gnus-tmp-id &optional displayed)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5618 (let ((gnus-tmp-name
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5619 (or (mail-content-type-get (mm-handle-type handle) 'name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5620 (mail-content-type-get (mm-handle-disposition handle) 'filename)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5621 (mail-content-type-get (mm-handle-type handle) 'url)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5622 ""))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5623 (gnus-tmp-type (mm-handle-media-type handle))
87928
a5b33bf9597c Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87859
diff changeset
5624 (gnus-tmp-description (or (mm-handle-description handle) ""))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5625 (gnus-tmp-dots
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5626 (if (if displayed (car displayed)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5627 (mm-handle-displayed-p handle))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5628 "" "..."))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5629 (gnus-tmp-length (with-current-buffer (mm-handle-buffer handle)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5630 (buffer-size)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5631 gnus-tmp-type-long b e)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5632 (when (string-match ".*/" gnus-tmp-name)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5633 (setq gnus-tmp-name (replace-match "" t t gnus-tmp-name)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5634 (setq gnus-tmp-type-long (concat gnus-tmp-type
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5635 (and (not (equal gnus-tmp-name ""))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5636 (concat "; " gnus-tmp-name))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5637 (unless (equal gnus-tmp-description "")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5638 (setq gnus-tmp-type-long (concat " --- " gnus-tmp-type-long)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5639 (unless (bolp)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5640 (insert "\n"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5641 (setq b (point))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5642 (gnus-eval-format
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5643 gnus-mime-button-line-format gnus-mime-button-line-format-alist
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5644 `(keymap ,gnus-mime-button-map
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5645 gnus-callback gnus-mm-display-part
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5646 gnus-part ,gnus-tmp-id
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5647 article-type annotation
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5648 gnus-data ,handle))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5649 (setq e (if (bolp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5650 ;; Exclude a newline.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5651 (1- (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5652 (point)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5653 (when gnus-article-button-face
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5654 (gnus-overlay-put (gnus-make-overlay b e nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5655 'face gnus-article-button-face))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5656 (widget-convert-button
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5657 'link b e
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5658 :mime-handle handle
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5659 :action 'gnus-widget-press-button
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5660 :button-keymap gnus-mime-button-map
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5661 :help-echo
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5662 (lambda (widget/window &optional overlay pos)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5663 ;; Needed to properly clear the message due to a bug in
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5664 ;; wid-edit (XEmacs only).
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5665 (if (boundp 'help-echo-owns-message)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5666 (setq help-echo-owns-message t))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5667 (format
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5668 "%S: %s the MIME part; %S: more options"
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5669 (aref gnus-mouse-2 0)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5670 ;; XEmacs will get a single widget arg; Emacs 21 will get
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5671 ;; window, overlay, position.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5672 (if (mm-handle-displayed-p
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5673 (if overlay
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5674 (with-current-buffer (gnus-overlay-buffer overlay)
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5675 (widget-get (widget-at (gnus-overlay-start overlay))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5676 :mime-handle))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5677 (widget-get widget/window :mime-handle)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5678 "hide" "show")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5679 (aref gnus-down-mouse-3 0))))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5680
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5681 (defun gnus-widget-press-button (elems el)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5682 (goto-char (widget-get elems :from))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5683 (gnus-article-press-button))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5684
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5685 (defvar gnus-displaying-mime nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5686
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5687 (defun gnus-display-mime (&optional ihandles)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5688 "Display the MIME parts."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5689 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5690 (save-selected-window
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5691 (let ((window (get-buffer-window gnus-article-buffer))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5692 (point (point)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5693 (when window
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5694 (select-window window)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5695 ;; We have to do this since selecting the window
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5696 ;; may change the point. So we set the window point.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5697 (set-window-point window point)))
68207
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
5698 (let ((handles ihandles)
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
5699 (inhibit-read-only t)
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
5700 handle)
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
5701 (cond (handles)
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
5702 ((setq handles (mm-dissect-buffer nil gnus-article-loose-mime))
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
5703 (when gnus-article-emulate-mime
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
5704 (mm-uu-dissect-text-parts handles)))
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
5705 (gnus-article-emulate-mime
fbd379b34f0a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-698
Miles Bader <miles@gnu.org>
parents: 68129
diff changeset
5706 (setq handles (mm-uu-dissect))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5707 (when (and (not ihandles)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5708 (not gnus-displaying-mime))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5709 ;; Top-level call; we clean up.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5710 (when gnus-article-mime-handles
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5711 (mm-destroy-parts gnus-article-mime-handles)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5712 (setq gnus-article-mime-handle-alist nil));; A trick.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5713 (setq gnus-article-mime-handles handles)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5714 ;; We allow users to glean info from the handles.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5715 (when gnus-article-mime-part-function
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5716 (gnus-mime-part-function handles)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5717 (if (and handles
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5718 (or (not (stringp (car handles)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5719 (cdr handles)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5720 (progn
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5721 (when (and (not ihandles)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5722 (not gnus-displaying-mime))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5723 ;; Clean up for mime parts.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5724 (article-goto-body)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5725 (delete-region (point) (point-max)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5726 (let ((gnus-displaying-mime t))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5727 (gnus-mime-display-part handles)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5728 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5729 (article-goto-body)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5730 (narrow-to-region (point) (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5731 (gnus-treat-article nil 1 1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5732 (widen)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5733 (unless ihandles
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5734 ;; Highlight the headers.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5735 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5736 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5737 (article-goto-body)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5738 (narrow-to-region (point-min) (point))
62099
d1245d218964 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-291
Miles Bader <miles@gnu.org>
parents: 61537
diff changeset
5739 (gnus-article-save-original-date
71379
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 71262
diff changeset
5740 (gnus-treat-article 'head)))))))
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 71262
diff changeset
5741 ;; Cope with broken MIME messages.
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 71262
diff changeset
5742 (goto-char (point-max))
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 71262
diff changeset
5743 (unless (bolp)
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 71262
diff changeset
5744 (insert "\n"))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5745
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5746 (defcustom gnus-mime-display-multipart-as-mixed nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5747 "Display \"multipart\" parts as \"multipart/mixed\".
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5748
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5749 If t, it overrides nil values of
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5750 `gnus-mime-display-multipart-alternative-as-mixed' and
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5751 `gnus-mime-display-multipart-related-as-mixed'."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5752 :group 'gnus-article-mime
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5753 :type 'boolean)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5754
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5755 (defcustom gnus-mime-display-multipart-alternative-as-mixed nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5756 "Display \"multipart/alternative\" parts as \"multipart/mixed\"."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
5757 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5758 :group 'gnus-article-mime
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5759 :type 'boolean)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5760
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5761 (defcustom gnus-mime-display-multipart-related-as-mixed nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5762 "Display \"multipart/related\" parts as \"multipart/mixed\".
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5763
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5764 If displaying \"text/html\" is discouraged \(see
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5765 `mm-discouraged-alternatives'\) images or other material inside a
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5766 \"multipart/related\" part might be overlooked when this variable is nil."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
5767 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5768 :group 'gnus-article-mime
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5769 :type 'boolean)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5770
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5771 (defun gnus-mime-display-part (handle)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5772 (cond
65616
cabd12ecc31c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-553
Miles Bader <miles@gnu.org>
parents: 65388
diff changeset
5773 ;; Maybe a broken MIME message.
cabd12ecc31c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-553
Miles Bader <miles@gnu.org>
parents: 65388
diff changeset
5774 ((null handle))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5775 ;; Single part.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5776 ((not (stringp (car handle)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5777 (gnus-mime-display-single handle))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5778 ;; User-defined multipart
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5779 ((cdr (assoc (car handle) gnus-mime-multipart-functions))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5780 (funcall (cdr (assoc (car handle) gnus-mime-multipart-functions))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5781 handle))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5782 ;; multipart/alternative
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5783 ((and (equal (car handle) "multipart/alternative")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5784 (not (or gnus-mime-display-multipart-as-mixed
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5785 gnus-mime-display-multipart-alternative-as-mixed)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5786 (let ((id (1+ (length gnus-article-mime-handle-alist))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5787 (push (cons id handle) gnus-article-mime-handle-alist)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5788 (gnus-mime-display-alternative (cdr handle) nil nil id)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5789 ;; multipart/related
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5790 ((and (equal (car handle) "multipart/related")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5791 (not (or gnus-mime-display-multipart-as-mixed
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5792 gnus-mime-display-multipart-related-as-mixed)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5793 ;;;!!!We should find the start part, but we just default
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5794 ;;;!!!to the first part.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5795 ;;(gnus-mime-display-part (cadr handle))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5796 ;;;!!! Most multipart/related is an HTML message plus images.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5797 ;;;!!! Unfortunately we are unable to let W3 display those
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5798 ;;;!!! included images, so we just display it as a mixed multipart.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5799 ;;(gnus-mime-display-mixed (cdr handle))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5800 ;;;!!! No, w3 can display everything just fine.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5801 (gnus-mime-display-part (cadr handle)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5802 ((equal (car handle) "multipart/signed")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5803 (gnus-add-wash-type 'signed)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5804 (gnus-mime-display-security handle))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5805 ((equal (car handle) "multipart/encrypted")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5806 (gnus-add-wash-type 'encrypted)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5807 (gnus-mime-display-security handle))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5808 ;; Other multiparts are handled like multipart/mixed.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5809 (t
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5810 (gnus-mime-display-mixed (cdr handle)))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5811
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5812 (defun gnus-mime-part-function (handles)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5813 (if (stringp (car handles))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5814 (mapcar 'gnus-mime-part-function (cdr handles))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5815 (funcall gnus-article-mime-part-function handles)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5816
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5817 (defun gnus-mime-display-mixed (handles)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5818 (mapcar 'gnus-mime-display-part handles))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5819
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5820 (defun gnus-mime-display-single (handle)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5821 (let ((type (mm-handle-media-type handle))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5822 (ignored gnus-ignored-mime-types)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5823 (not-attachment t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5824 (move nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5825 display text)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5826 (catch 'ignored
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5827 (progn
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5828 (while ignored
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5829 (when (string-match (pop ignored) type)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5830 (throw 'ignored nil)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5831 (if (and (setq not-attachment
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5832 (and (not (mm-inline-override-p handle))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5833 (or (not (mm-handle-disposition handle))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5834 (equal (car (mm-handle-disposition handle))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5835 "inline")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5836 (mm-attachment-override-p handle))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5837 (mm-automatic-display-p handle)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5838 (or (and
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5839 (mm-inlinable-p handle)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5840 (mm-inlined-p handle))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5841 (mm-automatic-external-display-p type)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5842 (setq display t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5843 (when (equal (mm-handle-media-supertype handle) "text")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5844 (setq text t)))
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5845 (let ((id (1+ (length gnus-article-mime-handle-alist)))
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5846 beg)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5847 (push (cons id handle) gnus-article-mime-handle-alist)
69572
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
5848 (when (and display
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
5849 (equal (mm-handle-media-supertype handle) "message"))
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
5850 (insert-char
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
5851 ?\n
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
5852 (cond ((not (bolp)) 2)
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
5853 ((or (bobp) (eq (char-before (1- (point))) ?\n)) 0)
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
5854 (t 1))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5855 (when (or (not display)
108962
98ae5d8b7b72 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108855
diff changeset
5856 (not (gnus-unbuttonized-mime-type-p type))
98ae5d8b7b72 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108855
diff changeset
5857 (eq id gnus-mime-buttonized-part-id))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5858 (gnus-insert-mime-button
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5859 handle id (list (or display (and not-attachment text))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5860 (gnus-article-insert-newline)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5861 ;; Remember modify the number of forward lines.
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5862 (setq move t))
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
5863 (setq beg (point))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5864 (cond
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5865 (display
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5866 (when move
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5867 (forward-line -1)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5868 (setq beg (point)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5869 (let ((mail-parse-charset gnus-newsgroup-charset)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
5870 (mail-parse-ignored-charsets
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5871 (save-excursion (condition-case ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5872 (set-buffer gnus-summary-buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5873 (error))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5874 gnus-newsgroup-ignored-charsets)))
104692
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
5875 (gnus-bind-safe-url-regexp (mm-display-part handle t)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5876 (goto-char (point-max)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5877 ((and text not-attachment)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5878 (when move
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5879 (forward-line -1)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5880 (setq beg (point)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5881 (gnus-article-insert-newline)
65719
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5882 (mm-insert-inline
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5883 handle
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5884 (let ((charset (or (mail-content-type-get (mm-handle-type handle)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5885 'charset)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5886 (and (equal type "text/calendar") 'utf-8))))
65719
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5887 (cond ((not charset)
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5888 (mm-string-as-multibyte (mm-get-part handle)))
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5889 ((eq charset 'gnus-decoded)
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5890 (with-current-buffer (mm-handle-buffer handle)
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5891 (buffer-string)))
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5892 (t
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5893 (mm-decode-string (mm-get-part handle) charset)))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5894 (goto-char (point-max))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5895 ;; Do highlighting.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5896 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5897 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5898 (narrow-to-region beg (point))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5899 (if (eq handle gnus-article-mime-handles)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5900 ;; The format=flowed case.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5901 (gnus-treat-article nil 1 1 (mm-handle-media-type handle))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5902 ;; Don't count signature parts that are never displayed.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5903 ;; The part number should be re-calculated supposing this
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5904 ;; might be a message/rfc822 part.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5905 (let (handles)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5906 (dolist (part gnus-article-mime-handles)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5907 (unless (or (stringp part)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5908 (equal (car (mm-handle-type part))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5909 "application/pgp-signature"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5910 (push part handles)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5911 (gnus-treat-article
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5912 nil (length (memq handle handles)) (length handles)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5913 (mm-handle-media-type handle)))))))))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5914
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5915 (defun gnus-unbuttonized-mime-type-p (type)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5916 "Say whether TYPE is to be unbuttonized."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5917 (unless gnus-inhibit-mime-unbuttonizing
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5918 (when (catch 'found
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5919 (let ((types gnus-unbuttonized-mime-types))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5920 (while types
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5921 (when (string-match (pop types) type)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5922 (throw 'found t)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5923 (not (catch 'found
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5924 (let ((types gnus-buttonized-mime-types))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5925 (while types
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5926 (when (string-match (pop types) type)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5927 (throw 'found t)))))))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5928
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5929 (defun gnus-article-insert-newline ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5930 "Insert a newline, but mark it as undeletable."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5931 (gnus-put-text-property
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5932 (point) (progn (insert "\n") (point)) 'gnus-undeletable t))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5933
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5934 (defun gnus-mime-display-alternative (handles &optional preferred ibegend id)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5935 (let* ((preferred (or preferred (mm-preferred-alternative handles)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5936 (ihandles handles)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5937 (point (point))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5938 handle (inhibit-read-only t) from props begend not-pref)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5939 (save-window-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5940 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5941 (when ibegend
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5942 (narrow-to-region (car ibegend)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5943 (or (cdr ibegend)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5944 (progn
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5945 (goto-char (car ibegend))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5946 (forward-line 2)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5947 (point))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5948 (delete-region (point-min) (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5949 (mm-remove-parts handles))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5950 (setq begend (list (point-marker)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5951 ;; Do the toggle.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5952 (unless (setq not-pref (cadr (member preferred ihandles)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5953 (setq not-pref (car ihandles)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5954 (when (or ibegend
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
5955 (not preferred)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5956 (not (gnus-unbuttonized-mime-type-p
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5957 "multipart/alternative")))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5958 (gnus-add-text-properties
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5959 (setq from (point))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5960 (progn
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5961 (insert (format "%d. " id))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5962 (point))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5963 `(gnus-callback
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5964 (lambda (handles)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5965 (unless ,(not ibegend)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5966 (setq gnus-article-mime-handle-alist
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5967 ',gnus-article-mime-handle-alist))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5968 (gnus-mime-display-alternative
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5969 ',ihandles ',not-pref ',begend ,id))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5970 keymap ,gnus-mime-button-map
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5971 ,gnus-mouse-face-prop ,gnus-article-mouse-face
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5972 face ,gnus-article-button-face
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5973 gnus-part ,id
68129
6f5da26b0df1 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents: 67643
diff changeset
5974 article-type multipart))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5975 (widget-convert-button 'link from (point)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5976 :action 'gnus-widget-press-button
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5977 :button-keymap gnus-widget-button-keymap)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5978 ;; Do the handles
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5979 (while (setq handle (pop handles))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5980 (gnus-add-text-properties
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5981 (setq from (point))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5982 (progn
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5983 (insert (format "(%c) %-18s"
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5984 (if (equal handle preferred) ?* ? )
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5985 (mm-handle-media-type handle)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5986 (point))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5987 `(gnus-callback
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5988 (lambda (handles)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5989 (unless ,(not ibegend)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5990 (setq gnus-article-mime-handle-alist
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5991 ',gnus-article-mime-handle-alist))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5992 (gnus-mime-display-alternative
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5993 ',ihandles ',handle ',begend ,id))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
5994 keymap ,gnus-mime-button-map
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5995 ,gnus-mouse-face-prop ,gnus-article-mouse-face
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5996 face ,gnus-article-button-face
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5997 gnus-part ,id
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5998 gnus-data ,handle))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
5999 (widget-convert-button 'link from (point)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6000 :action 'gnus-widget-press-button
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6001 :button-keymap gnus-widget-button-keymap)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6002 (insert " "))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6003 (insert "\n\n"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6004 (when preferred
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6005 (if (stringp (car preferred))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6006 (gnus-display-mime preferred)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6007 (let ((mail-parse-charset gnus-newsgroup-charset)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
6008 (mail-parse-ignored-charsets
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6009 (with-current-buffer gnus-summary-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6010 gnus-newsgroup-ignored-charsets)))
104692
b99b3dda298b Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 104539
diff changeset
6011 (gnus-bind-safe-url-regexp (mm-display-part preferred))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6012 ;; Do highlighting.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6013 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6014 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6015 (narrow-to-region (car begend) (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6016 (gnus-treat-article
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6017 nil (length gnus-article-mime-handle-alist)
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
6018 (gnus-article-mime-total-parts)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6019 (mm-handle-media-type handle))))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6020 (goto-char (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6021 (setcdr begend (point-marker)))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6022 (when ibegend
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6023 (goto-char point))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6024
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6025 (defconst gnus-article-wash-status-strings
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6026 (let ((alist '((cite "c" "Possible hidden citation text"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6027 " " "All citation text visible")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6028 (headers "h" "Hidden headers"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6029 " " "All headers visible.")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6030 (pgp "p" "Encrypted or signed message status hidden"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6031 " " "No hidden encryption nor digital signature status")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6032 (signature "s" "Signature has been hidden"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6033 " " "Signature is visible")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6034 (overstrike "o" "Overstrike (^H) characters applied"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6035 " " "No overstrike characters applied")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6036 (emphasis "e" "/*_Emphasis_*/ characters applied"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6037 " " "No /*_emphasis_*/ characters applied")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6038 result)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6039 (dolist (entry alist result)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6040 (let ((key (nth 0 entry))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6041 (on (copy-sequence (nth 1 entry)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6042 (on-help (nth 2 entry))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6043 (off (copy-sequence (nth 3 entry)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6044 (off-help (nth 4 entry)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6045 (put-text-property 0 1 'help-echo on-help on)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6046 (put-text-property 0 1 'help-echo off-help off)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6047 (push (list key on off) result))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6048 "Alist of strings describing wash status in the mode line.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6049 Each entry has the form (KEY ON OF), where the KEY is a symbol
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6050 representing the particular washing function, ON is the string to use
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6051 in the article mode line when the washing function is active, and OFF
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6052 is the string to use when it is inactive.")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6053
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6054 (defun gnus-article-wash-status-entry (key value)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6055 (let ((entry (assoc key gnus-article-wash-status-strings)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6056 (if value (nth 1 entry) (nth 2 entry))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6057
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6058 (defun gnus-article-wash-status ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6059 "Return a string which display status of article washing."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6060 (with-current-buffer gnus-article-buffer
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6061 (let ((cite (memq 'cite gnus-article-wash-types))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6062 (headers (memq 'headers gnus-article-wash-types))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6063 (boring (memq 'boring-headers gnus-article-wash-types))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6064 (pgp (memq 'pgp gnus-article-wash-types))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6065 (pem (memq 'pem gnus-article-wash-types))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6066 (signed (memq 'signed gnus-article-wash-types))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6067 (encrypted (memq 'encrypted gnus-article-wash-types))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6068 (signature (memq 'signature gnus-article-wash-types))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6069 (overstrike (memq 'overstrike gnus-article-wash-types))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6070 (emphasis (memq 'emphasis gnus-article-wash-types)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6071 (concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6072 (gnus-article-wash-status-entry 'cite cite)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6073 (gnus-article-wash-status-entry 'headers (or headers boring))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6074 (gnus-article-wash-status-entry 'pgp (or pgp pem signed encrypted))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6075 (gnus-article-wash-status-entry 'signature signature)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6076 (gnus-article-wash-status-entry 'overstrike overstrike)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6077 (gnus-article-wash-status-entry 'emphasis emphasis)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6078
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6079 (defun gnus-add-wash-type (type)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6080 "Add a washing of TYPE to the current status."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6081 (add-to-list 'gnus-article-wash-types type))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6082
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6083 (defun gnus-delete-wash-type (type)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6084 "Add a washing of TYPE to the current status."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6085 (setq gnus-article-wash-types (delq type gnus-article-wash-types)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6086
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6087 (defun gnus-add-image (category image)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6088 "Add IMAGE of CATEGORY to the list of displayed images."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6089 (let ((entry (assq category gnus-article-image-alist)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6090 (unless entry
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6091 (setq entry (list category))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6092 (push entry gnus-article-image-alist))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6093 (nconc entry (list image))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6094
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6095 (defun gnus-delete-images (category)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6096 "Delete all images in CATEGORY."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6097 (let ((entry (assq category gnus-article-image-alist)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6098 (dolist (image (cdr entry))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6099 (gnus-remove-image image category))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6100 (setq gnus-article-image-alist (delq entry gnus-article-image-alist))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6101 (gnus-delete-wash-type category)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6102
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6103 (defalias 'gnus-article-hide-headers-if-wanted 'gnus-article-maybe-hide-headers)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6104
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6105 (defun gnus-article-maybe-hide-headers ()
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6106 "Hide unwanted headers if `gnus-have-all-headers' is nil.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6107 Provided for backwards compatibility."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6108 (when (and (or (not (gnus-buffer-live-p gnus-summary-buffer))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6109 (not (with-current-buffer gnus-summary-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6110 gnus-have-all-headers)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6111 (not gnus-inhibit-hiding))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6112 (gnus-article-hide-headers)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6113
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6114 ;;; Article savers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6115
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6116 (defun gnus-output-to-file (file-name)
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6117 "Append the current article to a file named FILE-NAME.
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6118 If `gnus-article-save-coding-system' is non-nil, it is used to encode
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6119 text and used as the value of the coding cookie which is added to the
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6120 top of a file. Otherwise, this function saves a raw article without
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6121 the coding cookie."
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6122 (let* ((artbuf (current-buffer))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6123 (file-name-coding-system nnmail-pathname-coding-system)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6124 (coding gnus-article-save-coding-system)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6125 (coding-system-for-read (if coding
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6126 nil ;; Rely on the coding cookie.
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6127 mm-text-coding-system))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6128 (coding-system-for-write (or coding
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6129 mm-text-coding-system-for-write
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6130 mm-text-coding-system))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6131 (exists (file-exists-p file-name)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6132 (with-temp-buffer
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6133 (when exists
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6134 (insert-file-contents file-name)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6135 (goto-char (point-min))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6136 ;; Remove the existing coding cookie.
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6137 (when (looking-at "X-Gnus-Coding-System: .+\n\n")
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6138 (delete-region (match-beginning 0) (match-end 0))))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6139 (goto-char (point-max))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6140 (insert-buffer-substring artbuf)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6141 ;; Append newline at end of the buffer as separator, and then
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6142 ;; save it to file.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6143 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6144 (insert "\n")
71262
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6145 (when coding
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6146 ;; If the coding system is not suitable to encode the text,
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6147 ;; ask a user for a proper one.
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6148 (when (fboundp 'select-safe-coding-system)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6149 (setq coding (coding-system-base
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6150 (save-window-excursion
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6151 (select-safe-coding-system (point-min) (point-max)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6152 coding))))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6153 (setq coding-system-for-write
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6154 (or (cdr (assq coding '((mule-utf-8 . utf-8))))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6155 coding)))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6156 (goto-char (point-min))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6157 ;; Add the coding cookie.
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6158 (insert (format "X-Gnus-Coding-System: -*- coding: %s; -*-\n\n"
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6159 coding-system-for-write)))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6160 (if exists
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6161 (progn
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6162 (write-region (point-min) (point-max) file-name nil 'no-message)
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6163 (message "Appended to %s" file-name))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6164 (write-region (point-min) (point-max) file-name))))
70b055c73c8c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70377
diff changeset
6165 t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6166
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6167 (defun gnus-narrow-to-page (&optional arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6168 "Narrow the article buffer to a page.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6169 If given a numerical ARG, move forward ARG pages."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6170 (interactive "P")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6171 (setq arg (if arg (prefix-numeric-value arg) 0))
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
6172 (with-current-buffer gnus-article-buffer
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6173 (widen)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6174 ;; Remove any old next/prev buttons.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6175 (when (gnus-visual-p 'page-marker)
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
6176 (let ((inhibit-read-only t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6177 (gnus-remove-text-with-property 'gnus-prev)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6178 (gnus-remove-text-with-property 'gnus-next)))
92694
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6179 (let (st nd pt)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6180 (when (save-excursion
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6181 (cond ((< arg 0)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6182 (if (re-search-backward page-delimiter nil 'move (abs arg))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6183 (prog1
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6184 (setq nd (match-beginning 0)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6185 pt nd)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6186 (when (re-search-backward page-delimiter nil t)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6187 (setq st (match-end 0))))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6188 (when (re-search-forward page-delimiter nil t)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6189 (setq nd (match-beginning 0)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6190 pt (point-min)))))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6191 ((> arg 0)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6192 (if (re-search-forward page-delimiter nil 'move arg)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6193 (prog1
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6194 (setq st (match-end 0)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6195 pt st)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6196 (when (re-search-forward page-delimiter nil t)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6197 (setq nd (match-beginning 0))))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6198 (when (re-search-backward page-delimiter nil t)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6199 (setq st (match-end 0)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6200 pt (point-max)))))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6201 (t
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6202 (when (re-search-backward page-delimiter nil t)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6203 (goto-char (setq st (match-end 0))))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6204 (when (re-search-forward page-delimiter nil t)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6205 (setq nd (match-beginning 0)))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6206 (or st nd))))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6207 (setq gnus-page-broken t)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6208 (when pt (goto-char pt))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6209 (narrow-to-region (or st (point-min)) (or nd (point-max)))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6210 (when (gnus-visual-p 'page-marker)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6211 (save-excursion
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6212 (when nd
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6213 (goto-char nd)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6214 (gnus-insert-next-page-button))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6215 (when st
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6216 (goto-char st)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6217 (gnus-insert-prev-page-button))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6218
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6219 ;; Article mode commands
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6220
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6221 (defun gnus-article-goto-next-page ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6222 "Show the next page of the article."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6223 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6224 (when (gnus-article-next-page)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6225 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6226 (gnus-article-read-summary-keys nil (gnus-character-to-event ?n))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6227
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6228
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6229 (defun gnus-article-goto-prev-page ()
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6230 "Show the previous page of the article."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6231 (interactive)
92694
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6232 (if (save-restriction (widen) (bobp)) ;; Real beginning-of-buffer?
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6233 (gnus-article-read-summary-keys nil (gnus-character-to-event ?p))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6234 (gnus-article-prev-page nil)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6235
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6236 ;; This is cleaner but currently breaks `gnus-pick-mode':
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6237 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6238 ;; (defun gnus-article-goto-next-page ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6239 ;; "Show the next page of the article."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6240 ;; (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6241 ;; (gnus-eval-in-buffer-window gnus-summary-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6242 ;; (gnus-summary-next-page)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6243 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6244 ;; (defun gnus-article-goto-prev-page ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6245 ;; "Show the next page of the article."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6246 ;; (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6247 ;; (gnus-eval-in-buffer-window gnus-summary-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6248 ;; (gnus-summary-prev-page)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6249
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6250 (defun gnus-article-next-page (&optional lines)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6251 "Show the next page of the current article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6252 If end of article, return non-nil. Otherwise return nil.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6253 Argument LINES specifies lines to be scrolled up."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6254 (interactive "p")
97433
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6255 (move-to-window-line (if (featurep 'xemacs) -1 (- -1 scroll-margin)))
85888
ff86fe6b4194 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85809
diff changeset
6256 (if (and (not (and gnus-article-over-scroll
ff86fe6b4194 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85809
diff changeset
6257 (> (count-lines (window-start) (point-max))
97433
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6258 (if (featurep 'xemacs)
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6259 (or lines (1- (window-height)))
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6260 (+ (or lines (1- (window-height))) scroll-margin)))))
85888
ff86fe6b4194 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85809
diff changeset
6261 (save-excursion
ff86fe6b4194 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85809
diff changeset
6262 (end-of-line)
ff86fe6b4194 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85809
diff changeset
6263 (and (pos-visible-in-window-p) ;Not continuation line.
ff86fe6b4194 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85809
diff changeset
6264 (>= (1+ (point)) (point-max))))) ;Allow for trailing newline.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6265 ;; Nothing in this page.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6266 (if (or (not gnus-page-broken)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6267 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6268 (save-restriction
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6269 (widen)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6270 (forward-line)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6271 (eobp)))) ;Real end-of-buffer?
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6272 (progn
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6273 (when gnus-article-over-scroll
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6274 (gnus-article-next-page-1 lines))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6275 t) ;Nothing more.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6276 (gnus-narrow-to-page 1) ;Go to next page.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6277 nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6278 ;; More in this page.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6279 (gnus-article-next-page-1 lines)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6280 nil))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6281
64631
4556f884d581 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-495
Miles Bader <miles@gnu.org>
parents: 64589
diff changeset
6282 (defmacro gnus-article-beginning-of-window ()
4556f884d581 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-495
Miles Bader <miles@gnu.org>
parents: 64589
diff changeset
6283 "Move point to the beginning of the window.
4556f884d581 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-495
Miles Bader <miles@gnu.org>
parents: 64589
diff changeset
6284 In Emacs, the point is placed at the line number which `scroll-margin'
4556f884d581 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-495
Miles Bader <miles@gnu.org>
parents: 64589
diff changeset
6285 specifies."
4556f884d581 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-495
Miles Bader <miles@gnu.org>
parents: 64589
diff changeset
6286 (if (featurep 'xemacs)
4556f884d581 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-495
Miles Bader <miles@gnu.org>
parents: 64589
diff changeset
6287 '(move-to-window-line 0)
4556f884d581 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-495
Miles Bader <miles@gnu.org>
parents: 64589
diff changeset
6288 '(move-to-window-line
4556f884d581 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-495
Miles Bader <miles@gnu.org>
parents: 64589
diff changeset
6289 (min (max 0 scroll-margin)
4556f884d581 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-495
Miles Bader <miles@gnu.org>
parents: 64589
diff changeset
6290 (max 1 (- (window-height)
4556f884d581 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-495
Miles Bader <miles@gnu.org>
parents: 64589
diff changeset
6291 (if mode-line-format 1 0)
97433
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6292 (if header-line-format 1 0)
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6293 2))))))
64631
4556f884d581 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-495
Miles Bader <miles@gnu.org>
parents: 64589
diff changeset
6294
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6295 (defun gnus-article-next-page-1 (lines)
97433
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6296 (unless (featurep 'xemacs)
64693
6bf3cc5c6ab3 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-505
Miles Bader <miles@gnu.org>
parents: 64643
diff changeset
6297 ;; Protect against the bug that Emacs 21.x hangs up when scrolling up for
6bf3cc5c6ab3 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-505
Miles Bader <miles@gnu.org>
parents: 64643
diff changeset
6298 ;; too many number of lines if `scroll-margin' is set as two or greater.
97433
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6299 (when (and (numberp lines)
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6300 (> lines 0)
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6301 (> scroll-margin 0))
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6302 (setq lines (min lines
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6303 (max 0 (- (count-lines (window-start) (point-max))
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6304 scroll-margin))))))
64693
6bf3cc5c6ab3 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-505
Miles Bader <miles@gnu.org>
parents: 64643
diff changeset
6305 (condition-case ()
6bf3cc5c6ab3 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-505
Miles Bader <miles@gnu.org>
parents: 64643
diff changeset
6306 (let ((scroll-in-place nil))
6bf3cc5c6ab3 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-505
Miles Bader <miles@gnu.org>
parents: 64643
diff changeset
6307 (scroll-up lines))
6bf3cc5c6ab3 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-505
Miles Bader <miles@gnu.org>
parents: 64643
diff changeset
6308 (end-of-buffer
6bf3cc5c6ab3 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-505
Miles Bader <miles@gnu.org>
parents: 64643
diff changeset
6309 ;; Long lines may cause an end-of-buffer error.
6bf3cc5c6ab3 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-505
Miles Bader <miles@gnu.org>
parents: 64643
diff changeset
6310 (goto-char (point-max))))
6bf3cc5c6ab3 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-505
Miles Bader <miles@gnu.org>
parents: 64643
diff changeset
6311 (gnus-article-beginning-of-window))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6312
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6313 (defun gnus-article-prev-page (&optional lines)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6314 "Show previous page of current article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6315 Argument LINES specifies lines to be scrolled down."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6316 (interactive "p")
64631
4556f884d581 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-495
Miles Bader <miles@gnu.org>
parents: 64589
diff changeset
6317 (move-to-window-line 0)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6318 (if (and gnus-page-broken
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6319 (bobp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6320 (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer?
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6321 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6322 (gnus-narrow-to-page -1) ;Go to previous page.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6323 (goto-char (point-max))
85888
ff86fe6b4194 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85809
diff changeset
6324 (recenter (if gnus-article-over-scroll
ff86fe6b4194 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85809
diff changeset
6325 (if lines
97433
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6326 (max (if (featurep 'xemacs)
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6327 lines
9400faffc3f1 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97350
diff changeset
6328 (+ lines scroll-margin))
85888
ff86fe6b4194 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85809
diff changeset
6329 3)
ff86fe6b4194 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85809
diff changeset
6330 (- (window-height) 2))
ff86fe6b4194 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85809
diff changeset
6331 -1)))
64643
5ecf32f96408 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-498
Miles Bader <miles@gnu.org>
parents: 64631
diff changeset
6332 (prog1
5ecf32f96408 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-498
Miles Bader <miles@gnu.org>
parents: 64631
diff changeset
6333 (condition-case ()
5ecf32f96408 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-498
Miles Bader <miles@gnu.org>
parents: 64631
diff changeset
6334 (let ((scroll-in-place nil))
5ecf32f96408 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-498
Miles Bader <miles@gnu.org>
parents: 64631
diff changeset
6335 (scroll-down lines))
5ecf32f96408 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-498
Miles Bader <miles@gnu.org>
parents: 64631
diff changeset
6336 (beginning-of-buffer
5ecf32f96408 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-498
Miles Bader <miles@gnu.org>
parents: 64631
diff changeset
6337 (goto-char (point-min))))
5ecf32f96408 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-498
Miles Bader <miles@gnu.org>
parents: 64631
diff changeset
6338 (gnus-article-beginning-of-window))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6339
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6340 (defun gnus-article-only-boring-p ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6341 "Decide whether there is only boring text remaining in the article.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6342 Something \"interesting\" is a word of at least two letters that does
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6343 not have a face in `gnus-article-boring-faces'."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6344 (when (and gnus-article-skip-boring
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6345 (boundp 'gnus-article-boring-faces)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6346 (symbol-value 'gnus-article-boring-faces))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6347 (save-excursion
69572
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
6348 (let ((inhibit-point-motion-hooks t))
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
6349 (catch 'only-boring
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
6350 (while (re-search-forward "\\b\\w\\w" nil t)
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
6351 (forward-char -1)
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
6352 (when (not (gnus-intersection
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
6353 (gnus-faces-at (point))
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
6354 (symbol-value 'gnus-article-boring-faces)))
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
6355 (throw 'only-boring nil)))
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 68944
diff changeset
6356 (throw 'only-boring t))))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6357
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6358 (defun gnus-article-refer-article ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6359 "Read article specified by message-id around point."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6360 (interactive)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6361 (save-excursion
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6362 (re-search-backward "[ \t]\\|^" (point-at-bol) t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6363 (re-search-forward "<?news:<?\\|<" (point-at-eol) t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6364 (if (re-search-forward "[^@ ]+@[^ \t>]+" (point-at-eol) t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6365 (let ((msg-id (concat "<" (match-string 0) ">")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6366 (set-buffer gnus-summary-buffer)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6367 (gnus-summary-refer-article msg-id))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6368 (error "No references around point"))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6369
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6370 (defun gnus-article-show-summary ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6371 "Reconfigure windows to show summary buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6372 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6373 (if (not (gnus-buffer-live-p gnus-summary-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6374 (error "There is no summary buffer for this article buffer")
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
6375 (gnus-article-set-globals)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6376 (gnus-configure-windows 'article)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6377 (gnus-summary-goto-subject gnus-current-article)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6378 (gnus-summary-position-point)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6379
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6380 (defun gnus-article-describe-briefly ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6381 "Describe article mode commands briefly."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6382 (interactive)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6383 (gnus-message 6 (substitute-command-keys "\\<gnus-article-mode-map>\\[gnus-article-goto-next-page]:Next page \\[gnus-article-goto-prev-page]:Prev page \\[gnus-article-show-summary]:Show summary \\[gnus-info-find-node]:Run Info \\[gnus-article-describe-briefly]:This help")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6384
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6385 (defun gnus-article-check-buffer ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6386 "Beep if not in an article buffer."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6387 (unless (equal major-mode 'gnus-article-mode)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6388 (error "Command invoked outside of a Gnus article buffer")))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6389
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6390 (defun gnus-article-read-summary-keys (&optional arg key not-restore-window)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6391 "Read a summary buffer key sequence and execute it from the article buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6392 (interactive "P")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6393 (gnus-article-check-buffer)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6394 (let ((nosaves
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6395 '("q" "Q" "c" "r" "\C-c\C-f" "m" "a" "f"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6396 "Zc" "ZC" "ZE" "ZQ" "ZZ" "Zn" "ZR" "ZG" "ZN" "ZP"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6397 "=" "^" "\M-^" "|"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6398 (nosave-but-article
87859
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6399 '("A " "A<" "A>" "AM" "AP" "AR" "AT" "A\C-?" "A\M-\r" "A\r" "Ab" "Ae"
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6400 "An" "Ap" [?A (meta return)] [?A delete]))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6401 (nosave-in-article
87859
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6402 '("AS" "\C-d"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6403 (up-to-top
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6404 '("n" "Gn" "p" "Gp"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6405 keys new-sum-point)
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
6406 (with-current-buffer gnus-article-current-summary
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6407 (let (gnus-pick-mode)
87696
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6408 (setq unread-command-events (nconc unread-command-events
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6409 (list (or key last-command-event)))
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6410 keys (if (featurep 'xemacs)
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6411 (events-to-keys (read-key-sequence nil t))
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6412 (read-key-sequence nil t)))))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
6413
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6414 (message "")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6415
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6416 (cond
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6417 ((eq (aref keys (1- (length keys))) ?\C-h)
87859
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6418 (gnus-article-describe-bindings (substring keys 0 -1)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6419 ((or (member keys nosaves)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6420 (member keys nosave-but-article)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6421 (member keys nosave-in-article))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6422 (let (func)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6423 (save-window-excursion
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6424 (pop-to-buffer gnus-article-current-summary)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6425 ;; We disable the pick minor mode commands.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6426 (let (gnus-pick-mode)
104068
a86fc864e9fc Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 103352
diff changeset
6427 (setq func (key-binding keys t))))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6428 (if (or (not func)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6429 (numberp func))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6430 (ding)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6431 (unless (member keys nosave-in-article)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6432 (set-buffer gnus-article-current-summary))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6433 (call-interactively func)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6434 (setq new-sum-point (point)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6435 (when (member keys nosave-but-article)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6436 (pop-to-buffer gnus-article-buffer))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6437 (t
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6438 ;; These commands should restore window configuration.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6439 (let ((obuf (current-buffer))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6440 (owin (current-window-configuration))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6441 win func in-buffer selected new-sum-start new-sum-hscroll err)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6442 (cond (not-restore-window
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6443 (pop-to-buffer gnus-article-current-summary)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6444 (setq win (selected-window)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6445 ((setq win (get-buffer-window gnus-article-current-summary))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6446 (select-window win))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6447 (t
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6448 (let ((summary-buffer gnus-article-current-summary))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6449 (gnus-configure-windows 'article)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6450 (unless (setq win (get-buffer-window summary-buffer 'visible))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6451 (let ((gnus-buffer-configuration
104889
18c2aea5083c 2009-09-09 Katsumi Yamaoka <yamaoka@jpl.org>
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 104789
diff changeset
6452 '((article ((vertical 1.0
18c2aea5083c 2009-09-09 Katsumi Yamaoka <yamaoka@jpl.org>
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 104789
diff changeset
6453 (summary 0.25 point)
18c2aea5083c 2009-09-09 Katsumi Yamaoka <yamaoka@jpl.org>
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 104789
diff changeset
6454 (article 1.0)))))))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6455 (gnus-configure-windows 'article))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6456 (setq win (get-buffer-window summary-buffer 'visible)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6457 (gnus-select-frame-set-input-focus (window-frame win))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6458 (select-window win))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6459 (setq in-buffer (current-buffer))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6460 ;; We disable the pick minor mode commands.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6461 (if (and (setq func (let (gnus-pick-mode)
104068
a86fc864e9fc Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 103352
diff changeset
6462 (key-binding keys t)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6463 (functionp func)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6464 (condition-case code
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6465 (progn
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6466 (call-interactively func)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6467 t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6468 (error
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6469 (setq err code)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6470 nil)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6471 (progn
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6472 (when (eq win (selected-window))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6473 (setq new-sum-point (point)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6474 new-sum-start (window-start win)
61487
f5e70b5f16ce Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-248
Miles Bader <miles@gnu.org>
parents: 61304
diff changeset
6475 new-sum-hscroll (window-hscroll win)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6476 (when (or (eq in-buffer (current-buffer))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6477 (when (eq obuf (current-buffer))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6478 (set-buffer in-buffer)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6479 t))
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
6480 (setq selected (gnus-summary-select-article))
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
6481 (set-buffer obuf)
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
6482 (unless not-restore-window
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
6483 (set-window-configuration owin))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6484 (when (and (eq selected 'old)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6485 new-sum-point)
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
6486 (set-window-start (get-buffer-window (current-buffer))
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
6487 1)
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
6488 (set-window-point (get-buffer-window (current-buffer))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6489 (if (article-goto-body)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6490 (1- (point))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6491 (point))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6492 (when (and (not not-restore-window)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6493 new-sum-point
98398
39408ed11da9 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 98113
diff changeset
6494 (window-live-p win)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6495 (with-current-buffer (window-buffer win)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6496 (eq major-mode 'gnus-summary-mode)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6497 (set-window-point win new-sum-point)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6498 (set-window-start win new-sum-start)
61487
f5e70b5f16ce Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-248
Miles Bader <miles@gnu.org>
parents: 61304
diff changeset
6499 (set-window-hscroll win new-sum-hscroll))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6500 (set-window-configuration owin)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6501 (if err
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6502 (signal (car err) (cdr err))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6503 (ding))))))))
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
6504
87696
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6505 (defun gnus-article-read-summary-send-keys ()
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6506 (interactive)
87859
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6507 (let ((unread-command-events (list (gnus-character-to-event ?S))))
87696
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6508 (gnus-article-read-summary-keys)))
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6509
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
6510 (defun gnus-article-describe-key (key)
87696
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6511 "Display documentation of the function invoked by KEY.
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6512 KEY is a string or a vector."
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6513 (interactive (list (let ((cursor-in-echo-area t)) ;; better for XEmacs.
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6514 (read-key-sequence "Describe key: "))))
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
6515 (gnus-article-check-buffer)
87696
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6516 (if (memq (key-binding key t) '(gnus-article-read-summary-keys
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6517 gnus-article-read-summary-send-keys))
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
6518 (with-current-buffer gnus-article-current-summary
87696
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6519 (setq unread-command-events
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6520 (if (featurep 'xemacs)
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6521 (append key nil)
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6522 (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6523 (list 'meta (- x 128))
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6524 x))
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6525 key)))
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6526 (let ((cursor-in-echo-area t)
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6527 gnus-pick-mode)
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6528 (describe-key (read-key-sequence nil t))))
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
6529 (describe-key key)))
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
6530
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
6531 (defun gnus-article-describe-key-briefly (key &optional insert)
87696
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6532 "Display documentation of the function invoked by KEY.
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6533 KEY is a string or a vector."
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6534 (interactive (list (let ((cursor-in-echo-area t)) ;; better for XEmacs.
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6535 (read-key-sequence "Describe key: "))
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6536 current-prefix-arg))
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
6537 (gnus-article-check-buffer)
87696
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6538 (if (memq (key-binding key t) '(gnus-article-read-summary-keys
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6539 gnus-article-read-summary-send-keys))
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
6540 (with-current-buffer gnus-article-current-summary
87696
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6541 (setq unread-command-events
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6542 (if (featurep 'xemacs)
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6543 (append key nil)
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6544 (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6545 (list 'meta (- x 128))
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6546 x))
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6547 key)))
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6548 (let ((cursor-in-echo-area t)
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6549 gnus-pick-mode)
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6550 (describe-key-briefly (read-key-sequence nil t) insert)))
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
6551 (describe-key-briefly key insert)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6552
87859
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6553 ;;`gnus-agent-mode' in gnus-agent.el will define it.
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6554 (defvar gnus-agent-summary-mode)
91506
ab078721fd90 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87928
diff changeset
6555 (defvar gnus-draft-mode)
105734
40fde606ec60 (help-xref-stack-item): Define for compiler.
Glenn Morris <rgm@gnu.org>
parents: 105253
diff changeset
6556 ;; Calling help-buffer will autoload help-mode.
40fde606ec60 (help-xref-stack-item): Define for compiler.
Glenn Morris <rgm@gnu.org>
parents: 105253
diff changeset
6557 (defvar help-xref-stack-item)
87859
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6558
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6559 (defun gnus-article-describe-bindings (&optional prefix)
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6560 "Show a list of all defined keys, and their definitions.
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6561 The optional argument PREFIX, if non-nil, should be a key sequence;
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6562 then we display only bindings that start with that prefix."
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6563 (interactive)
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6564 (gnus-article-check-buffer)
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6565 (let ((keymap (copy-keymap gnus-article-mode-map))
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6566 (map (copy-keymap gnus-article-send-map))
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6567 (sumkeys (where-is-internal 'gnus-article-read-summary-keys))
106746
e09f67191b6c Merge from mainline.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 105734
diff changeset
6568 parent agent draft)
87859
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6569 (define-key keymap "S" map)
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6570 (define-key map [t] nil)
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6571 (with-current-buffer gnus-article-current-summary
106746
e09f67191b6c Merge from mainline.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 105734
diff changeset
6572 (set-keymap-parent
e09f67191b6c Merge from mainline.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 105734
diff changeset
6573 keymap
e09f67191b6c Merge from mainline.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 105734
diff changeset
6574 (if (setq parent (keymap-parent gnus-article-mode-map))
e09f67191b6c Merge from mainline.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 105734
diff changeset
6575 (prog1
e09f67191b6c Merge from mainline.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 105734
diff changeset
6576 (setq parent (copy-keymap parent))
e09f67191b6c Merge from mainline.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 105734
diff changeset
6577 (set-keymap-parent parent (current-local-map)))
e09f67191b6c Merge from mainline.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 105734
diff changeset
6578 (current-local-map)))
87859
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6579 (set-keymap-parent map (key-binding "S"))
92694
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6580 (let (key def gnus-pick-mode)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6581 (while sumkeys
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6582 (setq key (pop sumkeys))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6583 (cond ((and (vectorp key) (= (length key) 1)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6584 (consp (setq def (aref key 0)))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6585 (numberp (car def)) (numberp (cdr def)))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6586 (when (< (max (car def) (cdr def)) 128)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6587 (setq sumkeys
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6588 (append (mapcar
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6589 #'vector
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6590 (nreverse (gnus-uncompress-range def)))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6591 sumkeys))))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6592 ((setq def (key-binding key))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6593 (unless (eq def 'undefined)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92488
diff changeset
6594 (define-key keymap key def))))))
87859
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6595 (when (boundp 'gnus-agent-summary-mode)
91506
ab078721fd90 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87928
diff changeset
6596 (setq agent gnus-agent-summary-mode))
ab078721fd90 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87928
diff changeset
6597 (when (boundp 'gnus-draft-mode)
ab078721fd90 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87928
diff changeset
6598 (setq draft gnus-draft-mode)))
87859
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6599 (with-temp-buffer
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6600 (use-local-map keymap)
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6601 (set (make-local-variable 'gnus-agent-summary-mode) agent)
91506
ab078721fd90 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87928
diff changeset
6602 (set (make-local-variable 'gnus-draft-mode) draft)
87859
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6603 (describe-bindings prefix))
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6604 (let ((item `((lambda (prefix)
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
6605 (with-current-buffer ,(current-buffer)
87859
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6606 (gnus-article-describe-bindings prefix)))
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6607 ,prefix)))
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6608 (with-current-buffer (if (fboundp 'help-buffer)
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6609 (let (help-xref-following) (help-buffer))
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6610 "*Help*") ;; Emacs 21
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6611 (setq help-xref-stack-item item)))))
1bb83c2fe524 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87696
diff changeset
6612
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6613 (defun gnus-article-reply-with-original (&optional wide)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6614 "Start composing a reply mail to the current message.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6615 The text in the region will be yanked. If the region isn't active,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6616 the entire article will be yanked."
87696
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6617 (interactive)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6618 (let ((article (cdr gnus-article-current))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6619 contents)
84989
d7862063d437 (gnus-article-reply-with-original)
David Kastrup <dak@gnu.org>
parents: 82491
diff changeset
6620 (if (not (gnus-region-active-p))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6621 (with-current-buffer gnus-summary-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6622 (gnus-summary-reply (list (list article)) wide))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6623 (setq contents (buffer-substring (point) (mark t)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6624 ;; Deactivate active regions.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6625 (when (and (boundp 'transient-mark-mode)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6626 transient-mark-mode)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6627 (setq mark-active nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6628 (with-current-buffer gnus-summary-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6629 (gnus-summary-reply
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6630 (list (list article contents)) wide)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6631
87696
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6632 (defun gnus-article-wide-reply-with-original ()
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6633 "Start composing a wide reply mail to the current message.
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6634 The text in the region will be yanked. If the region isn't active,
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6635 the entire article will be yanked."
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6636 (interactive)
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6637 (gnus-article-reply-with-original t))
d5a92df16467 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87649
diff changeset
6638
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6639 (defun gnus-article-followup-with-original ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6640 "Compose a followup to the current article.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6641 The text in the region will be yanked. If the region isn't active,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6642 the entire article will be yanked."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6643 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6644 (let ((article (cdr gnus-article-current))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6645 contents)
84989
d7862063d437 (gnus-article-reply-with-original)
David Kastrup <dak@gnu.org>
parents: 82491
diff changeset
6646 (if (not (gnus-region-active-p))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6647 (with-current-buffer gnus-summary-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6648 (gnus-summary-followup (list (list article))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6649 (setq contents (buffer-substring (point) (mark t)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6650 ;; Deactivate active regions.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6651 (when (and (boundp 'transient-mark-mode)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6652 transient-mark-mode)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6653 (setq mark-active nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6654 (with-current-buffer gnus-summary-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6655 (gnus-summary-followup
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6656 (list (list article contents)))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6657
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6658 (defun gnus-article-hide (&optional arg force)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6659 "Hide all the gruft in the current article.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6660 This means that signatures, cited text and (some) headers will be
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6661 hidden.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6662 If given a prefix, show the hidden text instead."
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6663 (interactive (append (gnus-article-hidden-arg) (list 'force)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6664 (gnus-article-hide-headers arg)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6665 (gnus-article-hide-list-identifiers arg)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6666 (gnus-article-hide-citation-maybe arg force)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6667 (gnus-article-hide-signature arg))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6668
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6669 (defun gnus-article-maybe-highlight ()
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6670 "Do some article highlighting if article highlighting is requested."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6671 (when (gnus-visual-p 'article-highlight 'highlight)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6672 (gnus-article-highlight-some)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6673
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6674 (defun gnus-check-group-server ()
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6675 ;; Make sure the connection to the server is alive.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6676 (unless (gnus-server-opened
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6677 (gnus-find-method-for-group gnus-newsgroup-name))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6678 (gnus-check-server (gnus-find-method-for-group gnus-newsgroup-name))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6679 (gnus-request-group gnus-newsgroup-name t)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6680
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6681 (eval-when-compile
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6682 (autoload 'nneething-get-file-name "nneething"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6683
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6684 (defun gnus-request-article-this-buffer (article group)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6685 "Get an article and insert it into this buffer."
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6686 (let (do-update-line sparse-header)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6687 (prog1
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6688 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6689 (erase-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6690 (gnus-kill-all-overlays)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6691 (setq group (or group gnus-newsgroup-name))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6692
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6693 ;; Using `gnus-request-article' directly will insert the article into
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6694 ;; `nntp-server-buffer' - so we'll save some time by not having to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6695 ;; copy it from the server buffer into the article buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6696
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6697 ;; We only request an article by message-id when we do not have the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6698 ;; headers for it, so we'll have to get those.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6699 (when (stringp article)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6700 (gnus-read-header article))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6701
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6702 ;; If the article number is negative, that means that this article
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6703 ;; doesn't belong in this newsgroup (possibly), so we find its
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6704 ;; message-id and request it by id instead of number.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6705 (when (and (numberp article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6706 gnus-summary-buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6707 (get-buffer gnus-summary-buffer)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6708 (gnus-buffer-exists-p gnus-summary-buffer))
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
6709 (with-current-buffer gnus-summary-buffer
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6710 (let ((header (gnus-summary-article-header article)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6711 (when (< article 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6712 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6713 ((memq article gnus-newsgroup-sparse)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6714 ;; This is a sparse gap article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6715 (setq do-update-line article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6716 (setq article (mail-header-id header))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6717 (setq sparse-header (gnus-read-header article))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6718 (setq gnus-newsgroup-sparse
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6719 (delq article gnus-newsgroup-sparse)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6720 ((vectorp header)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6721 ;; It's a real article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6722 (setq article (mail-header-id header)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6723 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6724 ;; It is an extracted pseudo-article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6725 (setq article 'pseudo)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6726 (gnus-request-pseudo-article header))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6727
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6728 (let ((method (gnus-find-method-for-group
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6729 gnus-newsgroup-name)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6730 (when (and (eq (car method) 'nneething)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6731 (vectorp header))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6732 (let ((dir (nneething-get-file-name
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6733 (mail-header-id header))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6734 (when (and (stringp dir)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6735 (file-directory-p dir))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6736 (setq article 'nneething)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6737 (gnus-group-enter-directory dir))))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6738
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6739 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6740 ;; Refuse to select canceled articles.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6741 ((and (numberp article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6742 gnus-summary-buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6743 (get-buffer gnus-summary-buffer)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6744 (gnus-buffer-exists-p gnus-summary-buffer)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6745 (eq (cdr (with-current-buffer gnus-summary-buffer
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6746 (assq article gnus-newsgroup-reads)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6747 gnus-canceled-mark))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6748 nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6749 ;; We first check `gnus-original-article-buffer'.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6750 ((and (get-buffer gnus-original-article-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6751 (numberp article)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6752 (with-current-buffer gnus-original-article-buffer
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6753 (and (equal (car gnus-original-article) group)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6754 (eq (cdr gnus-original-article) article))))
93726
3e95f26e3241 (gnus-mime-replace-part): Remove unnecessary use of mm-with-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
6755 ;; `insert-buffer-substring' would incorrectly use the
3e95f26e3241 (gnus-mime-replace-part): Remove unnecessary use of mm-with-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
6756 ;; equivalent of string-make-multibyte which amount to decoding
3e95f26e3241 (gnus-mime-replace-part): Remove unnecessary use of mm-with-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
6757 ;; with locale-coding-system, causing failure of
3e95f26e3241 (gnus-mime-replace-part): Remove unnecessary use of mm-with-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
6758 ;; subsequent decoding.
3e95f26e3241 (gnus-mime-replace-part): Remove unnecessary use of mm-with-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
6759 (insert (mm-string-to-multibyte
3e95f26e3241 (gnus-mime-replace-part): Remove unnecessary use of mm-with-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
6760 (with-current-buffer gnus-original-article-buffer
3e95f26e3241 (gnus-mime-replace-part): Remove unnecessary use of mm-with-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
6761 (buffer-substring (point-min) (point-max)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6762 'article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6763 ;; Check the backlog.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6764 ((and gnus-keep-backlog
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6765 (gnus-backlog-request-article group article (current-buffer)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6766 'article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6767 ;; Check asynchronous pre-fetch.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6768 ((gnus-async-request-fetched-article group article (current-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6769 (gnus-async-prefetch-next group article gnus-summary-buffer)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6770 (when (and (numberp article) gnus-keep-backlog)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6771 (gnus-backlog-enter-article group article (current-buffer)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6772 'article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6773 ;; Check the cache.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6774 ((and gnus-use-cache
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6775 (numberp article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6776 (gnus-cache-request-article article group))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6777 'article)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6778 ;; Check the agent cache.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6779 ((gnus-agent-request-article article group)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6780 'article)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6781 ;; Get the article and put into the article buffer.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6782 ((or (stringp article)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6783 (numberp article))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6784 (let ((gnus-override-method gnus-override-method)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
6785 (methods (and (stringp article)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6786 gnus-refer-article-method))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6787 (backend (car (gnus-find-method-for-group
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6788 gnus-newsgroup-name)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6789 result
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
6790 (inhibit-read-only t))
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
6791 (if (or (not (listp methods))
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
6792 (and (symbolp (car methods))
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
6793 (assq (car methods) nnoo-definition-alist)))
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
6794 (setq methods (list methods)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6795 (when (and (null gnus-override-method)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6796 methods)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6797 (setq gnus-override-method (pop methods)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6798 (while (not result)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6799 (when (eq gnus-override-method 'current)
39335
65ef5b3fc045 (gnus-request-article-this-buffer): Refer to
Gerd Moellmann <gerd@gnu.org>
parents: 38861
diff changeset
6800 (setq gnus-override-method
65ef5b3fc045 (gnus-request-article-this-buffer): Refer to
Gerd Moellmann <gerd@gnu.org>
parents: 38861
diff changeset
6801 (with-current-buffer gnus-summary-buffer
65ef5b3fc045 (gnus-request-article-this-buffer): Refer to
Gerd Moellmann <gerd@gnu.org>
parents: 38861
diff changeset
6802 gnus-current-select-method)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6803 (erase-buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6804 (gnus-kill-all-overlays)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6805 (let ((gnus-newsgroup-name group))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6806 (gnus-check-group-server))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6807 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6808 ((gnus-request-article article group (current-buffer))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6809 (when (numberp article)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
6810 (gnus-async-prefetch-next group article
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6811 gnus-summary-buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6812 (when gnus-keep-backlog
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6813 (gnus-backlog-enter-article
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6814 group article (current-buffer))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6815 (setq result 'article))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6816 (methods
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6817 (setq gnus-override-method (pop methods)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6818 ((not (string-match "^400 "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6819 (nnheader-get-report backend)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6820 ;; If we get 400 server disconnect, reconnect and
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6821 ;; retry; otherwise, assume the article has expired.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6822 (setq result 'done))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6823 (and (eq result 'article) 'article)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6824 ;; It was a pseudo.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6825 (t article)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6826
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6827 ;; Associate this article with the current summary buffer.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6828 (setq gnus-article-current-summary gnus-summary-buffer)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6829
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6830 ;; Take the article from the original article buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6831 ;; and place it in the buffer it's supposed to be in.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6832 (when (and (get-buffer gnus-article-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6833 (equal (buffer-name (current-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6834 (buffer-name (get-buffer gnus-article-buffer))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6835 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6836 (if (get-buffer gnus-original-article-buffer)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6837 (set-buffer gnus-original-article-buffer)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6838 (set-buffer (gnus-get-buffer-create gnus-original-article-buffer))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6839 (buffer-disable-undo)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6840 (setq major-mode 'gnus-original-article-mode)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6841 (setq buffer-read-only t))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6842 (let ((inhibit-read-only t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6843 (erase-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6844 (insert-buffer-substring gnus-article-buffer))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6845 (setq gnus-original-article (cons group article)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6846
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6847 ;; Decode charsets.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6848 (run-hooks 'gnus-article-decode-hook)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6849 ;; Mark article as decoded or not.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6850 (setq gnus-article-decoded-p gnus-article-decode-hook))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6851
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6852 ;; Update sparse articles.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6853 (when (and do-update-line
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6854 (or (numberp article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6855 (stringp article)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6856 (let ((buf (current-buffer)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6857 (set-buffer gnus-summary-buffer)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6858 (gnus-summary-update-article do-update-line sparse-header)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6859 (gnus-summary-goto-subject do-update-line nil t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6860 (set-window-point (gnus-get-buffer-window (current-buffer) t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6861 (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6862 (set-buffer buf))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6863
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6864 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6865 ;;; Article editing
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6866 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6867
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6868 (defcustom gnus-article-edit-mode-hook nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6869 "Hook run in article edit mode buffers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6870 :group 'gnus-article-various
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6871 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6872
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6873 (defvar gnus-article-edit-done-function nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6874
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6875 (defvar gnus-article-edit-mode-map nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6876
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6877 ;; Should we be using derived.el for this?
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6878 (unless gnus-article-edit-mode-map
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6879 (setq gnus-article-edit-mode-map (make-keymap))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6880 (set-keymap-parent gnus-article-edit-mode-map text-mode-map)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6881
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6882 (gnus-define-keys gnus-article-edit-mode-map
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6883 "\C-c?" describe-mode
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6884 "\C-c\C-c" gnus-article-edit-done
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6885 "\C-c\C-k" gnus-article-edit-exit
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6886 "\C-c\C-f\C-t" message-goto-to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6887 "\C-c\C-f\C-o" message-goto-from
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6888 "\C-c\C-f\C-b" message-goto-bcc
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6889 ;;"\C-c\C-f\C-w" message-goto-fcc
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6890 "\C-c\C-f\C-c" message-goto-cc
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6891 "\C-c\C-f\C-s" message-goto-subject
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6892 "\C-c\C-f\C-r" message-goto-reply-to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6893 "\C-c\C-f\C-n" message-goto-newsgroups
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6894 "\C-c\C-f\C-d" message-goto-distribution
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6895 "\C-c\C-f\C-f" message-goto-followup-to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6896 "\C-c\C-f\C-m" message-goto-mail-followup-to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6897 "\C-c\C-f\C-k" message-goto-keywords
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6898 "\C-c\C-f\C-u" message-goto-summary
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6899 "\C-c\C-f\C-i" message-insert-or-toggle-importance
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6900 "\C-c\C-f\C-a" message-generate-unsubscribed-mail-followup-to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6901 "\C-c\C-b" message-goto-body
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6902 "\C-c\C-i" message-goto-signature
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6903
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6904 "\C-c\C-t" message-insert-to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6905 "\C-c\C-n" message-insert-newsgroups
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6906 "\C-c\C-o" message-sort-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6907 "\C-c\C-e" message-elide-region
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6908 "\C-c\C-v" message-delete-not-region
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6909 "\C-c\C-z" message-kill-to-signature
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6910 "\M-\r" message-newline-and-reformat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6911 "\C-c\C-a" mml-attach-file
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6912 "\C-a" message-beginning-of-line
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6913 "\t" message-tab
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6914 "\M-;" comment-region)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6915
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6916 (gnus-define-keys (gnus-article-edit-wash-map
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6917 "\C-c\C-w" gnus-article-edit-mode-map)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6918 "f" gnus-article-edit-full-stops))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6919
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6920 (easy-menu-define
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6921 gnus-article-edit-mode-field-menu gnus-article-edit-mode-map ""
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6922 '("Field"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6923 ["Fetch To" message-insert-to t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6924 ["Fetch Newsgroups" message-insert-newsgroups t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6925 "----"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6926 ["To" message-goto-to t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6927 ["From" message-goto-from t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6928 ["Subject" message-goto-subject t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6929 ["Cc" message-goto-cc t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6930 ["Reply-To" message-goto-reply-to t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6931 ["Summary" message-goto-summary t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6932 ["Keywords" message-goto-keywords t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6933 ["Newsgroups" message-goto-newsgroups t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6934 ["Followup-To" message-goto-followup-to t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6935 ["Mail-Followup-To" message-goto-mail-followup-to t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6936 ["Distribution" message-goto-distribution t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6937 ["Body" message-goto-body t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6938 ["Signature" message-goto-signature t]))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6939
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
6940 (define-derived-mode gnus-article-edit-mode message-mode "Article Edit"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6941 "Major mode for editing articles.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6942 This is an extended text-mode.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6943
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6944 \\{gnus-article-edit-mode-map}"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6945 (make-local-variable 'gnus-article-edit-done-function)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6946 (make-local-variable 'gnus-prev-winconf)
43273
b8391c00e2c9 * gnus-art.el (gnus-article-edit-mode): Use define-derived-mode.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 43166
diff changeset
6947 (set (make-local-variable 'font-lock-defaults)
b8391c00e2c9 * gnus-art.el (gnus-article-edit-mode): Use define-derived-mode.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 43166
diff changeset
6948 '(message-font-lock-keywords t))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6949 (set (make-local-variable 'mail-header-separator) "")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6950 (set (make-local-variable 'gnus-article-edit-mode) t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6951 (easy-menu-add message-mode-field-menu message-mode-map)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6952 (mml-mode)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6953 (setq buffer-read-only nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6954 (buffer-enable-undo)
43273
b8391c00e2c9 * gnus-art.el (gnus-article-edit-mode): Use define-derived-mode.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 43166
diff changeset
6955 (widen))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6956
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6957 (defun gnus-article-edit (&optional force)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6958 "Edit the current article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6959 This will have permanent effect only in mail groups.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6960 If FORCE is non-nil, allow editing of articles even in read-only
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6961 groups."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6962 (interactive "P")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6963 (when (and (not force)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6964 (gnus-group-read-only-p))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
6965 (error "The current newsgroup does not support article editing"))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6966 (gnus-article-date-original)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6967 (gnus-article-edit-article
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6968 'ignore
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6969 `(lambda (no-highlight)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6970 'ignore
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6971 (gnus-summary-edit-article-done
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6972 ,(or (mail-header-references gnus-current-headers) "")
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6973 ,(gnus-group-read-only-p) ,gnus-summary-buffer no-highlight))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6974
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6975 (defun gnus-article-edit-article (start-func exit-func &optional quiet)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6976 "Start editing the contents of the current article buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6977 (let ((winconf (current-window-configuration)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6978 (set-buffer gnus-article-buffer)
57923
d7def5572cf3 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-668
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
6979 (let ((message-auto-save-directory
d7def5572cf3 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-668
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
6980 ;; Don't associate the article buffer with a draft file.
d7def5572cf3 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-668
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
6981 nil))
d7def5572cf3 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-668
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
6982 (gnus-article-edit-mode))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
6983 (funcall start-func)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6984 (set-buffer-modified-p nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6985 (gnus-configure-windows 'edit-article)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6986 (setq gnus-article-edit-done-function exit-func)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6987 (setq gnus-prev-winconf winconf)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6988 (unless quiet
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
6989 (gnus-message 6 "C-c C-c to end edits"))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6990
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6991 (defun gnus-article-edit-done (&optional arg)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6992 "Update the article edits and exit."
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
6993 (interactive "P")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6994 (let ((func gnus-article-edit-done-function)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6995 (buf (current-buffer))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6996 (start (window-start))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6997 (p (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6998 (winconf gnus-prev-winconf))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
6999 (widen) ;; Widen it in case that users narrowed the buffer.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7000 (funcall func arg)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7001 (set-buffer buf)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7002 ;; The cache and backlog have to be flushed somewhat.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7003 (when gnus-keep-backlog
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7004 (gnus-backlog-remove-article
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7005 (car gnus-article-current) (cdr gnus-article-current)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7006 ;; Flush original article as well.
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
7007 (when (get-buffer gnus-original-article-buffer)
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
7008 (with-current-buffer gnus-original-article-buffer
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7009 (setq gnus-original-article nil)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7010 (when gnus-use-cache
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7011 (gnus-cache-update-article
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7012 (car gnus-article-current) (cdr gnus-article-current)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7013 ;; We remove all text props from the article buffer.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7014 (kill-all-local-variables)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7015 (set-text-properties (point-min) (point-max) nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7016 (gnus-article-mode)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7017 (set-window-configuration winconf)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7018 (set-buffer buf)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7019 (set-window-start (get-buffer-window buf) start)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7020 (set-window-point (get-buffer-window buf) (point)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7021 (gnus-summary-show-article))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7022
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7023 (defun gnus-article-edit-exit ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7024 "Exit the article editing without updating."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7025 (interactive)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7026 (when (or (not (buffer-modified-p))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7027 (yes-or-no-p "Article modified; kill anyway? "))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7028 (let ((curbuf (current-buffer))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7029 (p (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7030 (window-start (window-start)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7031 (erase-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7032 (if (gnus-buffer-live-p gnus-original-article-buffer)
64631
4556f884d581 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-495
Miles Bader <miles@gnu.org>
parents: 64589
diff changeset
7033 (insert-buffer-substring gnus-original-article-buffer))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7034 (let ((winconf gnus-prev-winconf))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7035 (kill-all-local-variables)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7036 (gnus-article-mode)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7037 (set-window-configuration winconf)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7038 ;; Tippy-toe some to make sure that point remains where it was.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7039 (save-current-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7040 (set-buffer curbuf)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7041 (set-window-start (get-buffer-window (current-buffer)) window-start)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7042 (goto-char p))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7043 (gnus-summary-show-article)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7044
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7045 (defun gnus-article-edit-full-stops ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7046 "Interactively repair spacing at end of sentences."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7047 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7048 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7049 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7050 (search-forward-regexp "^$" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7051 (let ((case-fold-search nil))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7052 (query-replace-regexp "\\([.!?][])}]* \\)\\([[({A-Z]\\)" "\\1 \\2"))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7053
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7054 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7055 ;;; Article highlights
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7056 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7057
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7058 ;; Written by Per Abrahamsen <abraham@iesd.auc.dk>.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7059
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7060 ;;; Internal Variables:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7061
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48588
diff changeset
7062 (defcustom gnus-button-url-regexp
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7063 (concat
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7064 "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7065 "nntp\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7066 "\\(//[-a-z0-9_.]+:[0-9]*\\)?"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7067 (if (string-match "[[:digit:]]" "1") ;; Support POSIX?
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7068 (let ((chars "-a-z0-9_=#$@~%&*+\\/[:word:]")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7069 (punct "!?:;.,"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7070 (concat
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7071 "\\(?:"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7072 ;; Match paired parentheses, e.g. in Wikipedia URLs:
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
7073 ;; http://thread.gmane.org/47B4E3B2.3050402@gmail.com
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
7074 "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)" "[" chars "]*"
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7075 "\\|"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7076 "[" chars punct "]+" "[" chars "]"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7077 "\\)"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7078 (concat ;; XEmacs 21.4 doesn't support POSIX.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7079 "\\([-a-z0-9_=!?#$@~%&*+\\/:;.,]\\|\\w\\)+"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7080 "\\([-a-z0-9_=#$@~%&*+\\/]\\|\\w\\)"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7081 "\\)")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7082 "Regular expression that matches URLs."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7083 :group 'gnus-article-buttons
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7084 :type 'regexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7085
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7086 (defcustom gnus-button-valid-fqdn-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7087 message-valid-fqdn-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7088 "Regular expression that matches a valid FQDN."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
7089 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7090 :group 'gnus-article-buttons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7091 :type 'regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7092
64735
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7093 ;; Regexp suggested by Felix Wiemann in <87oeuomcz9.fsf@news2.ososo.de>
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7094 (defcustom gnus-button-valid-localpart-regexp
69944
a87e26272828 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-210
Miles Bader <miles@gnu.org>
parents: 69572
diff changeset
7095 "[a-z0-9$%(*-=?[_][^<>\")!;:,{}\n\t @]*"
64735
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7096 "Regular expression that matches a localpart of mail addresses or MIDs."
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7097 :version "22.1"
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7098 :group 'gnus-article-buttons
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7099 :type 'regexp)
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7100
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7101 (defcustom gnus-button-man-handler 'manual-entry
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7102 "Function to use for displaying man pages.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7103 The function must take at least one argument with a string naming the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7104 man page."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
7105 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7106 :type '(choice (function-item :tag "Man" manual-entry)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7107 (function-item :tag "Woman" woman)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7108 (function :tag "Other"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7109 :group 'gnus-article-buttons)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7110
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7111 (defcustom gnus-ctan-url "http://tug.ctan.org/tex-archive/"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7112 "Top directory of a CTAN \(Comprehensive TeX Archive Network\) archive.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7113 If the default site is too slow, try to find a CTAN mirror, see
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7114 <URL:http://tug.ctan.org/tex-archive/CTAN.sites?action=/index.html>. See also
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7115 the variable `gnus-button-handle-ctan'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
7116 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7117 :group 'gnus-article-buttons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7118 :link '(custom-manual "(gnus)Group Parameters")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7119 :type '(choice (const "http://www.tex.ac.uk/tex-archive/")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7120 (const "http://tug.ctan.org/tex-archive/")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7121 (const "http://www.dante.de/CTAN/")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7122 (string :tag "Other")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7123
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7124 (defcustom gnus-button-ctan-handler 'browse-url
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7125 "Function to use for displaying CTAN links.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7126 The function must take one argument, the string naming the URL."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
7127 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7128 :type '(choice (function-item :tag "Browse Url" browse-url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7129 (function :tag "Other"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7130 :group 'gnus-article-buttons)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7131
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7132 (defcustom gnus-button-handle-ctan-bogus-regexp "^/?tex-archive/\\|^/"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7133 "Bogus strings removed from CTAN URLs."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
7134 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7135 :group 'gnus-article-buttons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7136 :type '(choice (const "^/?tex-archive/\\|/")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7137 (regexp :tag "Other")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7138
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7139 (defcustom gnus-button-ctan-directory-regexp
64735
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7140 (regexp-opt
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7141 (list "archive-tools" "biblio" "bibliography" "digests" "documentation"
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7142 "dviware" "fonts" "graphics" "help" "indexing" "info" "language"
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7143 "languages" "macros" "nonfree" "obsolete" "support" "systems"
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7144 "tds" "tools" "usergrps" "web") t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7145 "Regular expression for ctan directories.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7146 It should match all directories in the top level of `gnus-ctan-url'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
7147 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7148 :group 'gnus-article-buttons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7149 :type 'regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7150
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7151 (defcustom gnus-button-mid-or-mail-regexp
64735
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7152 (concat "\\b\\(<?" gnus-button-valid-localpart-regexp "@"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7153 gnus-button-valid-fqdn-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7154 ">?\\)\\b")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7155 "Regular expression that matches a message ID or a mail address."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
7156 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7157 :group 'gnus-article-buttons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7158 :type 'regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7159
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7160 (defcustom gnus-button-prefer-mid-or-mail 'gnus-button-mid-or-mail-heuristic
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7161 "What to do when the button on a string as \"foo123@bar.invalid\" is pushed.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7162 Strings like this can be either a message ID or a mail address. If it is one
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7163 of the symbols `mid' or `mail', Gnus will always assume that the string is a
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7164 message ID or a mail address, respectively. If this variable is set to the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7165 symbol `ask', always query the user what do do. If it is a function, this
75521
69ddf7e920dd (gnus-button-prefer-mid-or-mail): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 75401
diff changeset
7166 function will be called with the string as its only argument. The function
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7167 must return `mid', `mail', `invalid' or `ask'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
7168 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7169 :group 'gnus-article-buttons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7170 :type '(choice (function-item :tag "Heuristic function"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7171 gnus-button-mid-or-mail-heuristic)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7172 (const ask)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7173 (const mid)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7174 (const mail)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7175
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7176 (defcustom gnus-button-mid-or-mail-heuristic-alist
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7177 '((-10.0 . ".+\\$.+@")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7178 (-10.0 . "#")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7179 (-10.0 . "\\*")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7180 (-5.0 . "\\+[^+]*\\+.*@") ;; # two plus signs
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7181 (-5.0 . "@[Nn][Ee][Ww][Ss]") ;; /\@news/i
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7182 (-5.0 . "@.*[Dd][Ii][Aa][Ll][Uu][Pp]") ;; /\@.*dialup/i;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7183 (-1.0 . "^[^a-z]+@")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7184 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7185 (-5.0 . "\\.[0-9][0-9]+.*@") ;; "\.[0-9]{2,}.*\@"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7186 (-5.0 . "[a-z].*[A-Z].*[a-z].*[A-Z].*@") ;; "([a-z].*[A-Z].*){2,}\@"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7187 (-3.0 . "[A-Z][A-Z][a-z][a-z].*@")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7188 (-5.0 . "\\...?.?@") ;; (-5.0 . "\..{1,3}\@")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7189 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7190 (-2.0 . "^[0-9]")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7191 (-1.0 . "^[0-9][0-9]")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7192 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7193 ;; -3.0 /^[0-9][0-9a-fA-F]{2,2}/;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7194 (-3.0 . "^[0-9][0-9a-fA-F][0-9a-fA-F][^0-9a-fA-F]")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7195 ;; -5.0 /^[0-9][0-9a-fA-F]{3,3}/;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7196 (-5.0 . "^[0-9][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][^0-9a-fA-F]")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7197 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7198 (-3.0 . "[0-9][0-9][0-9][0-9][0-9][^0-9].*@") ;; "[0-9]{5,}.*\@"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7199 (-3.0 . "[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][^0-9].*@")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7200 ;; "[0-9]{8,}.*\@"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7201 (-3.0
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7202 . "[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].*@")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7203 ;; "[0-9]{12,}.*\@"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7204 ;; compensation for TDMA dated mail addresses:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7205 (25.0 . "-dated-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]+.*@")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7206 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7207 (-20.0 . "\\.fsf@") ;; Gnus
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7208 (-20.0 . "^slrn")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7209 (-20.0 . "^Pine")
85809
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85712
diff changeset
7210 (-20.0 . "^alpine\\.")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7211 (-20.0 . "_-_") ;; Subject change in thread
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7212 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7213 (-20.0 . "\\.ln@") ;; leafnode
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7214 (-30.0 . "@ID-[0-9]+\\.[a-zA-Z]+\\.dfncis\\.de")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7215 (-30.0 . "@4[Aa][Xx]\\.com") ;; Forte Agent
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7216 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7217 ;; (5.0 . "") ;; $local_part_len <= 7
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7218 (10.0 . "^[^0-9]+@")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7219 (3.0 . "^[^0-9]+[0-9][0-9]?[0-9]?@")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7220 ;; ^[^0-9]+[0-9]{1,3}\@ digits only at end of local part
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7221 (3.0 . "\@stud")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7222 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7223 (2.0 . "[a-z][a-z][._-][A-Z][a-z].*@")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7224 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7225 (0.5 . "^[A-Z][a-z]")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7226 (0.5 . "^[A-Z][a-z][a-z]")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7227 (1.5 . "^[A-Z][a-z][A-Z][a-z][^a-z]") ;; ^[A-Z][a-z]{3,3}
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7228 (2.0 . "^[A-Z][a-z][A-Z][a-z][a-z][^a-z]")) ;; ^[A-Z][a-z]{4,4}
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7229 "An alist of \(RATE . REGEXP\) pairs for `gnus-button-mid-or-mail-heuristic'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7230
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7231 A negative RATE indicates a message IDs, whereas a positive indicates a mail
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7232 address. The REGEXP is processed with `case-fold-search' set to nil."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
7233 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7234 :group 'gnus-article-buttons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7235 :type '(repeat (cons (number :tag "Rate")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7236 (regexp :tag "Regexp"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7237
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7238 (defun gnus-button-mid-or-mail-heuristic (mid-or-mail)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7239 "Guess whether MID-OR-MAIL is a message ID or a mail address.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7240 Returns `mid' if MID-OR-MAIL is a message IDs, `mail' if it's a mail
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7241 address, `ask' if unsure and `invalid' if the string is invalid."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7242 (let ((case-fold-search nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7243 (list gnus-button-mid-or-mail-heuristic-alist)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7244 (result 0) rate regexp lpartlen elem)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7245 (setq lpartlen
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7246 (length (gnus-replace-in-string mid-or-mail "^\\(.*\\)@.*$" "\\1")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7247 (gnus-message 8 "`%s', length of local part=`%s'." mid-or-mail lpartlen)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7248 ;; Certain special cases...
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7249 (when (string-match
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7250 (concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7251 "^0[0-9]+-[0-9][0-9][0-9][0-9]@t-online\\.de$\\|"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7252 "^[0-9]+\\.[0-9]+@compuserve\\|"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7253 "@public\\.gmane\\.org")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7254 mid-or-mail)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7255 (gnus-message 8 "`%s' is a known mail address." mid-or-mail)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7256 (setq result 'mail))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7257 (when (string-match "@.*@\\| " mid-or-mail)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7258 (gnus-message 8 "`%s' is invalid." mid-or-mail)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7259 (setq result 'invalid))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7260 ;; Nothing more to do, if result is not a number here...
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7261 (when (numberp result)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7262 (while list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7263 (setq elem (car list)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7264 rate (car elem)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7265 regexp (cdr elem)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7266 list (cdr list))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7267 (when (string-match regexp mid-or-mail)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7268 (setq result (+ result rate))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7269 (gnus-message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7270 9 "`%s' matched `%s', rate `%s', result `%s'."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7271 mid-or-mail regexp rate result)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7272 (when (<= lpartlen 7)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7273 (setq result (+ result 5.0))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7274 (gnus-message 9 "`%s' matched (<= lpartlen 7), result `%s'."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7275 mid-or-mail result))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7276 (when (>= lpartlen 12)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7277 (gnus-message 9 "`%s' matched (>= lpartlen 12)" mid-or-mail)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7278 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7279 ((string-match "[0-9][^0-9]+[0-9].*@" mid-or-mail)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7280 ;; Long local part should contain realname if e-mail address,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7281 ;; too many digits: message-id.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7282 ;; $score -= 5.0 + 0.1 * $local_part_len;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7283 (setq rate (* -1.0 (+ 5.0 (* 0.1 lpartlen))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7284 (setq result (+ result rate))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7285 (gnus-message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7286 9 "Many digits in `%s', rate `%s', result `%s'."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7287 mid-or-mail rate result))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7288 ((string-match "[^aeiouy][^aeiouy][^aeiouy][^aeiouy]+.*\@"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7289 mid-or-mail)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7290 ;; Too few vowels [^aeiouy]{4,}.*\@
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7291 (setq result (+ result -5.0))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7292 (gnus-message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7293 9 "Few vowels in `%s', rate `%s', result `%s'."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7294 mid-or-mail -5.0 result))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7295 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7296 (setq result (+ result 5.0))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7297 (gnus-message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7298 9 "`%s', rate `%s', result `%s'." mid-or-mail 5.0 result)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7299 (gnus-message 8 "`%s': Final rate is `%s'." mid-or-mail result)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7300 ;; Maybe we should make this a customizable alist: (condition . 'result)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7301 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7302 ((symbolp result) result)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7303 ;; Now convert number into proper results:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7304 ((< result -10.0) 'mid)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7305 ((> result 10.0) 'mail)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7306 (t 'ask))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7307
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7308 (defun gnus-button-handle-mid-or-mail (mid-or-mail)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7309 (let* ((pref gnus-button-prefer-mid-or-mail) guessed
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7310 (url-mid (concat "news" ":" mid-or-mail))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7311 (url-mailto (concat "mailto" ":" mid-or-mail)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7312 (gnus-message 9 "mid-or-mail=%s" mid-or-mail)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7313 (when (fboundp pref)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7314 (setq guessed
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7315 ;; get rid of surrounding angles...
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7316 (funcall pref
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7317 (gnus-replace-in-string mid-or-mail "^<\\|>$" "")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7318 (if (or (eq 'mid guessed) (eq 'mail guessed))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7319 (setq pref guessed)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7320 (setq pref 'ask)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7321 (if (eq pref 'ask)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7322 (save-window-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7323 (if (y-or-n-p (concat "Is <" mid-or-mail "> a mail address? "))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7324 (setq pref 'mail)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7325 (setq pref 'mid))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7326 (cond ((eq pref 'mid)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7327 (gnus-message 8 "calling `gnus-button-handle-news' %s" url-mid)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7328 (gnus-button-handle-news url-mid))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7329 ((eq pref 'mail)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7330 (gnus-message 8 "calling `gnus-url-mailto' %s" url-mailto)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7331 (gnus-url-mailto url-mailto))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7332 (t (gnus-message 3 "Invalid string.")))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7333
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7334 (defun gnus-button-handle-custom (fun arg)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7335 "Call function FUN on argument ARG.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7336 Both FUN and ARG are supposed to be strings. ARG will be passed
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7337 as a symbol to FUN."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7338 (funcall (intern fun)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7339 (if (string-match "^customize-apropos" fun)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7340 arg
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7341 (intern arg))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7342
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7343 (defvar gnus-button-handle-describe-prefix "^\\(C-h\\|<?[Ff]1>?\\)")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7344
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7345 ;; FIXME: Maybe we should merge some of the functions that do quite similar
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7346 ;; stuff?
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7347
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7348 (defun gnus-button-handle-describe-function (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7349 "Call `describe-function' when pushing the corresponding URL button."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7350 (describe-function
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7351 (intern
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7352 (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7353
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7354 (defun gnus-button-handle-describe-variable (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7355 "Call `describe-variable' when pushing the corresponding URL button."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7356 (describe-variable
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7357 (intern
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7358 (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7359
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7360 (defun gnus-button-handle-symbol (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7361 "Display help on variable or function.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7362 Calls `describe-variable' or `describe-function'."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7363 (let ((sym (intern url)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7364 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7365 ((fboundp sym) (describe-function sym))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7366 ((boundp sym) (describe-variable sym))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7367 (t (gnus-message 3 "`%s' is not a known function of variable." url)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7368
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7369 (defun gnus-button-handle-describe-key (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7370 "Call `describe-key' when pushing the corresponding URL button."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7371 (let* ((key-string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7372 (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7373 (keys (ignore-errors (eval `(kbd ,key-string)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7374 (if keys
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7375 (describe-key keys)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7376 (gnus-message 3 "Invalid key sequence in button: %s" key-string))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7377
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7378 (defun gnus-button-handle-apropos (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7379 "Call `apropos' when pushing the corresponding URL button."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7380 (apropos (gnus-replace-in-string url gnus-button-handle-describe-prefix "")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7381
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7382 (defun gnus-button-handle-apropos-command (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7383 "Call `apropos' when pushing the corresponding URL button."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7384 (apropos-command
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7385 (gnus-replace-in-string url gnus-button-handle-describe-prefix "")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7386
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7387 (defun gnus-button-handle-apropos-variable (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7388 "Call `apropos' when pushing the corresponding URL button."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7389 (funcall
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7390 (if (fboundp 'apropos-variable) 'apropos-variable 'apropos)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7391 (gnus-replace-in-string url gnus-button-handle-describe-prefix "")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7392
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7393 (defun gnus-button-handle-apropos-documentation (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7394 "Call `apropos' when pushing the corresponding URL button."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7395 (funcall
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7396 (if (fboundp 'apropos-documentation) 'apropos-documentation 'apropos)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7397 (gnus-replace-in-string url gnus-button-handle-describe-prefix "")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7398
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7399 (defun gnus-button-handle-library (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7400 "Call `locate-library' when pushing the corresponding URL button."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7401 (gnus-message 9 "url=`%s'" url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7402 (let* ((lib (locate-library url))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7403 (file (gnus-replace-in-string (or lib "") "\.elc" ".el")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7404 (if (not lib)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7405 (gnus-message 1 "Cannot locale library `%s'." url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7406 (find-file-read-only file))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7407
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7408 (defun gnus-button-handle-ctan (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7409 "Call `browse-url' when pushing a CTAN URL button."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7410 (funcall
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7411 gnus-button-ctan-handler
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7412 (concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7413 gnus-ctan-url
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7414 (gnus-replace-in-string url gnus-button-handle-ctan-bogus-regexp ""))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7415
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7416 (defcustom gnus-button-tex-level 5
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7417 "*Integer that says how many TeX-related buttons Gnus will show.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7418 The higher the number, the more buttons will appear and the more false
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7419 positives are possible. Note that you can set this variable local to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7420 specific groups. Setting it higher in TeX groups is probably a good idea.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7421 See Info node `(gnus)Group Parameters' and the variable `gnus-parameters' on
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7422 how to set variables in specific groups."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
7423 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7424 :group 'gnus-article-buttons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7425 :link '(custom-manual "(gnus)Group Parameters")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7426 :type 'integer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7427
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7428 (defcustom gnus-button-man-level 5
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7429 "*Integer that says how many man-related buttons Gnus will show.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7430 The higher the number, the more buttons will appear and the more false
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7431 positives are possible. Note that you can set this variable local to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7432 specific groups. Setting it higher in Unix groups is probably a good idea.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7433 See Info node `(gnus)Group Parameters' and the variable `gnus-parameters' on
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7434 how to set variables in specific groups."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
7435 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7436 :group 'gnus-article-buttons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7437 :link '(custom-manual "(gnus)Group Parameters")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7438 :type 'integer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7439
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7440 (defcustom gnus-button-emacs-level 5
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7441 "*Integer that says how many emacs-related buttons Gnus will show.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7442 The higher the number, the more buttons will appear and the more false
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7443 positives are possible. Note that you can set this variable local to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7444 specific groups. Setting it higher in Emacs or Gnus related groups is
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7445 probably a good idea. See Info node `(gnus)Group Parameters' and the variable
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7446 `gnus-parameters' on how to set variables in specific groups."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
7447 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7448 :group 'gnus-article-buttons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7449 :link '(custom-manual "(gnus)Group Parameters")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7450 :type 'integer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7451
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7452 (defcustom gnus-button-message-level 5
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7453 "*Integer that says how many buttons for news or mail messages will appear.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7454 The higher the number, the more buttons will appear and the more false
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7455 positives are possible."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7456 ;; mail addresses, MIDs, URLs for news, ...
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
7457 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7458 :group 'gnus-article-buttons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7459 :type 'integer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7460
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7461 (defcustom gnus-button-browse-level 5
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7462 "*Integer that says how many buttons for browsing will appear.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7463 The higher the number, the more buttons will appear and the more false
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7464 positives are possible."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7465 ;; stuff handled by `browse-url' or `gnus-button-embedded-url'
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
7466 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7467 :group 'gnus-article-buttons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7468 :type 'integer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7469
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7470 (defcustom gnus-button-alist
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7471 '(("<\\(url:[>\n\t ]*?\\)?\\(nntp\\|news\\):[>\n\t ]*\\([^>\n\t ]*@[^>\n\t ]*\\)>"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7472 0 (>= gnus-button-message-level 0) gnus-button-handle-news 3)
64735
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7473 ((concat "\\b\\(nntp\\|news\\):\\("
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7474 gnus-button-valid-localpart-regexp "@[a-z0-9.-]+[a-z]\\)")
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64693
diff changeset
7475 0 t gnus-button-handle-news 2)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7476 ("\\(\\b<\\(url:[>\n\t ]*\\)?\\(nntp\\|news\\):[>\n\t ]*\\(//\\)?\\([^>\n\t ]*\\)>\\)"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7477 1 (>= gnus-button-message-level 0) gnus-button-fetch-group 5)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7478 ("\\b\\(nntp\\|news\\):\\(//\\)?\\([^'\">\n\t ]+\\)"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7479 0 (>= gnus-button-message-level 0) gnus-button-fetch-group 3)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7480 ;; RFC 2392 (Don't allow `/' in domain part --> CID)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7481 ("\\bmid:\\(//\\)?\\([^'\">\n\t ]+@[^'\">\n\t /]+\\)"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7482 0 (>= gnus-button-message-level 0) gnus-button-message-id 2)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7483 ("\\bin\\( +article\\| +message\\)? +\\(<\\([^\n @<>]+@[^\n @<>]+\\)>\\)"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7484 2 (>= gnus-button-message-level 0) gnus-button-message-id 3)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7485 ("\\b\\(mid\\|message-id\\):? +\\(<\\([^\n @<>]+@[^\n @<>]+\\)>\\)"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7486 2 (>= gnus-button-message-level 0) gnus-button-message-id 3)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7487 ("\\(<URL: *\\)mailto: *\\([^> \n\t]+\\)>"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7488 0 (>= gnus-button-message-level 0) gnus-url-mailto 2)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7489 ;; RFC 2368 (The mailto URL scheme)
57581
645f020dcc8a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents: 57265
diff changeset
7490 ("\\bmailto:\\([-a-z.@_+0-9%=?&/]+\\)"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7491 0 (>= gnus-button-message-level 0) gnus-url-mailto 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7492 ("\\bmailto:\\([^ \n\t]+\\)"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7493 0 (>= gnus-button-message-level 0) gnus-url-mailto 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7494 ;; CTAN
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7495 ((concat "\\bCTAN:[ \t\n]?[^>)!;:,'\n\t ]*\\("
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7496 gnus-button-ctan-directory-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7497 "[^][>)!;:,'\n\t ]+\\)")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7498 0 (>= gnus-button-tex-level 1) gnus-button-handle-ctan 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7499 ((concat "\\btex-archive/\\("
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7500 gnus-button-ctan-directory-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7501 "/[-_.a-z0-9/]+[-_./a-z0-9]+[/a-z0-9]\\)")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7502 1 (>= gnus-button-tex-level 6) gnus-button-handle-ctan 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7503 ((concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7504 "\\b\\("
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7505 gnus-button-ctan-directory-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7506 "/[-_.a-z0-9]+/[-_./a-z0-9]+[/a-z0-9]\\)")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7507 1 (>= gnus-button-tex-level 8) gnus-button-handle-ctan 1)
102054
c35aac5fa64e Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 102026
diff changeset
7508 ;; Info Konqueror style <info:/foo/bar baz>.
c35aac5fa64e Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 102026
diff changeset
7509 ;; Must come before " Gnus home-grown style".
c35aac5fa64e Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 102026
diff changeset
7510 ("\\binfo://?\\([^'\">\n\t]+\\)"
c35aac5fa64e Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 102026
diff changeset
7511 0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url 1)
c35aac5fa64e Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 102026
diff changeset
7512 ;; Info, Gnus home-grown style (deprecated) <info://foo/bar+baz>
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7513 ("\\binfo://\\([^'\">\n\t ]+\\)"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7514 0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7515 ;; Info GNOME style <info:foo#bar_baz>
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7516 ("\\binfo:\\([^('\n\t\r \"><][^'\n\t\r \"><]*\\)"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7517 0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url-gnome 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7518 ;; Info KDE style <info:(foo)bar baz>
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7519 ("<\\(info:\\(([^)]+)[^>\n\r]*\\)\\)>"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7520 1 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url-kde 2)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7521 ("\\((Info-goto-node\\|(info\\)[ \t\n]*\\(\"[^\"]*\"\\))" 0
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7522 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url 2)
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
7523 ("\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+i[ \t\n]+d?[ \t\n]?m[ \t\n]+[^ ]+ ?[^ ]+[ \t\n]+RET\\([ \t\n]+i[ \t\n]+[^ ]+ ?[^ ]+[ \t\n]+RET\\([ \t\n,]*\\)\\)?"
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
7524 ;; Info links like `C-h i d m Gnus RET' or `C-h i d m Gnus RET i partial RET'
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
7525 0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-keystrokes 0)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7526 ;; This is custom
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7527 ("M-x[ \t\n]\\(customize-[^ ]+\\)[ \t\n]RET[ \t\n]\\([^ ]+\\)[ \t\n]RET" 0
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7528 (>= gnus-button-emacs-level 1) gnus-button-handle-custom 1 2)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7529 ;; Emacs help commands
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7530 ("M-x[ \t\n]+apropos[ \t\n]+RET[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7531 ;; regexp doesn't match arguments containing ` '.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7532 0 (>= gnus-button-emacs-level 1) gnus-button-handle-apropos 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7533 ("M-x[ \t\n]+apropos-command[ \t\n]+RET[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7534 0 (>= gnus-button-emacs-level 1) gnus-button-handle-apropos-command 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7535 ("M-x[ \t\n]+apropos-variable[ \t\n]+RET[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7536 0 (>= gnus-button-emacs-level 1) gnus-button-handle-apropos-variable 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7537 ("M-x[ \t\n]+apropos-documentation[ \t\n]+RET[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7538 0 (>= gnus-button-emacs-level 1) gnus-button-handle-apropos-documentation 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7539 ;; The following entries may lead to many false positives so don't enable
57581
645f020dcc8a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents: 57265
diff changeset
7540 ;; them by default (use a high button level).
645f020dcc8a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents: 57265
diff changeset
7541 ("/\\([a-z][-a-z0-9]+\\.el\\)\\>[^.?]"
645f020dcc8a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents: 57265
diff changeset
7542 ;; Exclude [.?] for URLs in gmane.emacs.cvs
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7543 1 (>= gnus-button-emacs-level 8) gnus-button-handle-library 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7544 ("`\\([a-z][-a-z0-9]+\\.el\\)'"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7545 1 (>= gnus-button-emacs-level 8) gnus-button-handle-library 1)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7546 ("`\\([a-z][a-z0-9]+-[a-z0-9]+-[-a-z0-9]*[a-z]\\|\\(gnus\\|message\\)-[-a-z]+\\)'"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7547 0 (>= gnus-button-emacs-level 8) gnus-button-handle-symbol 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7548 ("`\\([a-z][a-z0-9]+-[a-z]+\\)'"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7549 0 (>= gnus-button-emacs-level 9) gnus-button-handle-symbol 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7550 ("(setq[ \t\n]+\\([a-z][a-z0-9]+-[-a-z0-9]+\\)[ \t\n]+.+)"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7551 1 (>= gnus-button-emacs-level 7) gnus-button-handle-describe-variable 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7552 ("\\bM-x[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7553 1 (>= gnus-button-emacs-level 7) gnus-button-handle-describe-function 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7554 ("\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+f[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7555 0 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-function 2)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7556 ("\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+v[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7557 0 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-variable 2)
76820
665998d6d5de Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75521
diff changeset
7558 ("`\\(\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+k[ \t\n]+\\([^']+\\)\\)'"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7559 ;; Unlike the other regexps we really have to require quoting
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7560 ;; here to determine where it ends.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7561 1 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-key 3)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7562 ;; This is how URLs _should_ be embedded in text (RFC 1738, RFC 2396)...
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7563 ("<URL: *\\([^\n<>]*\\)>"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7564 1 (>= gnus-button-browse-level 0) gnus-button-embedded-url 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7565 ;; RFC 2396 (2.4.3., delims) ...
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7566 ("\"URL: *\\([^\n\"]*\\)\""
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7567 1 (>= gnus-button-browse-level 0) gnus-button-embedded-url 1)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7568 ;; Raw URLs.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7569 (gnus-button-url-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7570 0 (>= gnus-button-browse-level 0) browse-url 0)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7571 ;; man pages
57581
645f020dcc8a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents: 57265
diff changeset
7572 ("\\b\\([a-z][a-z]+([1-9])\\)\\W"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7573 0 (and (>= gnus-button-man-level 1) (< gnus-button-man-level 3))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7574 gnus-button-handle-man 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7575 ;; more man pages: resolv.conf(5), iso_8859-1(7), xterm(1x)
57581
645f020dcc8a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents: 57265
diff changeset
7576 ("\\b\\([a-z][-_.a-z0-9]+([1-9])\\)\\W"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7577 0 (and (>= gnus-button-man-level 3) (< gnus-button-man-level 5))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7578 gnus-button-handle-man 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7579 ;; even more: Apache::PerlRun(3pm), PDL::IO::FastRaw(3pm),
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7580 ;; SoWWWAnchor(3iv), XSelectInput(3X11), X(1), X(7)
57581
645f020dcc8a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents: 57265
diff changeset
7581 ("\\b\\(\\(?:[a-z][-+_.:a-z0-9]+([1-9][X1a-z]*)\\)\\|\\b\\(?:X([1-9])\\)\\)\\W"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7582 0 (>= gnus-button-man-level 5) gnus-button-handle-man 1)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7583 ;; Recognizing patches to .el files. This is somewhat obscure,
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7584 ;; but considering the percentage of Gnus users who hack Emacs
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7585 ;; Lisp files...
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7586 ("^--- \\([^ .]+\\.el\\).*\n.*\n@@ -?\\([0-9]+\\)" 1
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7587 (>= gnus-button-message-level 4) gnus-button-patch 1 2)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7588 ("^\\*\\*\\* \\([^ .]+\\.el\\).*\n.*\n\\*+\n\\*\\*\\* \\([0-9]+\\)" 1
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7589 (>= gnus-button-message-level 4) gnus-button-patch 1 2)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7590 ;; MID or mail: To avoid too many false positives we don't try to catch
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7591 ;; all kind of allowed MIDs or mail addresses. Domain part must contain
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7592 ;; at least one dot. TLD must contain two or three chars or be a know TLD
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7593 ;; (info|name|...). Put this entry near the _end_ of `gnus-button-alist'
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7594 ;; so that non-ambiguous entries (see above) match first.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7595 (gnus-button-mid-or-mail-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7596 0 (>= gnus-button-message-level 5) gnus-button-handle-mid-or-mail 1))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
7597 "*Alist of regexps matching buttons in article bodies.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7598
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7599 Each entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7600 REGEXP: is the string (case insensitive) matching text around the button (can
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7601 also be Lisp expression evaluating to a string),
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7602 BUTTON: is the number of the regexp grouping actually matching the button,
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
7603 FORM: is a Lisp expression which must eval to true for the button to
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7604 be added,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7605 CALLBACK: is the function to call when the user push this button, and each
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7606 PAR: is a number of a regexp grouping whose text will be passed to CALLBACK.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7607
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7608 CALLBACK can also be a variable, in that case the value of that
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7609 variable it the real callback function."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7610 :group 'gnus-article-buttons
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7611 :type '(repeat (list (choice regexp variable sexp)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7612 (integer :tag "Button")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7613 (sexp :tag "Form")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7614 (function :tag "Callback")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7615 (repeat :tag "Par"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7616 :inline t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7617 (integer :tag "Regexp group")))))
79313
f4c90d55f00f Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 78598
diff changeset
7618 (put 'gnus-button-alist 'risky-local-variable t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7619
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7620 (defcustom gnus-header-button-alist
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7621 '(("^\\(References\\|Message-I[Dd]\\|^In-Reply-To\\):" "<[^<>]+>"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7622 0 (>= gnus-button-message-level 0) gnus-button-message-id 0)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7623 ("^\\(From\\|Reply-To\\):" ": *\\(.+\\)$"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7624 1 (>= gnus-button-message-level 0) gnus-button-reply 1)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7625 ("^\\(Cc\\|To\\):" "[^ \t\n<>,()\"]+@[^ \t\n<>,()\"]+"
60696
7503b2a24a3c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-187
Miles Bader <miles@gnu.org>
parents: 60239
diff changeset
7626 0 (>= gnus-button-message-level 0) gnus-msg-mail 0)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7627 ("^X-[Uu][Rr][Ll]:" gnus-button-url-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7628 0 (>= gnus-button-browse-level 0) browse-url 0)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7629 ("^Subject:" gnus-button-url-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7630 0 (>= gnus-button-browse-level 0) browse-url 0)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7631 ("^[^:]+:" gnus-button-url-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7632 0 (>= gnus-button-browse-level 0) browse-url 0)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7633 ("^OpenPGP:.*url=" gnus-button-url-regexp
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7634 0 (>= gnus-button-browse-level 0) gnus-button-openpgp 0)
57581
645f020dcc8a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents: 57265
diff changeset
7635 ("^[^:]+:" "\\bmailto:\\([-a-z.@_+0-9%=?&/]+\\)"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7636 0 (>= gnus-button-message-level 0) gnus-url-mailto 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7637 ("^[^:]+:" "\\(<\\(url: \\)?\\(nntp\\|news\\):\\([^>\n ]*\\)>\\)"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7638 1 (>= gnus-button-message-level 0) gnus-button-message-id 4))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
7639 "*Alist of headers and regexps to match buttons in article heads.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7640
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7641 This alist is very similar to `gnus-button-alist', except that each
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7642 alist has an additional HEADER element first in each entry:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7643
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7644 \(HEADER REGEXP BUTTON FORM CALLBACK PAR)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7645
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7646 HEADER is a regexp to match a header. For a fuller explanation, see
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7647 `gnus-button-alist'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7648 :group 'gnus-article-buttons
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7649 :group 'gnus-article-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7650 :type '(repeat (list (regexp :tag "Header")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7651 (choice regexp variable)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7652 (integer :tag "Button")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7653 (sexp :tag "Form")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7654 (function :tag "Callback")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7655 (repeat :tag "Par"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7656 :inline t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7657 (integer :tag "Regexp group")))))
79313
f4c90d55f00f Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 78598
diff changeset
7658 (put 'gnus-header-button-alist 'risky-local-variable t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7659
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7660 ;;; Commands:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7661
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7662 (defun gnus-article-push-button (event)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7663 "Check text under the mouse pointer for a callback function.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7664 If the text under the mouse pointer has a `gnus-callback' property,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7665 call it with the value of the `gnus-data' text property."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7666 (interactive "e")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7667 (set-buffer (window-buffer (posn-window (event-start event))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7668 (let* ((pos (posn-point (event-start event)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7669 (data (get-text-property pos 'gnus-data))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7670 (fun (get-text-property pos 'gnus-callback)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
7671 (goto-char pos)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7672 (when fun
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7673 (funcall fun data))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7674
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7675 (defun gnus-article-press-button ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7676 "Check text at point for a callback function.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7677 If the text at point has a `gnus-callback' property,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7678 call it with the value of the `gnus-data' text property."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7679 (interactive)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7680 (let ((data (get-text-property (point) 'gnus-data))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7681 (fun (get-text-property (point) 'gnus-callback)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7682 (when fun
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7683 (funcall fun data))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7684
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7685 (defun gnus-article-highlight (&optional force)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7686 "Highlight current article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7687 This function calls `gnus-article-highlight-headers',
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7688 `gnus-article-highlight-citation',
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7689 `gnus-article-highlight-signature', and `gnus-article-add-buttons' to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7690 do the highlighting. See the documentation for those functions."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7691 (interactive (list 'force))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7692 (gnus-article-highlight-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7693 (gnus-article-highlight-citation force)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7694 (gnus-article-highlight-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7695 (gnus-article-add-buttons force)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7696 (gnus-article-add-buttons-to-head))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7697
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7698 (defun gnus-article-highlight-some (&optional force)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7699 "Highlight current article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7700 This function calls `gnus-article-highlight-headers',
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7701 `gnus-article-highlight-signature', and `gnus-article-add-buttons' to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7702 do the highlighting. See the documentation for those functions."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7703 (interactive (list 'force))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7704 (gnus-article-highlight-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7705 (gnus-article-highlight-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7706 (gnus-article-add-buttons))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7707
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7708 (defun gnus-article-highlight-headers ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7709 "Highlight article headers as specified by `gnus-header-face-alist'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7710 (interactive)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7711 (gnus-with-article-headers
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7712 (let (regexp header-face field-face from hpoints fpoints)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7713 (dolist (entry gnus-header-face-alist)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7714 (goto-char (point-min))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7715 (setq regexp (concat "^\\("
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7716 (if (string-equal "" (nth 0 entry))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7717 "[^\t ]"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7718 (nth 0 entry))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7719 "\\)")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7720 header-face (nth 1 entry)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7721 field-face (nth 2 entry))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7722 (while (and (re-search-forward regexp nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7723 (not (eobp)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7724 (beginning-of-line)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7725 (setq from (point))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7726 (unless (search-forward ":" nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7727 (forward-char 1))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7728 (when (and header-face
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7729 (not (memq (point) hpoints)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7730 (push (point) hpoints)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7731 (gnus-put-text-property from (point) 'face header-face))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7732 (when (and field-face
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7733 (not (memq (setq from (point)) fpoints)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7734 (push from fpoints)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7735 (if (re-search-forward "^[^ \t]" nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7736 (forward-char -2)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7737 (goto-char (point-max)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7738 (gnus-put-text-property from (point) 'face field-face)))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7739
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7740 (defun gnus-article-highlight-signature ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7741 "Highlight the signature in an article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7742 It does this by highlighting everything after
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63026
diff changeset
7743 `gnus-signature-separator' using the face `gnus-signature'."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7744 (interactive)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7745 (gnus-with-article-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7746 (let ((inhibit-point-motion-hooks t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7747 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7748 (when (and gnus-signature-face
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7749 (gnus-article-narrow-to-signature))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7750 (gnus-overlay-put (gnus-make-overlay (point-min) (point-max) nil t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7751 'face gnus-signature-face)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7752 (widen)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7753 (gnus-article-search-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7754 (let ((start (match-beginning 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7755 (end (set-marker (make-marker) (1+ (match-end 0)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7756 (gnus-article-add-button start (1- end) 'gnus-signature-toggle
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7757 end)))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7758
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7759 (defun gnus-button-in-region-p (b e prop)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7760 "Say whether PROP exists in the region."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7761 (text-property-not-all b e prop nil))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7762
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7763 (defun gnus-article-add-buttons (&optional force)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7764 "Find external references in the article and make buttons of them.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7765 \"External references\" are things like Message-IDs and URLs, as
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7766 specified by `gnus-button-alist'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7767 (interactive (list 'force))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7768 (gnus-with-article-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7769 (let ((inhibit-point-motion-hooks t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7770 (case-fold-search t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7771 (alist gnus-button-alist)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7772 beg entry regexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7773 ;; Remove all old markers.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
7774 (let (marker entry new-list)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7775 (while (setq marker (pop gnus-button-marker-list))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
7776 (if (or (< marker (point-min)) (>= marker (point-max)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
7777 (push marker new-list)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
7778 (goto-char marker)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
7779 (when (setq entry (gnus-button-entry))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
7780 (put-text-property (match-beginning (nth 1 entry))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
7781 (match-end (nth 1 entry))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
7782 'gnus-callback nil))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
7783 (set-marker marker nil)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
7784 (setq gnus-button-marker-list new-list))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7785 ;; We skip the headers.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
7786 (article-goto-body)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7787 (setq beg (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7788 (while (setq entry (pop alist))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7789 (setq regexp (eval (car entry)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7790 (goto-char beg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7791 (while (re-search-forward regexp nil t)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7792 (let ((start (match-beginning (nth 1 entry)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7793 (end (match-end (nth 1 entry)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7794 (from (match-beginning 0)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7795 (when (and (or (eq t (nth 2 entry))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7796 (eval (nth 2 entry)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7797 (not (gnus-button-in-region-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7798 start end 'gnus-callback)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7799 ;; That optional form returned non-nil, so we add the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7800 ;; button.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7801 (setq from (set-marker (make-marker) from))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7802 (push from gnus-button-marker-list)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7803 (unless (and (eq (car entry) 'gnus-button-url-regexp)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7804 (gnus-article-extend-url-button from start end))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7805 (gnus-article-add-button start end
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7806 'gnus-button-push from)))))))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7807
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7808 (defun gnus-article-extend-url-button (beg start end)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7809 "Extend url button if url is folded into two or more lines.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7810 Return non-nil if button is extended. BEG is a marker that points to
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7811 the beginning position of a text containing url. START and END are
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7812 the endpoints of a url button before it is extended. The concatenated
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7813 url is put as the `gnus-button-url' overlay property on the button."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7814 (let ((opoint (point))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7815 (points (list start end))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7816 url delim regexp)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7817 (prog1
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7818 (when (and (progn
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7819 (goto-char end)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7820 (not (looking-at "[\t ]*[\">]")))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7821 (progn
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7822 (goto-char start)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7823 (string-match
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7824 "\\(?:\"\\|\\(<\\)\\)[\t ]*\\(?:url[\t ]*:[\t ]*\\)?\\'"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7825 (buffer-substring (point-at-bol) start)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7826 (progn
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7827 (setq url (list (buffer-substring start end))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7828 delim (if (match-beginning 1) ">" "\""))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7829 (beginning-of-line)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7830 (setq regexp (concat
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7831 (when (and (looking-at
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7832 message-cite-prefix-regexp)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7833 (< (match-end 0) start))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7834 (regexp-quote (match-string 0)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7835 "\
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7836 \[\t ]*\\(?:\\([^\t\n \">]+\\)[\t ]*$\\|\\([^\t\n \">]*\\)[\t ]*"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7837 delim "\\)"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7838 (while (progn
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7839 (forward-line 1)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7840 (and (looking-at regexp)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7841 (prog1
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7842 (match-beginning 1)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7843 (push (or (match-string 2)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7844 (match-string 1))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7845 url)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7846 (push (setq end (or (match-end 2)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7847 (match-end 1)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7848 points)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7849 (push (or (match-beginning 2)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7850 (match-beginning 1))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7851 points)))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7852 (match-beginning 2)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7853 (let (gnus-article-mouse-face widget-mouse-face)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7854 (while points
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7855 (gnus-article-add-button (pop points) (pop points)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7856 'gnus-button-push beg)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7857 (let ((overlay (gnus-make-overlay start end)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7858 (gnus-overlay-put overlay 'evaporate t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7859 (gnus-overlay-put overlay 'gnus-button-url
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7860 (list (mapconcat 'identity (nreverse url) "")))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7861 (when gnus-article-mouse-face
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7862 (gnus-overlay-put overlay 'mouse-face gnus-article-mouse-face)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7863 t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7864 (goto-char opoint))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7865
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7866 ;; Add buttons to the head of an article.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7867 (defun gnus-article-add-buttons-to-head ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7868 "Add buttons to the head of the article."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7869 (interactive)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7870 (gnus-with-article-headers
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7871 (let (beg end)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7872 (dolist (entry gnus-header-button-alist)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7873 ;; Each alist entry.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7874 (goto-char (point-min))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7875 (while (re-search-forward (car entry) nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7876 ;; Each header matching the entry.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7877 (setq beg (match-beginning 0))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7878 (setq end (or (and (re-search-forward "^[^ \t]" nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7879 (match-beginning 0))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7880 (point-max)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7881 (goto-char beg)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7882 (while (re-search-forward (eval (nth 1 entry)) end t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7883 ;; Each match within a header.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7884 (let* ((entry (cdr entry))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7885 (start (match-beginning (nth 1 entry)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7886 (end (match-end (nth 1 entry)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7887 (form (nth 2 entry)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7888 (goto-char (match-end 0))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7889 (when (eval form)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7890 (gnus-article-add-button
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7891 start end (nth 3 entry)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7892 (buffer-substring (match-beginning (nth 4 entry))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7893 (match-end (nth 4 entry)))))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7894 (goto-char end))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7895
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7896 ;;; External functions:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7897
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7898 (defun gnus-article-add-button (from to fun &optional data)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7899 "Create a button between FROM and TO with callback FUN and data DATA."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7900 (when gnus-article-button-face
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7901 (gnus-overlay-put (gnus-make-overlay from to nil t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7902 'face gnus-article-button-face))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7903 (gnus-add-text-properties
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7904 from to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7905 (nconc (and gnus-article-mouse-face
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7906 (list gnus-mouse-face-prop gnus-article-mouse-face))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7907 (list 'gnus-callback fun)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
7908 (and data (list 'gnus-data data))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
7909 (widget-convert-button 'link from to :action 'gnus-widget-press-button
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
7910 :button-keymap gnus-widget-button-keymap))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7911
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7912 ;;; Internal functions:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7913
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
7914 (defun gnus-article-set-globals ()
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7915 (with-current-buffer gnus-summary-buffer
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
7916 (gnus-set-global-variables)))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19537
diff changeset
7917
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7918 (defun gnus-signature-toggle (end)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7919 (gnus-with-article-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7920 (let ((inhibit-point-motion-hooks t))
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
7921 (if (text-property-any end (point-max) 'article-type 'signature)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7922 (progn
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7923 (gnus-delete-wash-type 'signature)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7924 (gnus-remove-text-properties-when
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7925 'article-type 'signature end (point-max)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7926 (cons 'article-type (cons 'signature
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7927 gnus-hidden-properties))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7928 (gnus-add-wash-type 'signature)
34727
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
7929 (gnus-add-text-properties-when
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
7930 'article-type nil end (point-max)
4b9a7a10deaa * gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33691
diff changeset
7931 (cons 'article-type (cons 'signature
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7932 gnus-hidden-properties)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7933 (let ((gnus-article-mime-handle-alist-1 gnus-article-mime-handle-alist))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7934 (gnus-set-mode-line 'article))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7935
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7936 (defun gnus-button-entry ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7937 ;; Return the first entry in `gnus-button-alist' matching this place.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7938 (let ((alist gnus-button-alist)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7939 (entry nil))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7940 (while alist
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7941 (setq entry (pop alist))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7942 (if (looking-at (eval (car entry)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7943 (setq alist nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7944 (setq entry nil)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7945 entry))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7946
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7947 (defun gnus-button-push (marker)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7948 ;; Push button starting at MARKER.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7949 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7950 (goto-char marker)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7951 (let* ((entry (gnus-button-entry))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7952 (inhibit-point-motion-hooks t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7953 (fun (nth 3 entry))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7954 (args (or (and (eq (car entry) 'gnus-button-url-regexp)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7955 (get-char-property marker 'gnus-button-url))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7956 (mapcar (lambda (group)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7957 (let ((string (match-string group)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7958 (set-text-properties
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7959 0 (length string) nil string)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7960 string))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
7961 (nthcdr 4 entry)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7962 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7963 ((fboundp fun)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7964 (apply fun args))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7965 ((and (boundp fun)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7966 (fboundp (symbol-value fun)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7967 (apply (symbol-value fun) args))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7968 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7969 (gnus-message 1 "You must define `%S' to use this button"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7970 (cons fun args)))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7971
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7972 (defun gnus-parse-news-url (url)
60215
a2c5c861962a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-124
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
7973 (let (scheme server port group message-id articles)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7974 (with-temp-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7975 (insert url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7976 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7977 (when (looking-at "\\([A-Za-z]+\\):")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7978 (setq scheme (match-string 1))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7979 (goto-char (match-end 0)))
60215
a2c5c861962a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-124
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
7980 (when (looking-at "//\\([^:/]+\\)\\(:?\\)\\([0-9]+\\)?/")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7981 (setq server (match-string 1))
60215
a2c5c861962a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-124
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
7982 (setq port (if (stringp (match-string 3))
a2c5c861962a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-124
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
7983 (string-to-number (match-string 3))
a2c5c861962a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-124
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
7984 (match-string 3)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7985 (goto-char (match-end 0)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7986
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7987 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7988 ((looking-at "\\(.*@.*\\)")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7989 (setq message-id (match-string 1)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7990 ((looking-at "\\([^/]+\\)/\\([-0-9]+\\)")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7991 (setq group (match-string 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7992 articles (split-string (match-string 2) "-")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7993 ((looking-at "\\([^/]+\\)/?")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7994 (setq group (match-string 1)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7995 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7996 (error "Unknown news URL syntax"))))
60215
a2c5c861962a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-124
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
7997 (list scheme server port group message-id articles)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7998
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
7999 (defun gnus-button-handle-news (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8000 "Fetch a news URL."
60215
a2c5c861962a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-124
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
8001 (destructuring-bind (scheme server port group message-id articles)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8002 (gnus-parse-news-url url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8003 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8004 (message-id
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
8005 (with-current-buffer gnus-summary-buffer
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8006 (if server
60239
bbe4bd573f0c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-128
Miles Bader <miles@gnu.org>
parents: 60215
diff changeset
8007 (let ((gnus-refer-article-method
bbe4bd573f0c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-128
Miles Bader <miles@gnu.org>
parents: 60215
diff changeset
8008 (nconc (list (list 'nntp server))
bbe4bd573f0c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-128
Miles Bader <miles@gnu.org>
parents: 60215
diff changeset
8009 gnus-refer-article-method))
60215
a2c5c861962a Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-124
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
8010 (nntp-port-number (or port "nntp")))
60239
bbe4bd573f0c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-128
Miles Bader <miles@gnu.org>
parents: 60215
diff changeset
8011 (gnus-message 7 "Fetching %s with %s"
bbe4bd573f0c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-128
Miles Bader <miles@gnu.org>
parents: 60215
diff changeset
8012 message-id gnus-refer-article-method)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8013 (gnus-summary-refer-article message-id))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8014 (gnus-summary-refer-article message-id))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8015 (group
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8016 (gnus-button-fetch-group url)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8017
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8018 (defun gnus-button-patch (library line)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8019 "Visit an Emacs Lisp library LIBRARY on line LINE."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8020 (interactive)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8021 (let ((file (locate-library (file-name-nondirectory library))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8022 (unless file
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8023 (error "Couldn't find library %s" library))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8024 (find-file file)
104539
7d4a9e8bcfb8 (gnus-button-patch): Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents: 104068
diff changeset
8025 (goto-char (point-min))
7d4a9e8bcfb8 (gnus-button-patch): Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents: 104068
diff changeset
8026 (forward-line (1- (string-to-number line)))))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8027
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8028 (defun gnus-button-handle-man (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8029 "Fetch a man page."
57581
645f020dcc8a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents: 57265
diff changeset
8030 (gnus-message 9 "`%s' `%s'" gnus-button-man-handler url)
645f020dcc8a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents: 57265
diff changeset
8031 (when (eq gnus-button-man-handler 'woman)
645f020dcc8a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents: 57265
diff changeset
8032 (setq url (gnus-replace-in-string url "([1-9][X1a-z]*).*\\'" "")))
645f020dcc8a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents: 57265
diff changeset
8033 (gnus-message 9 "`%s' `%s'" gnus-button-man-handler url)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8034 (funcall gnus-button-man-handler url))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8035
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8036 (defun gnus-button-handle-info-url (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8037 "Fetch an info URL."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8038 (setq url (mm-subst-char-in-string ?+ ?\ url))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8039 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8040 ((string-match "^\\([^:/]+\\)?/\\(.*\\)" url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8041 (gnus-info-find-node
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8042 (concat "(" (or (gnus-url-unhex-string (match-string 1 url))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8043 "Gnus")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8044 ")" (gnus-url-unhex-string (match-string 2 url)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8045 ((string-match "([^)\"]+)[^\"]+" url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8046 (setq url
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8047 (gnus-replace-in-string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8048 (gnus-replace-in-string url "[\n\t ]+" " ") "\"" ""))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8049 (gnus-info-find-node url))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8050 (t (error "Can't parse %s" url))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8051
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8052 (defun gnus-button-handle-info-url-gnome (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8053 "Fetch GNOME style info URL."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8054 (setq url (mm-subst-char-in-string ?_ ?\ url))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8055 (if (string-match "\\([^#]+\\)#?\\(.*\\)" url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8056 (gnus-info-find-node
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8057 (concat "("
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
8058 (gnus-url-unhex-string
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8059 (match-string 1 url))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8060 ")"
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59955
diff changeset
8061 (or (gnus-url-unhex-string
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8062 (match-string 2 url))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8063 "Top")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8064 (error "Can't parse %s" url)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8065
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8066 (defun gnus-button-handle-info-url-kde (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8067 "Fetch KDE style info URL."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8068 (gnus-info-find-node (gnus-url-unhex-string url)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8069
87187
54ba9c058e4a (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87161
diff changeset
8070 ;; (info) will autoload info.el
54ba9c058e4a (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87161
diff changeset
8071 (declare-function Info-menu "info" (menu-item &optional fork))
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8072 (declare-function Info-index-next "info" (num))
87187
54ba9c058e4a (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87161
diff changeset
8073
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8074 (defun gnus-button-handle-info-keystrokes (url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8075 "Call `info' when pushing the corresponding URL button."
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8076 ;; For links like `C-h i d m gnus RET part RET , ,', `C-h i d m CC Mode RET'.
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8077 (let (node indx comma)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8078 (if (string-match
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8079 (concat "\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+i[ \t\n]+d?[ \t\n]?m[ \t\n]+"
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8080 "\\([^ ]+ ?[^ ]+\\)[ \t\n]+RET"
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8081 "\\([ \t\n]+i[ \t\n]+[^ ]+ ?[^ ]+[ \t\n]+RET"
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8082 "\\(?:[ \t\n,]*\\)\\)?")
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8083 url)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8084 (setq node (match-string 2 url)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8085 indx (match-string 3 url))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8086 (error "Can't parse %s" url))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8087 (info)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8088 (Info-directory)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8089 (Info-menu node)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8090 (when (> (length indx) 0)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8091 (string-match (concat "[ \t\n]+i[ \t\n]+\\([^ ]+ ?[^ ]+\\)[ \t\n]+RET"
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8092 "\\([ \t\n,]*\\)")
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8093 indx)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8094 (setq comma (match-string 2 indx))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8095 (setq indx (match-string 1 indx))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8096 (Info-index indx)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8097 (when comma
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8098 (dotimes (i (with-temp-buffer
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8099 (insert comma)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8100 ;; Note: the XEmacs version of `how-many' takes
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8101 ;; no optional argument.
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8102 (goto-char (point-min))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8103 (how-many ",")))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8104 (Info-index-next 1)))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92694
diff changeset
8105 nil)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8106
91677
fe6d0b292d83 (pgg-display-output-buffer): Declare as function.
Glenn Morris <rgm@gnu.org>
parents: 91506
diff changeset
8107 ;; Called after pgg-snarf-keys-region, which autoloads pgg.el.
fe6d0b292d83 (pgg-display-output-buffer): Declare as function.
Glenn Morris <rgm@gnu.org>
parents: 91506
diff changeset
8108 (declare-function pgg-display-output-buffer "pgg" (start end status))
fe6d0b292d83 (pgg-display-output-buffer): Declare as function.
Glenn Morris <rgm@gnu.org>
parents: 91506
diff changeset
8109
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8110 (defun gnus-button-openpgp (url)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8111 "Retrieve and add an OpenPGP key given URL from an OpenPGP header."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8112 (with-temp-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8113 (mm-url-insert-file-contents-external url)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8114 (pgg-snarf-keys-region (point-min) (point-max))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8115 (pgg-display-output-buffer nil nil nil)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8116
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8117 (defun gnus-button-message-id (message-id)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8118 "Fetch MESSAGE-ID."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8119 (with-current-buffer gnus-summary-buffer
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8120 (gnus-summary-refer-article message-id)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8121
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8122 (defun gnus-button-fetch-group (address &rest ignore)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8123 "Fetch GROUP specified by ADDRESS."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8124 (when (string-match "\\`\\(nntp\\|news\\):\\(//\\)?\\(.*\\)\\'"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8125 address)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8126 ;; Allow to use `gnus-button-fetch-group' in `browse-url-browser-function'
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8127 ;; for nntp:// and news://
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8128 (setq address (match-string 3 address)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8129 (if (not (string-match "[:/]" address))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8130 ;; This is just a simple group url.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8131 (gnus-group-read-ephemeral-group address gnus-select-method)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8132 (if (not
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8133 (string-match
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8134 "^\\([^:/]+\\)\\(:\\([^/]+\\)\\)?/\\([^/]+\\)\\(/\\([0-9]+\\)\\)?"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8135 address))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8136 (error "Can't parse %s" address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8137 (gnus-group-read-ephemeral-group
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8138 (match-string 4 address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8139 `(nntp ,(match-string 1 address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8140 (nntp-address ,(match-string 1 address))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8141 (nntp-port-number ,(if (match-end 3)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8142 (match-string 3 address)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8143 "nntp")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8144 nil nil nil
62907
88db2adda4b7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-339
Miles Bader <miles@gnu.org>
parents: 62890
diff changeset
8145 (and (match-end 6) (list (string-to-number (match-string 6 address))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8146
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8147 (defun gnus-url-parse-query-string (query &optional downcase)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8148 (let (retval pairs cur key val)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8149 (setq pairs (split-string query "&"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8150 (while pairs
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8151 (setq cur (car pairs)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8152 pairs (cdr pairs))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8153 (if (not (string-match "=" cur))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8154 nil ; Grace
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8155 (setq key (gnus-url-unhex-string (substring cur 0 (match-beginning 0)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8156 val (gnus-url-unhex-string (substring cur (match-end 0) nil) t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8157 (if downcase
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8158 (setq key (downcase key)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8159 (setq cur (assoc key retval))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8160 (if cur
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8161 (setcdr cur (cons val (cdr cur)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8162 (setq retval (cons (list key val) retval)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8163 retval))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8164
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8165 (defun gnus-url-mailto (url)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8166 ;; Send mail to someone
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8167 (when (string-match "mailto:/*\\(.*\\)" url)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8168 (setq url (substring url (match-beginning 1) nil)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23608
diff changeset
8169 (let (to args subject func)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8170 (setq args (gnus-url-parse-query-string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8171 (if (string-match "^\\?" url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8172 (substring url 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8173 (if (string-match "^\\([^?]+\\)\\?\\(.*\\)" url)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8174 (concat "to=" (match-string 1 url) "&"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8175 (match-string 2 url))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8176 (concat "to=" url)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8177 t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8178 subject (cdr-safe (assoc "subject" args)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8179 (gnus-msg-mail)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8180 (while args
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8181 (setq func (intern-soft (concat "message-goto-" (downcase (caar args)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8182 (if (fboundp func)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8183 (funcall func)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8184 (message-position-on-field (caar args)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8185 (insert (gnus-replace-in-string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8186 (mapconcat 'identity (reverse (cdar args)) ", ")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8187 "\r\n" "\n" t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8188 (setq args (cdr args)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8189 (if subject
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8190 (message-goto-body)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8191 (message-goto-subject))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8192
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8193 (defun gnus-button-embedded-url (address)
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
8194 "Activate ADDRESS with `browse-url'."
23608
3805e63b8caf (gnus-button-embedded-url, gnus-button-url):
Dave Love <fx@gnu.org>
parents: 23361
diff changeset
8195 (browse-url (gnus-strip-whitespace address)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8196
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8197 ;;; Next/prev buttons in the article buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8198
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8199 (defvar gnus-next-page-line-format "%{%(Next page...%)%}\n")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8200 (defvar gnus-prev-page-line-format "%{%(Previous page...%)%}\n")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8201
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8202 (defvar gnus-prev-page-map
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8203 (let ((map (make-sparse-keymap)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8204 (define-key map gnus-mouse-2 'gnus-button-prev-page)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8205 (define-key map "\r" 'gnus-button-prev-page)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8206 map))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8207
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8208 (defvar gnus-next-page-map
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8209 (let ((map (make-sparse-keymap)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8210 (unless (>= emacs-major-version 21)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8211 ;; XEmacs doesn't care.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8212 (set-keymap-parent map gnus-article-mode-map))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8213 (define-key map gnus-mouse-2 'gnus-button-next-page)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8214 (define-key map "\r" 'gnus-button-next-page)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8215 map))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8216
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8217 (defun gnus-insert-prev-page-button ()
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8218 (let ((b (point)) e
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8219 (inhibit-read-only t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8220 (gnus-eval-format
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8221 gnus-prev-page-line-format nil
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8222 `(keymap ,gnus-prev-page-map
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8223 gnus-prev t
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8224 gnus-callback gnus-article-button-prev-page
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8225 article-type annotation))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8226 (setq e (if (bolp)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8227 ;; Exclude a newline.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8228 (1- (point))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8229 (point)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8230 (when gnus-article-button-face
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8231 (gnus-overlay-put (gnus-make-overlay b e nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8232 'face gnus-article-button-face))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8233 (widget-convert-button
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8234 'link b e
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8235 :action 'gnus-button-prev-page
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8236 :button-keymap gnus-prev-page-map)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8237
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8238 (defun gnus-button-next-page (&optional args more-args)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8239 "Go to the next page."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8240 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8241 (let ((win (selected-window)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8242 (select-window (gnus-get-buffer-window gnus-article-buffer t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8243 (gnus-article-next-page)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8244 (select-window win)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8245
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8246 (defun gnus-button-prev-page (&optional args more-args)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8247 "Go to the prev page."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8248 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8249 (let ((win (selected-window)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8250 (select-window (gnus-get-buffer-window gnus-article-buffer t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8251 (gnus-article-prev-page)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8252 (select-window win)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8253
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8254 (defun gnus-insert-next-page-button ()
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8255 (let ((b (point)) e
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8256 (inhibit-read-only t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8257 (gnus-eval-format gnus-next-page-line-format nil
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8258 `(keymap ,gnus-next-page-map
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8259 gnus-next t
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8260 gnus-callback gnus-article-button-next-page
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8261 article-type annotation))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8262 (setq e (if (bolp)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8263 ;; Exclude a newline.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8264 (1- (point))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8265 (point)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8266 (when gnus-article-button-face
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8267 (gnus-overlay-put (gnus-make-overlay b e nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8268 'face gnus-article-button-face))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8269 (widget-convert-button
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8270 'link b e
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8271 :action 'gnus-button-next-page
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8272 :button-keymap gnus-next-page-map)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8273
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8274 (defun gnus-article-button-next-page (arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8275 "Go to the next page."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8276 (interactive "P")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8277 (let ((win (selected-window)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8278 (select-window (gnus-get-buffer-window gnus-article-buffer t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8279 (gnus-article-next-page)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8280 (select-window win)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8281
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8282 (defun gnus-article-button-prev-page (arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8283 "Go to the prev page."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8284 (interactive "P")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8285 (let ((win (selected-window)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8286 (select-window (gnus-get-buffer-window gnus-article-buffer t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8287 (gnus-article-prev-page)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8288 (select-window win)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8289
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8290 (defvar gnus-decode-header-methods
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8291 '(mail-decode-encoded-word-region)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8292 "List of methods used to decode headers.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8293
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8294 This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item
54492
75c387f0b055 Use inhibit-read-only instead of buffer-read-only.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
8295 is FUNCTION, FUNCTION will be applied to all newsgroups. If item is a
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8296 \(REGEXP . FUNCTION), FUNCTION will be only apply to the newsgroups
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8297 whose names match REGEXP.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8298
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8299 For example:
48588
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 47569
diff changeset
8300 \((\"chinese\" . gnus-decode-encoded-word-region-by-guess)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8301 mail-decode-encoded-word-region
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8302 (\"chinese\" . rfc1843-decode-region))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8303 ")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8304
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8305 (defvar gnus-decode-header-methods-cache nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8306
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8307 (defun gnus-multi-decode-header (start end)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8308 "Apply the functions from `gnus-encoded-word-methods' that match."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8309 (unless (and gnus-decode-header-methods-cache
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8310 (eq gnus-newsgroup-name
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8311 (car gnus-decode-header-methods-cache)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8312 (setq gnus-decode-header-methods-cache (list gnus-newsgroup-name))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8313 (dolist (x gnus-decode-header-methods)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8314 (if (symbolp x)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8315 (nconc gnus-decode-header-methods-cache (list x))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8316 (if (and gnus-newsgroup-name
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8317 (string-match (car x) gnus-newsgroup-name))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8318 (nconc gnus-decode-header-methods-cache
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8319 (list (cdr x)))))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8320 (let ((xlist gnus-decode-header-methods-cache))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8321 (pop xlist)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8322 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8323 (narrow-to-region start end)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8324 (while xlist
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8325 (funcall (pop xlist) (point-min) (point-max))))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8326
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8327 ;;;
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8328 ;;; Treatment top-level handling.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8329 ;;;
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8330
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8331 (defun gnus-treat-article (condition &optional part-number total-parts type)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8332 (let ((length (- (point-max) (point-min)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8333 (alist gnus-treatment-function-alist)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8334 (article-goto-body-goes-to-point-min-p t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8335 (treated-type
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8336 (or (not type)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8337 (catch 'found
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8338 (let ((list gnus-article-treat-types))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8339 (while list
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8340 (when (string-match (pop list) type)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8341 (throw 'found t)))))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8342 (highlightp (gnus-visual-p 'article-highlight 'highlight))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8343 val elem)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8344 (gnus-run-hooks 'gnus-part-display-hook)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8345 (dolist (elem alist)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8346 (setq val
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8347 (save-excursion
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8348 (when (gnus-buffer-live-p gnus-summary-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8349 (set-buffer gnus-summary-buffer))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8350 (symbol-value (car elem))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8351 (when (and (or (consp val)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8352 treated-type)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8353 (gnus-treat-predicate val)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8354 (or (not (get (car elem) 'highlight))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8355 highlightp))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8356 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8357 (funcall (cadr elem)))))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8358
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8359 ;; Dynamic variables.
86154
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85888
diff changeset
8360 (defvar part-number)
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85888
diff changeset
8361 (defvar total-parts)
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85888
diff changeset
8362 (defvar type)
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85888
diff changeset
8363 (defvar condition)
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85888
diff changeset
8364 (defvar length)
32993
ce95094f21e7 2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents: 32939
diff changeset
8365
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8366 (defun gnus-treat-predicate (val)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8367 (cond
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8368 ((null val)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8369 nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8370 (condition
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8371 (eq condition val))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8372 ((and (listp val)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8373 (stringp (car val)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8374 (apply 'gnus-or (mapcar `(lambda (s)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8375 (string-match s ,(or gnus-newsgroup-name "")))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8376 val)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8377 ((listp val)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8378 (let ((pred (pop val)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8379 (cond
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8380 ((eq pred 'or)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8381 (apply 'gnus-or (mapcar 'gnus-treat-predicate val)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8382 ((eq pred 'and)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8383 (apply 'gnus-and (mapcar 'gnus-treat-predicate val)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8384 ((eq pred 'not)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8385 (not (gnus-treat-predicate (car val))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8386 ((eq pred 'typep)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8387 (equal (car val) type))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8388 (t
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8389 (error "%S is not a valid predicate" pred)))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8390 ((eq val t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8391 t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8392 ((eq val 'head)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8393 nil)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8394 ((eq val 'first)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8395 (eq part-number 1))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8396 ((eq val 'last)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8397 (eq part-number total-parts))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8398 ((numberp val)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8399 (< length val))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8400 (t
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8401 (error "%S is not a valid value" val))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 25382
diff changeset
8402
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8403 (defun gnus-article-encrypt-body (protocol &optional n)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8404 "Encrypt the article body."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8405 (interactive
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8406 (list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8407 (or gnus-article-encrypt-protocol
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8408 (completing-read "Encrypt protocol: "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8409 gnus-article-encrypt-protocol-alist
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8410 nil t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8411 current-prefix-arg))
87300
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
8412 ;; User might hit `K E' instead of `K e', so prompt once.
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
8413 (when (and gnus-article-encrypt-protocol
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
8414 gnus-novice-user)
b968c7f9a8b4 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87187
diff changeset
8415 (unless (gnus-y-or-n-p "Really encrypt article(s)? ")
105167
e14dfafc8256 * gnus-art.el (gnus-article-encrypt-body):
Juanma Barranquero <lekktu@gmail.com>
parents: 104889
diff changeset
8416 (error "Encrypt aborted")))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8417 (let ((func (cdr (assoc protocol gnus-article-encrypt-protocol-alist))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8418 (unless func
63491
eb8609914b2b (gnus-article-encrypt-body): Don't use `format' on `error' arguments.
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
8419 (error "Can't find the encrypt protocol %s" protocol))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8420 (if (member gnus-newsgroup-name '("nndraft:delayed"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8421 "nndraft:drafts"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8422 "nndraft:queue"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8423 (error "Can't encrypt the article in group %s"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8424 gnus-newsgroup-name))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8425 (gnus-summary-iterate n
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
8426 (with-current-buffer gnus-summary-buffer
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8427 (let ((mail-parse-charset gnus-newsgroup-charset)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8428 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8429 (summary-buffer gnus-summary-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8430 references point)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8431 (gnus-set-global-variables)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8432 (when (gnus-group-read-only-p)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8433 (error "The current newsgroup does not support article encrypt"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8434 (gnus-summary-show-article t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8435 (setq references
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8436 (or (mail-header-references gnus-current-headers) ""))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8437 (set-buffer gnus-article-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8438 (let* ((inhibit-read-only t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8439 (headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8440 (mapcar (lambda (field)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8441 (and (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8442 (message-narrow-to-head)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8443 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8444 (search-forward field nil t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8445 (prog2
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8446 (message-narrow-to-field)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8447 (buffer-string)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8448 (delete-region (point-min) (point-max))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8449 (widen))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8450 '("Content-Type:" "Content-Transfer-Encoding:"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8451 "Content-Disposition:"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8452 (message-narrow-to-head)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8453 (message-remove-header "MIME-Version")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8454 (goto-char (point-max))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8455 (setq point (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8456 (insert (apply 'concat headers))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8457 (widen)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8458 (narrow-to-region point (point-max))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8459 (let ((message-options message-options))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8460 (message-options-set 'message-sender user-mail-address)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8461 (message-options-set 'message-recipients user-mail-address)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8462 (message-options-set 'message-sign-encrypt 'not)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8463 (funcall func))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8464 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8465 (insert "MIME-Version: 1.0\n")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8466 (widen)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8467 (gnus-summary-edit-article-done
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8468 references nil summary-buffer t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8469 (when gnus-keep-backlog
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8470 (gnus-backlog-remove-article
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8471 (car gnus-article-current) (cdr gnus-article-current)))
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
8472 (when (get-buffer gnus-original-article-buffer)
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
8473 (with-current-buffer gnus-original-article-buffer
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8474 (setq gnus-original-article nil)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8475 (when gnus-use-cache
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8476 (gnus-cache-update-article
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8477 (car gnus-article-current) (cdr gnus-article-current))))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8478
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8479 (defvar gnus-mime-security-button-line-format "%{%([[%t:%i]%D]%)%}\n"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8480 "The following specs can be used:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8481 %t The security MIME type
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8482 %i Additional info
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8483 %d Details
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8484 %D Details if button is pressed")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8485
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8486 (defvar gnus-mime-security-button-end-line-format "%{%([[End of %t]%D]%)%}\n"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8487 "The following specs can be used:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8488 %t The security MIME type
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8489 %i Additional info
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8490 %d Details
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8491 %D Details if button is pressed")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8492
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8493 (defvar gnus-mime-security-button-line-format-alist
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8494 '((?t gnus-tmp-type ?s)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8495 (?i gnus-tmp-info ?s)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8496 (?d gnus-tmp-details ?s)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8497 (?D gnus-tmp-pressed-details ?s)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8498
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8499 (defvar gnus-mime-security-button-commands
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8500 '((gnus-article-press-button "\r" "Show Detail")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8501 (undefined "v")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8502 (undefined "t")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8503 (undefined "C")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8504 (gnus-mime-security-save-part "o" "Save...")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8505 (undefined "\C-o")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8506 (undefined "r")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8507 (undefined "d")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8508 (undefined "c")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8509 (undefined "i")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8510 (undefined "E")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8511 (undefined "e")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8512 (undefined "p")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8513 (gnus-mime-security-pipe-part "|" "Pipe To Command...")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8514 (undefined ".")))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8515
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8516 (defvar gnus-mime-security-button-map
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8517 (let ((map (make-sparse-keymap)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8518 (define-key map gnus-mouse-2 'gnus-article-push-button)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8519 (define-key map gnus-down-mouse-3 'gnus-mime-security-button-menu)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8520 (dolist (c gnus-mime-security-button-commands)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8521 (define-key map (cadr c) (car c)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8522 map))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8523
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8524 (easy-menu-define
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8525 gnus-mime-security-button-menu gnus-mime-security-button-map
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8526 "Security button menu."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8527 `("Security Part"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8528 ,@(delq nil
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8529 (mapcar (lambda (c)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8530 (unless (eq (car c) 'undefined)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8531 (vector (caddr c) (car c) :active t)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8532 gnus-mime-security-button-commands))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8533
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8534 (defun gnus-mime-security-button-menu (event prefix)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8535 "Construct a context-sensitive menu of security commands."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8536 (interactive "e\nP")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8537 (save-window-excursion
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8538 (let ((pos (event-start event)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8539 (select-window (posn-window pos))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8540 (goto-char (posn-point pos))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8541 (gnus-article-check-buffer)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8542 (popup-menu gnus-mime-security-button-menu nil prefix))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8543
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8544 (defvar gnus-mime-security-details-buffer nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8545
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8546 (defvar gnus-mime-security-button-pressed nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8547
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8548 (defvar gnus-mime-security-show-details-inline t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8549 "If non-nil, show details in the article buffer.")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8550
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8551 (defun gnus-mime-security-verify-or-decrypt (handle)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8552 (mm-remove-parts (cdr handle))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8553 (let ((region (mm-handle-multipart-ctl-parameter handle 'gnus-region))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8554 point (inhibit-read-only t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8555 (if region
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8556 (goto-char (car region)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8557 (setq point (point))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8558 (with-current-buffer (mm-handle-multipart-original-buffer handle)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8559 (let* ((mm-verify-option 'known)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8560 (mm-decrypt-option 'known)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8561 (nparts (mm-possibly-verify-or-decrypt (cdr handle) handle)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8562 (unless (eq nparts (cdr handle))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8563 (mm-destroy-parts (cdr handle))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8564 (setcdr handle nparts))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8565 (gnus-mime-display-security handle)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8566 (when region
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8567 (delete-region (point) (cdr region))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8568 (set-marker (car region) nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8569 (set-marker (cdr region) nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8570 (goto-char point)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8571
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8572 (defun gnus-mime-security-show-details (handle)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8573 (let ((details (mm-handle-multipart-ctl-parameter handle 'gnus-details)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8574 (if (not details)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8575 (gnus-message 5 "No details.")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8576 (if gnus-mime-security-show-details-inline
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8577 (let ((gnus-mime-security-button-pressed
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8578 (not (get-text-property (point) 'gnus-mime-details)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8579 (gnus-mime-security-button-line-format
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8580 (get-text-property (point) 'gnus-line-format))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8581 (inhibit-read-only t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8582 (forward-char -1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8583 (while (eq (get-text-property (point) 'gnus-line-format)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8584 gnus-mime-security-button-line-format)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8585 (forward-char -1))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8586 (forward-char)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8587 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8588 (narrow-to-region (point) (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8589 (gnus-insert-mime-security-button handle))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8590 (delete-region (point)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8591 (or (text-property-not-all
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8592 (point) (point-max)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8593 'gnus-line-format
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8594 gnus-mime-security-button-line-format)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8595 (point-max))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8596 ;; Not inlined.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8597 (if (gnus-buffer-live-p gnus-mime-security-details-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8598 (with-current-buffer gnus-mime-security-details-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8599 (erase-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8600 t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8601 (setq gnus-mime-security-details-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8602 (gnus-get-buffer-create "*MIME Security Details*")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8603 (with-current-buffer gnus-mime-security-details-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8604 (insert details)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8605 (goto-char (point-min)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8606 (pop-to-buffer gnus-mime-security-details-buffer)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8607
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8608 (defun gnus-mime-security-press-button (handle)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8609 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8610 (if (mm-handle-multipart-ctl-parameter handle 'gnus-info)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8611 (gnus-mime-security-show-details handle)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8612 (gnus-mime-security-verify-or-decrypt handle))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8613
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8614 (defun gnus-insert-mime-security-button (handle &optional displayed)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8615 (let* ((protocol (mm-handle-multipart-ctl-parameter handle 'protocol))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8616 (gnus-tmp-type
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8617 (concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8618 (or (nth 2 (assoc protocol mm-verify-function-alist))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8619 (nth 2 (assoc protocol mm-decrypt-function-alist))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8620 "Unknown")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8621 (if (equal (car handle) "multipart/signed")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8622 " Signed" " Encrypted")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8623 " Part"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8624 (gnus-tmp-info
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8625 (or (mm-handle-multipart-ctl-parameter handle 'gnus-info)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8626 "Undecided"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8627 (gnus-tmp-details
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8628 (mm-handle-multipart-ctl-parameter handle 'gnus-details))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8629 gnus-tmp-pressed-details
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8630 b e)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8631 (setq gnus-tmp-details
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8632 (if gnus-tmp-details
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8633 (concat "\n" gnus-tmp-details)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8634 ""))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8635 (setq gnus-tmp-pressed-details
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8636 (if gnus-mime-security-button-pressed gnus-tmp-details ""))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8637 (unless (bolp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8638 (insert "\n"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8639 (setq b (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8640 (gnus-eval-format
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8641 gnus-mime-security-button-line-format
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8642 gnus-mime-security-button-line-format-alist
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8643 `(keymap ,gnus-mime-security-button-map
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8644 gnus-callback gnus-mime-security-press-button
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8645 gnus-line-format ,gnus-mime-security-button-line-format
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8646 gnus-mime-details ,gnus-mime-security-button-pressed
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8647 article-type annotation
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8648 gnus-data ,handle))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8649 (setq e (if (bolp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8650 ;; Exclude a newline.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8651 (1- (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8652 (point)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8653 (when gnus-article-button-face
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8654 (gnus-overlay-put (gnus-make-overlay b e nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8655 'face gnus-article-button-face))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8656 (widget-convert-button
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8657 'link b e
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8658 :mime-handle handle
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8659 :action 'gnus-widget-press-button
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8660 :button-keymap gnus-mime-security-button-map
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8661 :help-echo
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8662 (lambda (widget/window &optional overlay pos)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8663 ;; Needed to properly clear the message due to a bug in
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8664 ;; wid-edit (XEmacs only).
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8665 (when (boundp 'help-echo-owns-message)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8666 (setq help-echo-owns-message t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8667 (format
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8668 "%S: show detail; %S: more options"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8669 (aref gnus-mouse-2 0)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8670 (aref gnus-down-mouse-3 0))))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8671
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8672 (defun gnus-mime-display-security (handle)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8673 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8674 (narrow-to-region (point) (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8675 (unless (gnus-unbuttonized-mime-type-p (car handle))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8676 (gnus-insert-mime-security-button handle))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8677 (gnus-mime-display-part (cadr handle))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8678 (unless (bolp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8679 (insert "\n"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8680 (unless (gnus-unbuttonized-mime-type-p (car handle))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8681 (let ((gnus-mime-security-button-line-format
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8682 gnus-mime-security-button-end-line-format))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8683 (gnus-insert-mime-security-button handle)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8684 (mm-set-handle-multipart-parameter
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8685 handle 'gnus-region
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8686 (cons (set-marker (make-marker) (point-min))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8687 (set-marker (make-marker) (point-max))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8688 (goto-char (point-max))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8689
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8690 (defun gnus-mime-security-run-function (function)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8691 "Run FUNCTION with the security part under point."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8692 (gnus-article-check-buffer)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8693 (let ((data (get-text-property (point) 'gnus-data))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8694 buffer handle)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8695 (when (and (stringp (car-safe data))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8696 (setq buffer (mm-handle-multipart-original-buffer data))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8697 (setq handle (cadr data)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8698 (if (bufferp (mm-handle-buffer handle))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8699 (progn
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8700 (setq handle (cons buffer (copy-sequence (cdr handle))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8701 (mm-handle-set-undisplayer handle nil))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8702 (setq handle (mm-make-handle
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8703 buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8704 (mm-handle-multipart-ctl-parameter handle 'protocol)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8705 nil nil nil nil nil nil)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8706 (funcall function handle))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8707
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8708 (defun gnus-mime-security-save-part ()
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8709 "Save the security part under point."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8710 (interactive)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8711 (gnus-mime-security-run-function 'mm-save-part))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8713 (defun gnus-mime-security-pipe-part ()
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8714 "Pipe the security part under point to a process."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8715 (interactive)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 84989
diff changeset
8716 (gnus-mime-security-run-function 'mm-pipe-part))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54492
diff changeset
8717
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8718 (gnus-ems-redefine)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8719
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8720 (provide 'gnus-art)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8721
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8722 (run-hooks 'gnus-art-load-hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8723
92306
fc2a30344c2d Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91677
diff changeset
8724 ;; arch-tag: 2654516f-6279-48f9-a83b-05c1fa450c33
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8725 ;;; gnus-art.el ends here