Mercurial > emacs
annotate lisp/gnus/gnus-salt.el @ 82975:590114f9753d gnus-5_10-pre-merge-josefsson
2004-08-31 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-agent.el (gnus-agent-restore-gcc): Use ^ and regexp-quote.
* gnus-sum.el (gnus-newsgroup-variables): Doc fix (tiny change).
From Helmut Waitzmann <Helmut.Waitzmann@web.de>.
* gnus-agent.el (gnus-agent-regenerate-group): Activate the group
when the group's active is not available.
* gnus-art.el (article-hide-headers): Refer to the values for
gnus-ignored-headers and gnus-visible-headers in the summary
buffer since a user may have set them as group parameters.
(gnus-article-next-page): Fix the way to find a real end-of-buffer
(tiny change). From YAGI Tatsuya <ynyaaa@ybb.ne.jp>.
(gnus-article-read-summary-keys): Restore new window-start and
hscroll to summary window.
(gnus-prev-page-map): Remove duplicated one.
* gnus-cite.el (gnus-cite-ignore-quoted-from): New user option.
(gnus-cite-parse): Ignore quoted envelope From_. Suggested by
Karl Chen <quarl@nospam.quarl.org> and Reiner Steib
<Reiner.Steib@gmx.de>.
* gnus-cus.el (gnus-agent-cat-prepare-category-field): Replace
pp-to-string with gnus-pp-to-string.
* gnus-eform.el (gnus-edit-form): Replace pp with gnus-pp.
* gnus-group.el (gnus-group-make-kiboze-group): Replace pp with
gnus-pp.
* gnus-msg.el (gnus-setup-message): Ignore an article copy while
parsing gnus-posting-styles when the message is not for replying.
(gnus-summary-resend-message-edit): Call mime-to-mml. Suggested
by Hiroshi Fujishima <pooh@nature.tsukuba.ac.jp>.
(gnus-debug): Replace pp with gnus-pp.
* gnus-score.el (gnus-score-save): Replace pp with gnus-pp.
* gnus-spec.el (gnus-update-format): Replace pp-to-string with
gnus-pp-to-string.
* gnus-sum.el (gnus-read-header): Don't remove a header for the
parent article of a sparse article in the thread hashtb. From
Stefan Wiens <s.wi@gmx.net>.
* gnus-util.el (gnus-bind-print-variables): New macro.
(gnus-prin1): Use it.
(gnus-prin1-to-string): Use it.
(gnus-pp): New function.
(gnus-pp-to-string): New function.
* gnus.el: Don't make unnecessary *Group* buffer when loading.
* mail-source.el (mail-source-touch-pop): Doc fix.
* message.el (message-mode): Don't modify paragraph-separate there.
(message-setup-fill-variables): Add mml tags to paragraph-start
and paragraph-separate. Suggested by Andrew Korty <ajk@iu.edu>.
(message-smtpmail-send-it): Doc fix.
(message-exchange-point-and-mark): Don't activate region if it was
inactive. Suggested by Hiroshi Fujishima
<pooh@nature.tsukuba.ac.jp> and Jesper Harder <harder@ifa.au.dk>.
* mm-decode.el (mm-save-part): Bind enable-multibyte-characters to
t while entering a file name using the mm-with-multibyte macro.
Suggested by Hiroshi Fujishima <pooh@nature.tsukuba.ac.jp>.
* mm-encode.el (mm-content-transfer-encoding-defaults): Use
qp-or-base64 for the application/* types.
(mm-safer-encoding): Consider 7bit is safe.
* mm-util.el (mm-with-multibyte-buffer): New macro.
(mm-with-multibyte): New macro.
* mm-view.el (mm-inline-render-with-function): Use multibyte
buffer; decode html source by charset.
* nndoc.el (nndoc-type-alist): Improve regexp for article-begin,
add generate-head-function and generate-article-function to the
rfc822-forward entry.
(nndoc-forward-type-p): Recognize envelope From_.
(nndoc-rfc822-forward-generate-article): New function.
(nndoc-rfc822-forward-generate-head): New function.
From David Hedbor <dhedbor@real.com>.
* nnmail.el (nnmail-split-lowercase-expanded): New user option.
(nnmail-expand-newtext): Lowercase expanded entries if
nnmail-split-lowercase-expanded is non-nil.
* score-mode.el (gnus-score-pretty-print): Replace pp with gnus-pp.
* webmail.el (webmail-debug): Replace pp with gnus-pp.
* gnus-art.el (gnus-article-wash-html-with-w3m): Bind
w3m-safe-url-regexp as the value for mm-w3m-safe-url-regexp; use
w3m-minor-mode-map instead of mm-w3m-local-map-property.
(gnus-mime-save-part-and-strip): Use mm-complicated-handles
instead of mm-multiple-handles.
(gnus-mime-delete-part): Ditto.
* mm-decode.el (mm-multiple-handles): Recognize a string as a mime
handle, as well as a list.
(mm-complicated-handles): Former definition of mm-multiple-handles.
* mm-view.el (mm-w3m-mode-map): Remove.
(mm-w3m-local-map-property): Remove.
(mm-w3m-cid-retrieve-1): Call itself recursively. Suggested by
ARISAWA Akihiro <ari@mbf.sphere.ne.jp>.
(mm-w3m-cid-retrieve): Simplify.
(mm-inline-text-html-render-with-w3m): Decode html source by
charset; check META tags only when charsets are not specified in
headers; specify charset to w3m-region; use w3m-minor-mode-map
instead of mm-w3m-local-map-property.
author | Reiner Steib <Reiner.Steib@gmx.de> |
---|---|
date | Tue, 31 Aug 2004 14:47:59 +0000 |
parents | 0fde48feb604 |
children | 69f3d9a9952b |
rev | line source |
---|---|
17493 | 1 ;;; gnus-salt.el --- alternate summary mode interfaces for Gnus |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
2 |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2001 |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
4 ;; Free Software Foundation, Inc. |
17493 | 5 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
7 ;; Keywords: news |
17493 | 8 |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
25 | |
26 ;;; Commentary: | |
27 | |
28 ;;; Code: | |
29 | |
19521
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
30 (eval-when-compile (require 'cl)) |
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
31 |
17493 | 32 (require 'gnus) |
33 (require 'gnus-sum) | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
34 (require 'gnus-win) |
17493 | 35 |
36 ;;; | |
37 ;;; gnus-pick-mode | |
38 ;;; | |
39 | |
40 (defvar gnus-pick-mode nil | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
41 "Minor mode for providing a pick-and-read interface in Gnus |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
42 summary buffers.") |
17493 | 43 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
44 (defcustom gnus-pick-display-summary nil |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
45 "*Display summary while reading." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
46 :type 'boolean |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
47 :group 'gnus-summary-pick) |
17493 | 48 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
49 (defcustom gnus-pick-mode-hook nil |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
50 "Hook run in summary pick mode buffers." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
51 :type 'hook |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
52 :group 'gnus-summary-pick) |
17493 | 53 |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
54 (when (featurep 'xemacs) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
55 (add-hook 'gnus-pick-mode-hook 'gnus-xmas-pick-menu-add)) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
56 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
57 (defcustom gnus-mark-unpicked-articles-as-read nil |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
58 "*If non-nil, mark all unpicked articles as read." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
59 :type 'boolean |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
60 :group 'gnus-summary-pick) |
17493 | 61 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
62 (defcustom gnus-pick-elegant-flow t |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
63 "If non-nil, `gnus-pick-start-reading' runs |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
64 `gnus-summary-next-group' when no articles have been picked." |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
65 :type 'boolean |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
66 :group 'gnus-summary-pick) |
17493 | 67 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
68 (defcustom gnus-summary-pick-line-format |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
69 "%-5P %U\%R\%z\%I\%(%[%4L: %-23,23n%]%) %s\n" |
17493 | 70 "*The format specification of the lines in pick buffers. |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
71 It accepts the same format specs that `gnus-summary-line-format' does." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
72 :type 'string |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
73 :group 'gnus-summary-pick) |
17493 | 74 |
75 ;;; Internal variables. | |
76 | |
77 (defvar gnus-pick-mode-map nil) | |
78 | |
79 (unless gnus-pick-mode-map | |
80 (setq gnus-pick-mode-map (make-sparse-keymap)) | |
81 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
82 (gnus-define-keys gnus-pick-mode-map |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
83 " " gnus-pick-next-page |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
84 "u" gnus-pick-unmark-article-or-thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
85 "." gnus-pick-article-or-thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
86 gnus-down-mouse-2 gnus-pick-mouse-pick-region |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
87 "\r" gnus-pick-start-reading)) |
17493 | 88 |
89 (defun gnus-pick-make-menu-bar () | |
90 (unless (boundp 'gnus-pick-menu) | |
91 (easy-menu-define | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
92 gnus-pick-menu gnus-pick-mode-map "" |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
93 '("Pick" |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
94 ("Pick" |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
95 ["Article" gnus-summary-mark-as-processable t] |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
96 ["Thread" gnus-uu-mark-thread t] |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
97 ["Region" gnus-uu-mark-region t] |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
98 ["Regexp" gnus-uu-mark-by-regexp t] |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
99 ["Buffer" gnus-uu-mark-buffer t]) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
100 ("Unpick" |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
101 ["Article" gnus-summary-unmark-as-processable t] |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
102 ["Thread" gnus-uu-unmark-thread t] |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
103 ["Region" gnus-uu-unmark-region t] |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
104 ["Regexp" gnus-uu-unmark-by-regexp t] |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
105 ["Buffer" gnus-summary-unmark-all-processable t]) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
106 ["Start reading" gnus-pick-start-reading t] |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
107 ["Switch pick mode off" gnus-pick-mode gnus-pick-mode])))) |
17493 | 108 |
109 (defun gnus-pick-mode (&optional arg) | |
110 "Minor mode for providing a pick-and-read interface in Gnus summary buffers. | |
111 | |
112 \\{gnus-pick-mode-map}" | |
113 (interactive "P") | |
114 (when (eq major-mode 'gnus-summary-mode) | |
115 (if (not (set (make-local-variable 'gnus-pick-mode) | |
116 (if (null arg) (not gnus-pick-mode) | |
117 (> (prefix-numeric-value arg) 0)))) | |
118 (remove-hook 'gnus-message-setup-hook 'gnus-pick-setup-message) | |
119 ;; Make sure that we don't select any articles upon group entry. | |
120 (set (make-local-variable 'gnus-auto-select-first) nil) | |
121 ;; Change line format. | |
122 (setq gnus-summary-line-format gnus-summary-pick-line-format) | |
123 (setq gnus-summary-line-format-spec nil) | |
124 (gnus-update-format-specifications nil 'summary) | |
125 (gnus-update-summary-mark-positions) | |
126 (add-hook 'gnus-message-setup-hook 'gnus-pick-setup-message) | |
127 (set (make-local-variable 'gnus-summary-goto-unread) 'never) | |
128 ;; Set up the menu. | |
129 (when (gnus-visual-p 'pick-menu 'menu) | |
130 (gnus-pick-make-menu-bar)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
131 (gnus-add-minor-mode 'gnus-pick-mode " Pick" gnus-pick-mode-map |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
132 nil 'gnus-pick-mode) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
133 (gnus-run-hooks 'gnus-pick-mode-hook)))) |
17493 | 134 |
135 (defun gnus-pick-setup-message () | |
136 "Make Message do the right thing on exit." | |
137 (when (and (gnus-buffer-live-p gnus-summary-buffer) | |
138 (save-excursion | |
139 (set-buffer gnus-summary-buffer) | |
140 gnus-pick-mode)) | |
141 (message-add-action | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
142 '(gnus-configure-windows ,gnus-current-window-configuration t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
143 'send 'exit 'postpone 'kill))) |
17493 | 144 |
145 (defvar gnus-pick-line-number 1) | |
146 (defun gnus-pick-line-number () | |
147 "Return the current line number." | |
148 (if (bobp) | |
149 (setq gnus-pick-line-number 1) | |
150 (incf gnus-pick-line-number))) | |
151 | |
152 (defun gnus-pick-start-reading (&optional catch-up) | |
153 "Start reading the picked articles. | |
154 If given a prefix, mark all unpicked articles as read." | |
155 (interactive "P") | |
156 (if gnus-newsgroup-processable | |
157 (progn | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
158 (gnus-summary-limit-to-articles nil) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
159 (when (or catch-up gnus-mark-unpicked-articles-as-read) |
17493 | 160 (gnus-summary-limit-mark-excluded-as-read)) |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
161 (gnus-summary-first-article) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
162 (gnus-configure-windows |
17493 | 163 (if gnus-pick-display-summary 'article 'pick) t)) |
164 (if gnus-pick-elegant-flow | |
165 (progn | |
166 (when (or catch-up gnus-mark-unpicked-articles-as-read) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
167 (gnus-summary-catchup nil t)) |
17493 | 168 (if (gnus-group-quit-config gnus-newsgroup-name) |
169 (gnus-summary-exit) | |
170 (gnus-summary-next-group))) | |
171 (error "No articles have been picked")))) | |
172 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
173 (defun gnus-pick-goto-article (arg) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
174 "Go to the article number indicated by ARG. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
175 If ARG is an invalid article number, then stay on current line." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
176 (let (pos) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
177 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
178 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
179 (when (zerop (forward-line (1- (prefix-numeric-value arg)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
180 (setq pos (point)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
181 (if (not pos) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
182 (gnus-error 2 "No such line: %s" arg) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
183 (goto-char pos)))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
184 |
17493 | 185 (defun gnus-pick-article (&optional arg) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
186 "Pick the article on the current line. |
17493 | 187 If ARG, pick the article on that line instead." |
188 (interactive "P") | |
189 (when arg | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
190 (gnus-pick-goto-article arg)) |
17493 | 191 (gnus-summary-mark-as-processable 1)) |
192 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
193 (defun gnus-pick-article-or-thread (&optional arg) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
194 "If `gnus-thread-hide-subtree' is t, then pick the thread on the current line. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
195 Otherwise pick the article on the current line. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
196 If ARG, pick the article/thread on that line instead." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
197 (interactive "P") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
198 (when arg |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
199 (gnus-pick-goto-article arg)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
200 (if gnus-thread-hide-subtree |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
201 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
202 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
203 (gnus-uu-mark-thread)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
204 (forward-line 1)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
205 (gnus-summary-mark-as-processable 1))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
206 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
207 (defun gnus-pick-unmark-article-or-thread (&optional arg) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
208 "If `gnus-thread-hide-subtree' is t, then unmark the thread on current line. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
209 Otherwise unmark the article on current line. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
210 If ARG, unmark thread/article on that line instead." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
211 (interactive "P") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
212 (when arg |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
213 (gnus-pick-goto-article arg)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
214 (if gnus-thread-hide-subtree |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
215 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
216 (gnus-uu-unmark-thread)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
217 (gnus-summary-unmark-as-processable 1))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
218 |
17493 | 219 (defun gnus-pick-mouse-pick (e) |
220 (interactive "e") | |
221 (mouse-set-point e) | |
222 (save-excursion | |
223 (gnus-summary-mark-as-processable 1))) | |
224 | |
225 (defun gnus-pick-mouse-pick-region (start-event) | |
226 "Pick articles that the mouse is dragged over. | |
227 This must be bound to a button-down mouse event." | |
228 (interactive "e") | |
229 (mouse-minibuffer-check start-event) | |
230 (let* ((echo-keystrokes 0) | |
231 (start-posn (event-start start-event)) | |
232 (start-point (posn-point start-posn)) | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
233 (start-line (1+ (count-lines 1 start-point))) |
17493 | 234 (start-window (posn-window start-posn)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
235 (bounds (gnus-window-edges start-window)) |
17493 | 236 (top (nth 1 bounds)) |
237 (bottom (if (window-minibuffer-p start-window) | |
238 (nth 3 bounds) | |
239 ;; Don't count the mode line. | |
240 (1- (nth 3 bounds)))) | |
241 (click-count (1- (event-click-count start-event)))) | |
242 (setq mouse-selection-click-count click-count) | |
243 (setq mouse-selection-click-count-buffer (current-buffer)) | |
244 (mouse-set-point start-event) | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
245 ;; In case the down click is in the middle of some intangible text, |
17493 | 246 ;; use the end of that text, and put it in START-POINT. |
247 (when (< (point) start-point) | |
248 (goto-char start-point)) | |
249 (gnus-pick-article) | |
250 (setq start-point (point)) | |
251 ;; end-of-range is used only in the single-click case. | |
252 ;; It is the place where the drag has reached so far | |
253 ;; (but not outside the window where the drag started). | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
254 (let (event end end-point (end-of-range (point))) |
17493 | 255 (track-mouse |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
256 (while (progn |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
257 (setq event (cdr (gnus-read-event-char))) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
258 (or (mouse-movement-p event) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
259 (eq (car-safe event) 'switch-frame))) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
260 (if (eq (car-safe event) 'switch-frame) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
261 nil |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
262 (setq end (event-end event) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
263 end-point (posn-point end)) |
17493 | 264 |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
265 (cond |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
266 ;; Are we moving within the original window? |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
267 ((and (eq (posn-window end) start-window) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
268 (integer-or-marker-p end-point)) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
269 ;; Go to START-POINT first, so that when we move to END-POINT, |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
270 ;; if it's in the middle of intangible text, |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
271 ;; point jumps in the direction away from START-POINT. |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
272 (goto-char start-point) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
273 (goto-char end-point) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
274 (gnus-pick-article) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
275 ;; In case the user moved his mouse really fast, pick |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
276 ;; articles on the line between this one and the last one. |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
277 (let* ((this-line (1+ (count-lines 1 end-point))) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
278 (min-line (min this-line start-line)) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
279 (max-line (max this-line start-line))) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
280 (while (< min-line max-line) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
281 (goto-line min-line) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
282 (gnus-pick-article) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
283 (setq min-line (1+ min-line))) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
284 (setq start-line this-line)) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
285 (when (zerop (% click-count 3)) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
286 (setq end-of-range (point)))) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
287 (t |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
288 (let ((mouse-row (cdr (cdr (mouse-position))))) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
289 (cond |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
290 ((null mouse-row)) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
291 ((< mouse-row top) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
292 (mouse-scroll-subr start-window (- mouse-row top))) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
293 ((>= mouse-row bottom) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
294 (mouse-scroll-subr start-window |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
295 (1+ (- mouse-row bottom))))))))))) |
17493 | 296 (when (consp event) |
297 (let ((fun (key-binding (vector (car event))))) | |
298 ;; Run the binding of the terminating up-event, if possible. | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
299 ;; In the case of a multiple click, it gives the wrong results, |
17493 | 300 ;; because it would fail to set up a region. |
301 (when nil | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
302 ;; (and (= (mod mouse-selection-click-count 3) 0) (fboundp fun)) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
303 ;; In this case, we can just let the up-event execute normally. |
17493 | 304 (let ((end (event-end event))) |
305 ;; Set the position in the event before we replay it, | |
306 ;; because otherwise it may have a position in the wrong | |
307 ;; buffer. | |
308 (setcar (cdr end) end-of-range) | |
309 ;; Delete the overlay before calling the function, | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
310 ;; because delete-overlay increases buffer-modified-tick. |
17493 | 311 (push event unread-command-events)))))))) |
312 | |
313 (defun gnus-pick-next-page () | |
314 "Go to the next page. If at the end of the buffer, start reading articles." | |
315 (interactive) | |
316 (let ((scroll-in-place nil)) | |
317 (condition-case nil | |
318 (scroll-up) | |
319 (end-of-buffer (gnus-pick-start-reading))))) | |
320 | |
321 ;;; | |
322 ;;; gnus-binary-mode | |
323 ;;; | |
324 | |
325 (defvar gnus-binary-mode nil | |
326 "Minor mode for providing a binary group interface in Gnus summary buffers.") | |
327 | |
328 (defvar gnus-binary-mode-hook nil | |
329 "Hook run in summary binary mode buffers.") | |
330 | |
331 (defvar gnus-binary-mode-map nil) | |
332 | |
333 (unless gnus-binary-mode-map | |
334 (setq gnus-binary-mode-map (make-sparse-keymap)) | |
335 | |
336 (gnus-define-keys | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
337 gnus-binary-mode-map |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
338 "g" gnus-binary-show-article)) |
17493 | 339 |
340 (defun gnus-binary-make-menu-bar () | |
341 (unless (boundp 'gnus-binary-menu) | |
342 (easy-menu-define | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
343 gnus-binary-menu gnus-binary-mode-map "" |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
344 '("Pick" |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
345 ["Switch binary mode off" gnus-binary-mode t])))) |
17493 | 346 |
347 (defun gnus-binary-mode (&optional arg) | |
348 "Minor mode for providing a binary group interface in Gnus summary buffers." | |
349 (interactive "P") | |
350 (when (eq major-mode 'gnus-summary-mode) | |
351 (make-local-variable 'gnus-binary-mode) | |
352 (setq gnus-binary-mode | |
353 (if (null arg) (not gnus-binary-mode) | |
354 (> (prefix-numeric-value arg) 0))) | |
355 (when gnus-binary-mode | |
356 ;; Make sure that we don't select any articles upon group entry. | |
357 (make-local-variable 'gnus-auto-select-first) | |
358 (setq gnus-auto-select-first nil) | |
359 (make-local-variable 'gnus-summary-display-article-function) | |
360 (setq gnus-summary-display-article-function 'gnus-binary-display-article) | |
361 ;; Set up the menu. | |
362 (when (gnus-visual-p 'binary-menu 'menu) | |
363 (gnus-binary-make-menu-bar)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
364 (gnus-add-minor-mode 'gnus-binary-mode " Binary" |
33272
6055a1f6073c
(gnus-binary-mode): Fix call to gnus-add-minor-mode.
Dave Love <fx@gnu.org>
parents:
31716
diff
changeset
|
365 gnus-binary-mode-map nil 'gnus-binary-mode) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
366 (gnus-run-hooks 'gnus-binary-mode-hook)))) |
17493 | 367 |
368 (defun gnus-binary-display-article (article &optional all-header) | |
369 "Run ARTICLE through the binary decode functions." | |
370 (when (gnus-summary-goto-subject article) | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
371 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) |
17493 | 372 (gnus-uu-decode-uu)))) |
373 | |
374 (defun gnus-binary-show-article (&optional arg) | |
375 "Bypass the binary functions and show the article." | |
376 (interactive "P") | |
377 (let (gnus-summary-display-article-function) | |
378 (gnus-summary-show-article arg))) | |
379 | |
380 ;;; | |
381 ;;; gnus-tree-mode | |
382 ;;; | |
383 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
384 (defcustom gnus-tree-line-format "%(%[%3,3n%]%)" |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
385 "Format of tree elements." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
386 :type 'string |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
387 :group 'gnus-summary-tree) |
17493 | 388 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
389 (defcustom gnus-tree-minimize-window t |
17493 | 390 "If non-nil, minimize the tree buffer window. |
391 If a number, never let the tree buffer grow taller than that number of | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
392 lines." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
393 :type '(choice boolean |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
394 integer) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
395 :group 'gnus-summary-tree) |
17493 | 396 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
397 (defcustom gnus-selected-tree-face 'modeline |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
398 "*Face used for highlighting selected articles in the thread tree." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
399 :type 'face |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
400 :group 'gnus-summary-tree) |
17493 | 401 |
402 (defvar gnus-tree-brackets '((?\[ . ?\]) (?\( . ?\)) | |
403 (?\{ . ?\}) (?< . ?>)) | |
404 "Brackets used in tree nodes.") | |
405 | |
406 (defvar gnus-tree-parent-child-edges '(?- ?\\ ?|) | |
407 "Characters used to connect parents with children.") | |
408 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
409 (defcustom gnus-tree-mode-line-format "Gnus: %%b %S %Z" |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
410 "*The format specification for the tree mode line." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
411 :type 'string |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
412 :group 'gnus-summary-tree) |
17493 | 413 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
414 (defcustom gnus-generate-tree-function 'gnus-generate-vertical-tree |
17493 | 415 "*Function for generating a thread tree. |
416 Two predefined functions are available: | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
417 `gnus-generate-horizontal-tree' and `gnus-generate-vertical-tree'." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
418 :type '(radio (function-item gnus-generate-vertical-tree) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
419 (function-item gnus-generate-horizontal-tree) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
420 (function :tag "Other" nil)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
421 :group 'gnus-summary-tree) |
17493 | 422 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
423 (defcustom gnus-tree-mode-hook nil |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
424 "*Hook run in tree mode buffers." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
425 :type 'hook |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
426 :group 'gnus-summary-tree) |
17493 | 427 |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
428 (when (featurep 'xemacs) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
429 (add-hook 'gnus-tree-mode-hook 'gnus-xmas-tree-menu-add) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
430 (add-hook 'gnus-tree-mode-hook 'gnus-xmas-switch-horizontal-scrollbar-off)) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
431 |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
432 |
17493 | 433 ;;; Internal variables. |
434 | |
435 (defvar gnus-tree-line-format-alist | |
436 `((?n gnus-tmp-name ?s) | |
437 (?f gnus-tmp-from ?s) | |
438 (?N gnus-tmp-number ?d) | |
439 (?\[ gnus-tmp-open-bracket ?c) | |
440 (?\] gnus-tmp-close-bracket ?c) | |
441 (?s gnus-tmp-subject ?s))) | |
442 | |
443 (defvar gnus-tree-mode-line-format-alist gnus-summary-mode-line-format-alist) | |
444 | |
445 (defvar gnus-tree-mode-line-format-spec nil) | |
446 (defvar gnus-tree-line-format-spec nil) | |
447 | |
448 (defvar gnus-tree-node-length nil) | |
449 (defvar gnus-selected-tree-overlay nil) | |
450 | |
451 (defvar gnus-tree-displayed-thread nil) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
452 (defvar gnus-tree-inhibit nil) |
17493 | 453 |
454 (defvar gnus-tree-mode-map nil) | |
455 (put 'gnus-tree-mode 'mode-class 'special) | |
456 | |
457 (unless gnus-tree-mode-map | |
458 (setq gnus-tree-mode-map (make-keymap)) | |
459 (suppress-keymap gnus-tree-mode-map) | |
460 (gnus-define-keys | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
461 gnus-tree-mode-map |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
462 "\r" gnus-tree-select-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
463 gnus-mouse-2 gnus-tree-pick-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
464 "\C-?" gnus-tree-read-summary-keys |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
465 "h" gnus-tree-show-summary |
17493 | 466 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
467 "\C-c\C-i" gnus-info-find-node) |
17493 | 468 |
469 (substitute-key-definition | |
470 'undefined 'gnus-tree-read-summary-keys gnus-tree-mode-map)) | |
471 | |
472 (defun gnus-tree-make-menu-bar () | |
473 (unless (boundp 'gnus-tree-menu) | |
474 (easy-menu-define | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
475 gnus-tree-menu gnus-tree-mode-map "" |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
476 '("Tree" |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
477 ["Select article" gnus-tree-select-article t])))) |
17493 | 478 |
479 (defun gnus-tree-mode () | |
480 "Major mode for displaying thread trees." | |
481 (interactive) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
482 (gnus-set-format 'tree-mode) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
483 (gnus-set-format 'tree t) |
17493 | 484 (when (gnus-visual-p 'tree-menu 'menu) |
485 (gnus-tree-make-menu-bar)) | |
486 (kill-all-local-variables) | |
487 (gnus-simplify-mode-line) | |
488 (setq mode-name "Tree") | |
489 (setq major-mode 'gnus-tree-mode) | |
490 (use-local-map gnus-tree-mode-map) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
491 (buffer-disable-undo) |
17493 | 492 (setq buffer-read-only t) |
493 (setq truncate-lines t) | |
494 (save-excursion | |
495 (gnus-set-work-buffer) | |
496 (gnus-tree-node-insert (make-mail-header "") nil) | |
497 (setq gnus-tree-node-length (1- (point)))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
498 (gnus-run-hooks 'gnus-tree-mode-hook)) |
17493 | 499 |
500 (defun gnus-tree-read-summary-keys (&optional arg) | |
501 "Read a summary buffer key sequence and execute it." | |
502 (interactive "P") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
503 (unless gnus-tree-inhibit |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
504 (let ((buf (current-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
505 (gnus-tree-inhibit t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
506 win) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
507 (set-buffer gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
508 (gnus-article-read-summary-keys arg nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
509 (when (setq win (get-buffer-window buf)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
510 (select-window win) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
511 (when gnus-selected-tree-overlay |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
512 (goto-char (or (gnus-overlay-end gnus-selected-tree-overlay) 1))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
513 (gnus-tree-minimize))))) |
17493 | 514 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
515 (defun gnus-tree-show-summary () |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
516 "Reconfigure windows to show summary buffer." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
517 (interactive) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
518 (if (not (gnus-buffer-live-p gnus-summary-buffer)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
519 (error "There is no summary buffer for this tree buffer") |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
520 (gnus-configure-windows 'article) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
521 (gnus-summary-goto-subject gnus-current-article))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
522 |
17493 | 523 (defun gnus-tree-select-article (article) |
524 "Select the article under point, if any." | |
525 (interactive (list (gnus-tree-article-number))) | |
526 (let ((buf (current-buffer))) | |
527 (when article | |
528 (save-excursion | |
529 (set-buffer gnus-summary-buffer) | |
530 (gnus-summary-goto-article article)) | |
531 (select-window (get-buffer-window buf))))) | |
532 | |
533 (defun gnus-tree-pick-article (e) | |
534 "Select the article under the mouse pointer." | |
535 (interactive "e") | |
536 (mouse-set-point e) | |
537 (gnus-tree-select-article (gnus-tree-article-number))) | |
538 | |
539 (defun gnus-tree-article-number () | |
540 (get-text-property (point) 'gnus-number)) | |
541 | |
542 (defun gnus-tree-article-region (article) | |
543 "Return a cons with BEG and END of the article region." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
544 (let ((pos (text-property-any |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
545 (point-min) (point-max) 'gnus-number article))) |
17493 | 546 (when pos |
547 (cons pos (next-single-property-change pos 'gnus-number))))) | |
548 | |
549 (defun gnus-tree-goto-article (article) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
550 (let ((pos (text-property-any |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
551 (point-min) (point-max) 'gnus-number article))) |
17493 | 552 (when pos |
553 (goto-char pos)))) | |
554 | |
555 (defun gnus-tree-recenter () | |
556 "Center point in the tree window." | |
557 (let ((selected (selected-window)) | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
558 (tree-window (gnus-get-buffer-window gnus-tree-buffer t))) |
17493 | 559 (when tree-window |
560 (select-window tree-window) | |
561 (when gnus-selected-tree-overlay | |
562 (goto-char (or (gnus-overlay-end gnus-selected-tree-overlay) 1))) | |
563 (let* ((top (cond ((< (window-height) 4) 0) | |
564 ((< (window-height) 7) 1) | |
565 (t 2))) | |
566 (height (1- (window-height))) | |
567 (bottom (save-excursion (goto-char (point-max)) | |
568 (forward-line (- height)) | |
569 (point)))) | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
570 ;; Set the window start to either `bottom', which is the biggest |
17493 | 571 ;; possible valid number, or the second line from the top, |
572 ;; whichever is the least. | |
573 (set-window-start | |
574 tree-window (min bottom (save-excursion | |
575 (forward-line (- top)) (point))))) | |
576 (select-window selected)))) | |
577 | |
578 (defun gnus-get-tree-buffer () | |
579 "Return the tree buffer properly initialized." | |
580 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
581 (set-buffer (gnus-get-buffer-create gnus-tree-buffer)) |
17493 | 582 (unless (eq major-mode 'gnus-tree-mode) |
583 (gnus-tree-mode)) | |
584 (current-buffer))) | |
585 | |
586 (defun gnus-tree-minimize () | |
587 (when (and gnus-tree-minimize-window | |
588 (not (one-window-p))) | |
589 (let ((windows 0) | |
590 tot-win-height) | |
591 (walk-windows (lambda (window) (incf windows))) | |
592 (setq tot-win-height | |
593 (- (frame-height) | |
594 (* window-min-height (1- windows)) | |
595 2)) | |
596 (let* ((window-min-height 2) | |
597 (height (count-lines (point-min) (point-max))) | |
598 (min (max (1- window-min-height) height)) | |
599 (tot (if (numberp gnus-tree-minimize-window) | |
600 (min gnus-tree-minimize-window min) | |
601 min)) | |
602 (win (get-buffer-window (current-buffer))) | |
603 (wh (and win (1- (window-height win))))) | |
604 (setq tot (min tot tot-win-height)) | |
605 (when (and win | |
606 (not (eq tot wh))) | |
607 (let ((selected (selected-window))) | |
608 (when (ignore-errors (select-window win)) | |
609 (enlarge-window (- tot wh)) | |
610 (select-window selected)))))))) | |
611 | |
612 ;;; Generating the tree. | |
613 | |
614 (defun gnus-tree-node-insert (header sparse &optional adopted) | |
615 (let* ((dummy (stringp header)) | |
616 (header (if (vectorp header) header | |
617 (progn | |
618 (setq header (make-mail-header "*****")) | |
619 (mail-header-set-number header 0) | |
620 (mail-header-set-lines header 0) | |
621 (mail-header-set-chars header 0) | |
622 header))) | |
623 (gnus-tmp-from (mail-header-from header)) | |
624 (gnus-tmp-subject (mail-header-subject header)) | |
625 (gnus-tmp-number (mail-header-number header)) | |
626 (gnus-tmp-name | |
627 (cond | |
628 ((string-match "(.+)" gnus-tmp-from) | |
629 (substring gnus-tmp-from | |
630 (1+ (match-beginning 0)) (1- (match-end 0)))) | |
631 ((string-match "<[^>]+> *$" gnus-tmp-from) | |
632 (let ((beg (match-beginning 0))) | |
633 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from) | |
634 (substring gnus-tmp-from (1+ (match-beginning 0)) | |
635 (1- (match-end 0)))) | |
636 (substring gnus-tmp-from 0 beg)))) | |
637 ((memq gnus-tmp-number sparse) | |
638 "***") | |
639 (t gnus-tmp-from))) | |
640 (gnus-tmp-open-bracket | |
641 (cond ((memq gnus-tmp-number sparse) | |
642 (caadr gnus-tree-brackets)) | |
643 (dummy (caaddr gnus-tree-brackets)) | |
644 (adopted (car (nth 3 gnus-tree-brackets))) | |
645 (t (caar gnus-tree-brackets)))) | |
646 (gnus-tmp-close-bracket | |
647 (cond ((memq gnus-tmp-number sparse) | |
648 (cdadr gnus-tree-brackets)) | |
649 (adopted (cdr (nth 3 gnus-tree-brackets))) | |
650 (dummy | |
651 (cdaddr gnus-tree-brackets)) | |
652 (t (cdar gnus-tree-brackets)))) | |
653 (buffer-read-only nil) | |
654 beg end) | |
655 (gnus-add-text-properties | |
656 (setq beg (point)) | |
657 (setq end (progn (eval gnus-tree-line-format-spec) (point))) | |
658 (list 'gnus-number gnus-tmp-number)) | |
659 (when (or t (gnus-visual-p 'tree-highlight 'highlight)) | |
660 (gnus-tree-highlight-node gnus-tmp-number beg end)))) | |
661 | |
662 (defun gnus-tree-highlight-node (article beg end) | |
663 "Highlight current line according to `gnus-summary-highlight'." | |
664 (let ((list gnus-summary-highlight) | |
665 face) | |
666 (save-excursion | |
667 (set-buffer gnus-summary-buffer) | |
668 (let* ((score (or (cdr (assq article gnus-newsgroup-scored)) | |
669 gnus-summary-default-score 0)) | |
670 (default gnus-summary-default-score) | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
671 (default-high gnus-summary-default-high-score) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
672 (default-low gnus-summary-default-low-score) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
673 (uncached (memq article gnus-newsgroup-undownloaded)) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
674 (downloaded (not uncached)) |
17493 | 675 (mark (or (gnus-summary-article-mark article) gnus-unread-mark))) |
676 ;; Eval the cars of the lists until we find a match. | |
677 (while (and list | |
678 (not (eval (caar list)))) | |
679 (setq list (cdr list))))) | |
680 (unless (eq (setq face (cdar list)) (get-text-property beg 'face)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
681 (gnus-put-text-property-excluding-characters-with-faces |
17493 | 682 beg end 'face |
683 (if (boundp face) (symbol-value face) face))))) | |
684 | |
685 (defun gnus-tree-indent (level) | |
686 (insert (make-string (1- (* (1+ gnus-tree-node-length) level)) ? ))) | |
687 | |
688 (defvar gnus-tmp-limit) | |
689 (defvar gnus-tmp-sparse) | |
690 (defvar gnus-tmp-indent) | |
691 | |
692 (defun gnus-generate-tree (thread) | |
693 "Generate a thread tree for THREAD." | |
694 (save-excursion | |
695 (set-buffer (gnus-get-tree-buffer)) | |
696 (let ((buffer-read-only nil) | |
697 (gnus-tmp-indent 0)) | |
698 (erase-buffer) | |
699 (funcall gnus-generate-tree-function thread 0) | |
700 (gnus-set-mode-line 'tree) | |
701 (goto-char (point-min)) | |
702 (gnus-tree-minimize) | |
703 (gnus-tree-recenter) | |
704 (let ((selected (selected-window))) | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
705 (when (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
706 (select-window (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t)) |
17493 | 707 (gnus-horizontal-recenter) |
708 (select-window selected)))))) | |
709 | |
710 (defun gnus-generate-horizontal-tree (thread level &optional dummyp adopted) | |
711 "Generate a horizontal tree." | |
712 (let* ((dummy (stringp (car thread))) | |
713 (do (or dummy | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
714 (and (car thread) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
715 (memq (mail-header-number (car thread)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
716 gnus-tmp-limit)))) |
17493 | 717 col beg) |
718 (if (not do) | |
719 ;; We don't want this article. | |
720 (setq thread (cdr thread)) | |
721 (if (not (bolp)) | |
722 ;; Not the first article on the line, so we insert a "-". | |
723 (insert (car gnus-tree-parent-child-edges)) | |
724 ;; If the level isn't zero, then we insert some indentation. | |
725 (unless (zerop level) | |
726 (gnus-tree-indent level) | |
727 (insert (cadr gnus-tree-parent-child-edges)) | |
728 (setq col (- (setq beg (point)) (gnus-point-at-bol) 1)) | |
729 ;; Draw "|" lines upwards. | |
730 (while (progn | |
731 (forward-line -1) | |
732 (forward-char col) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
733 (eq (char-after) ? )) |
17493 | 734 (delete-char 1) |
735 (insert (caddr gnus-tree-parent-child-edges))) | |
736 (goto-char beg))) | |
737 (setq dummyp nil) | |
738 ;; Insert the article node. | |
739 (gnus-tree-node-insert (pop thread) gnus-tmp-sparse adopted)) | |
740 (if (null thread) | |
741 ;; End of the thread, so we go to the next line. | |
742 (unless (bolp) | |
743 (insert "\n")) | |
744 ;; Recurse downwards in all children of this article. | |
745 (while thread | |
746 (gnus-generate-horizontal-tree | |
747 (pop thread) (if do (1+ level) level) | |
748 (or dummyp dummy) dummy))))) | |
749 | |
750 (defsubst gnus-tree-indent-vertical () | |
751 (let ((len (- (* (1+ gnus-tree-node-length) gnus-tmp-indent) | |
752 (- (point) (gnus-point-at-bol))))) | |
753 (when (> len 0) | |
754 (insert (make-string len ? ))))) | |
755 | |
756 (defsubst gnus-tree-forward-line (n) | |
757 (while (>= (decf n) 0) | |
758 (unless (zerop (forward-line 1)) | |
759 (end-of-line) | |
760 (insert "\n"))) | |
761 (end-of-line)) | |
762 | |
763 (defun gnus-generate-vertical-tree (thread level &optional dummyp adopted) | |
764 "Generate a vertical tree." | |
765 (let* ((dummy (stringp (car thread))) | |
766 (do (or dummy | |
767 (and (car thread) | |
768 (memq (mail-header-number (car thread)) | |
769 gnus-tmp-limit)))) | |
770 beg) | |
771 (if (not do) | |
772 ;; We don't want this article. | |
773 (setq thread (cdr thread)) | |
774 (if (not (save-excursion (beginning-of-line) (bobp))) | |
775 ;; Not the first article on the line, so we insert a "-". | |
776 (progn | |
777 (gnus-tree-indent-vertical) | |
778 (insert (make-string (/ gnus-tree-node-length 2) ? )) | |
779 (insert (caddr gnus-tree-parent-child-edges)) | |
780 (gnus-tree-forward-line 1)) | |
781 ;; If the level isn't zero, then we insert some indentation. | |
782 (unless (zerop gnus-tmp-indent) | |
783 (gnus-tree-forward-line (1- (* 2 level))) | |
784 (gnus-tree-indent-vertical) | |
785 (delete-char -1) | |
786 (insert (cadr gnus-tree-parent-child-edges)) | |
787 (setq beg (point)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
788 (forward-char -1) |
17493 | 789 ;; Draw "-" lines leftwards. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
790 (while (and (> (point) 1) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
791 (eq (char-after (1- (point))) ? )) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
792 (delete-char -1) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
793 (insert (car gnus-tree-parent-child-edges)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
794 (forward-char -1)) |
17493 | 795 (goto-char beg) |
796 (gnus-tree-forward-line 1))) | |
797 (setq dummyp nil) | |
798 ;; Insert the article node. | |
799 (gnus-tree-indent-vertical) | |
800 (gnus-tree-node-insert (pop thread) gnus-tmp-sparse adopted) | |
801 (gnus-tree-forward-line 1)) | |
802 (if (null thread) | |
803 ;; End of the thread, so we go to the next line. | |
804 (progn | |
805 (goto-char (point-min)) | |
806 (end-of-line) | |
807 (incf gnus-tmp-indent)) | |
808 ;; Recurse downwards in all children of this article. | |
809 (while thread | |
810 (gnus-generate-vertical-tree | |
811 (pop thread) (if do (1+ level) level) | |
812 (or dummyp dummy) dummy))))) | |
813 | |
814 ;;; Interface functions. | |
815 | |
816 (defun gnus-possibly-generate-tree (article &optional force) | |
817 "Generate the thread tree for ARTICLE if it isn't displayed already." | |
818 (when (save-excursion | |
819 (set-buffer gnus-summary-buffer) | |
820 (and gnus-use-trees | |
821 gnus-show-threads | |
822 (vectorp (gnus-summary-article-header article)))) | |
823 (save-excursion | |
824 (let ((top (save-excursion | |
825 (set-buffer gnus-summary-buffer) | |
826 (gnus-cut-thread | |
827 (gnus-remove-thread | |
828 (mail-header-id | |
829 (gnus-summary-article-header article)) | |
830 t)))) | |
831 (gnus-tmp-limit gnus-newsgroup-limit) | |
832 (gnus-tmp-sparse gnus-newsgroup-sparse)) | |
833 (when (or force | |
834 (not (eq top gnus-tree-displayed-thread))) | |
835 (gnus-generate-tree top) | |
836 (setq gnus-tree-displayed-thread top)))))) | |
837 | |
838 (defun gnus-tree-open (group) | |
839 (gnus-get-tree-buffer)) | |
840 | |
841 (defun gnus-tree-close (group) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
842 (gnus-kill-buffer gnus-tree-buffer)) |
17493 | 843 |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
844 (defun gnus-tree-perhaps-minimize () |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
845 (when (and gnus-tree-minimize-window |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
846 (get-buffer gnus-tree-buffer)) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
847 (save-excursion |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
848 (set-buffer gnus-tree-buffer) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
849 (gnus-tree-minimize)))) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
850 |
17493 | 851 (defun gnus-highlight-selected-tree (article) |
852 "Highlight the selected article in the tree." | |
853 (let ((buf (current-buffer)) | |
854 region) | |
855 (set-buffer gnus-tree-buffer) | |
856 (when (setq region (gnus-tree-article-region article)) | |
857 (when (or (not gnus-selected-tree-overlay) | |
858 (gnus-extent-detached-p gnus-selected-tree-overlay)) | |
859 ;; Create a new overlay. | |
860 (gnus-overlay-put | |
861 (setq gnus-selected-tree-overlay (gnus-make-overlay 1 2)) | |
862 'face gnus-selected-tree-face)) | |
863 ;; Move the overlay to the article. | |
864 (gnus-move-overlay | |
865 gnus-selected-tree-overlay (goto-char (car region)) (cdr region)) | |
866 (gnus-tree-minimize) | |
867 (gnus-tree-recenter) | |
868 (let ((selected (selected-window))) | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
869 (when (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
870 (select-window (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t)) |
17493 | 871 (gnus-horizontal-recenter) |
872 (select-window selected)))) | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
873 ;; If we remove this save-excursion, it updates the wrong mode lines?!? |
17493 | 874 (save-excursion |
875 (set-buffer gnus-tree-buffer) | |
876 (gnus-set-mode-line 'tree)) | |
877 (set-buffer buf))) | |
878 | |
879 (defun gnus-tree-highlight-article (article face) | |
880 (save-excursion | |
881 (set-buffer (gnus-get-tree-buffer)) | |
882 (let (region) | |
883 (when (setq region (gnus-tree-article-region article)) | |
884 (gnus-put-text-property (car region) (cdr region) 'face face) | |
885 (set-window-point | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
886 (gnus-get-buffer-window (current-buffer) t) (cdr region)))))) |
17493 | 887 |
888 ;;; | |
889 ;;; gnus-carpal | |
890 ;;; | |
891 | |
892 (defvar gnus-carpal-group-buffer-buttons | |
893 '(("next" . gnus-group-next-unread-group) | |
894 ("prev" . gnus-group-prev-unread-group) | |
895 ("read" . gnus-group-read-group) | |
896 ("select" . gnus-group-select-group) | |
897 ("catch-up" . gnus-group-catchup-current) | |
898 ("new-news" . gnus-group-get-new-news-this-group) | |
899 ("toggle-sub" . gnus-group-unsubscribe-current-group) | |
900 ("subscribe" . gnus-group-unsubscribe-group) | |
901 ("kill" . gnus-group-kill-group) | |
902 ("yank" . gnus-group-yank-group) | |
903 ("describe" . gnus-group-describe-group) | |
904 "list" | |
905 ("subscribed" . gnus-group-list-groups) | |
906 ("all" . gnus-group-list-all-groups) | |
907 ("killed" . gnus-group-list-killed) | |
908 ("zombies" . gnus-group-list-zombies) | |
909 ("matching" . gnus-group-list-matching) | |
910 ("post" . gnus-group-post-news) | |
911 ("mail" . gnus-group-mail) | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
912 ("local" . (lambda () (interactive) (gnus-group-news 0))) |
17493 | 913 ("rescan" . gnus-group-get-new-news) |
914 ("browse-foreign" . gnus-group-browse-foreign) | |
915 ("exit" . gnus-group-exit))) | |
916 | |
917 (defvar gnus-carpal-summary-buffer-buttons | |
918 '("mark" | |
919 ("read" . gnus-summary-mark-as-read-forward) | |
920 ("tick" . gnus-summary-tick-article-forward) | |
921 ("clear" . gnus-summary-clear-mark-forward) | |
922 ("expirable" . gnus-summary-mark-as-expirable) | |
923 "move" | |
924 ("scroll" . gnus-summary-next-page) | |
925 ("next-unread" . gnus-summary-next-unread-article) | |
926 ("prev-unread" . gnus-summary-prev-unread-article) | |
927 ("first" . gnus-summary-first-unread-article) | |
928 ("best" . gnus-summary-best-unread-article) | |
929 "article" | |
930 ("headers" . gnus-summary-toggle-header) | |
931 ("uudecode" . gnus-uu-decode-uu) | |
932 ("enter-digest" . gnus-summary-enter-digest-group) | |
933 ("fetch-parent" . gnus-summary-refer-parent-article) | |
934 "mail" | |
935 ("move" . gnus-summary-move-article) | |
936 ("copy" . gnus-summary-copy-article) | |
937 ("respool" . gnus-summary-respool-article) | |
938 "threads" | |
939 ("lower" . gnus-summary-lower-thread) | |
940 ("kill" . gnus-summary-kill-thread) | |
941 "post" | |
942 ("post" . gnus-summary-post-news) | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
943 ("local" . gnus-summary-news-other-window) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
944 ("mail" . gnus-summary-mail-other-window) |
17493 | 945 ("followup" . gnus-summary-followup-with-original) |
946 ("reply" . gnus-summary-reply-with-original) | |
947 ("cancel" . gnus-summary-cancel-article) | |
948 "misc" | |
949 ("exit" . gnus-summary-exit) | |
950 ("fed-up" . gnus-summary-catchup-and-goto-next-group))) | |
951 | |
952 (defvar gnus-carpal-server-buffer-buttons | |
953 '(("add" . gnus-server-add-server) | |
954 ("browse" . gnus-server-browse-server) | |
955 ("list" . gnus-server-list-servers) | |
956 ("kill" . gnus-server-kill-server) | |
957 ("yank" . gnus-server-yank-server) | |
958 ("copy" . gnus-server-copy-server) | |
959 ("exit" . gnus-server-exit))) | |
960 | |
961 (defvar gnus-carpal-browse-buffer-buttons | |
962 '(("subscribe" . gnus-browse-unsubscribe-current-group) | |
963 ("exit" . gnus-browse-exit))) | |
964 | |
965 (defvar gnus-carpal-group-buffer "*Carpal Group*") | |
966 (defvar gnus-carpal-summary-buffer "*Carpal Summary*") | |
967 (defvar gnus-carpal-server-buffer "*Carpal Server*") | |
968 (defvar gnus-carpal-browse-buffer "*Carpal Browse*") | |
969 | |
970 (defvar gnus-carpal-attached-buffer nil) | |
971 | |
972 (defvar gnus-carpal-mode-hook nil | |
973 "*Hook run in carpal mode buffers.") | |
974 | |
975 (defvar gnus-carpal-button-face 'bold | |
976 "*Face used on carpal buttons.") | |
977 | |
978 (defvar gnus-carpal-header-face 'bold-italic | |
979 "*Face used on carpal buffer headers.") | |
980 | |
981 (defvar gnus-carpal-mode-map nil) | |
982 (put 'gnus-carpal-mode 'mode-class 'special) | |
983 | |
984 (if gnus-carpal-mode-map | |
985 nil | |
986 (setq gnus-carpal-mode-map (make-keymap)) | |
987 (suppress-keymap gnus-carpal-mode-map) | |
988 (define-key gnus-carpal-mode-map " " 'gnus-carpal-select) | |
989 (define-key gnus-carpal-mode-map "\r" 'gnus-carpal-select) | |
990 (define-key gnus-carpal-mode-map gnus-mouse-2 'gnus-carpal-mouse-select)) | |
991 | |
992 (defun gnus-carpal-mode () | |
993 "Major mode for clicking buttons. | |
994 | |
995 All normal editing commands are switched off. | |
996 \\<gnus-carpal-mode-map> | |
997 The following commands are available: | |
998 | |
999 \\{gnus-carpal-mode-map}" | |
1000 (interactive) | |
1001 (kill-all-local-variables) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
1002 (setq mode-line-modified (cdr gnus-mode-line-modified)) |
17493 | 1003 (setq major-mode 'gnus-carpal-mode) |
1004 (setq mode-name "Gnus Carpal") | |
1005 (setq mode-line-process nil) | |
1006 (use-local-map gnus-carpal-mode-map) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1007 (buffer-disable-undo) |
17493 | 1008 (setq buffer-read-only t) |
1009 (make-local-variable 'gnus-carpal-attached-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1010 (gnus-run-hooks 'gnus-carpal-mode-hook)) |
17493 | 1011 |
1012 (defun gnus-carpal-setup-buffer (type) | |
1013 (let ((buffer (symbol-value (intern (format "gnus-carpal-%s-buffer" type))))) | |
1014 (if (get-buffer buffer) | |
1015 () | |
1016 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1017 (set-buffer (gnus-get-buffer-create buffer)) |
17493 | 1018 (gnus-carpal-mode) |
1019 (setq gnus-carpal-attached-buffer | |
1020 (intern (format "gnus-%s-buffer" type))) | |
1021 (let ((buttons (symbol-value | |
1022 (intern (format "gnus-carpal-%s-buffer-buttons" | |
1023 type)))) | |
1024 (buffer-read-only nil) | |
1025 button) | |
1026 (while buttons | |
1027 (setq button (car buttons) | |
1028 buttons (cdr buttons)) | |
1029 (if (stringp button) | |
1030 (gnus-set-text-properties | |
1031 (point) | |
1032 (prog2 (insert button) (point) (insert " ")) | |
1033 (list 'face gnus-carpal-header-face)) | |
1034 (gnus-set-text-properties | |
1035 (point) | |
1036 (prog2 (insert (car button)) (point) (insert " ")) | |
1037 (list 'gnus-callback (cdr button) | |
1038 'face gnus-carpal-button-face | |
1039 gnus-mouse-face-prop 'highlight)))) | |
1040 (let ((fill-column (- (window-width) 2))) | |
1041 (fill-region (point-min) (point-max))) | |
1042 (set-window-point (get-buffer-window (current-buffer)) | |
1043 (point-min))))))) | |
1044 | |
1045 (defun gnus-carpal-select () | |
1046 "Select the button under point." | |
1047 (interactive) | |
1048 (let ((func (get-text-property (point) 'gnus-callback))) | |
1049 (if (null func) | |
1050 () | |
1051 (pop-to-buffer (symbol-value gnus-carpal-attached-buffer)) | |
1052 (call-interactively func)))) | |
1053 | |
1054 (defun gnus-carpal-mouse-select (event) | |
1055 "Select the button under the mouse pointer." | |
1056 (interactive "e") | |
1057 (mouse-set-point event) | |
1058 (gnus-carpal-select)) | |
1059 | |
1060 ;;; Allow redefinition of functions. | |
1061 (gnus-ems-redefine) | |
1062 | |
1063 (provide 'gnus-salt) | |
1064 | |
52401 | 1065 ;;; arch-tag: 35449164-77b3-4398-bcbd-a2e3e998f810 |
17493 | 1066 ;;; gnus-salt.el ends here |