Mercurial > emacs
annotate lisp/gnus/gnus-salt.el @ 94035:a278a40360a9
Mention configuring after maintainer-clean.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 12 Apr 2008 03:18:33 +0000 |
parents | 107ccd98fa12 |
children | 606f2d163a64 f42ef85caf91 |
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 |
64754
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64307
diff
changeset
|
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, |
79708 | 4 ;; 2005, 2006, 2007, 2008 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 | |
78224
24202b793a08
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
75347
diff
changeset
|
13 ;; the Free Software Foundation; either version 3, or (at your option) |
17493 | 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 | |
64085 | 23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
24 ;; Boston, MA 02110-1301, USA. | |
17493 | 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) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
34 (require 'gnus-win) |
17493 | 35 |
36 ;;; | |
37 ;;; gnus-pick-mode | |
38 ;;; | |
39 | |
40 (defvar gnus-pick-mode nil | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
41 "Minor mode for providing a pick-and-read interface in Gnus |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
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 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
54 (when (featurep 'xemacs) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
55 (add-hook 'gnus-pick-mode-hook 'gnus-xmas-pick-menu-add)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
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 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
63 "If non-nil, `gnus-pick-start-reading' runs |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
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 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
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 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
92 gnus-pick-menu gnus-pick-mode-map "" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
93 '("Pick" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
94 ("Pick" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
95 ["Article" gnus-summary-mark-as-processable t] |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
96 ["Thread" gnus-uu-mark-thread t] |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
97 ["Region" gnus-uu-mark-region t] |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
98 ["Regexp" gnus-uu-mark-by-regexp t] |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
99 ["Buffer" gnus-uu-mark-buffer t]) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
100 ("Unpick" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
101 ["Article" gnus-summary-unmark-as-processable t] |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
102 ["Thread" gnus-uu-unmark-thread t] |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
103 ["Region" gnus-uu-unmark-region t] |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
104 ["Regexp" gnus-uu-unmark-by-regexp t] |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
105 ["Buffer" gnus-summary-unmark-all-processable t]) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
106 ["Start reading" gnus-pick-start-reading t] |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
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)) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78634
diff
changeset
|
131 (add-minor-mode 'gnus-pick-mode " Pick" gnus-pick-mode-map) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
132 (gnus-run-hooks 'gnus-pick-mode-hook)))) |
17493 | 133 |
134 (defun gnus-pick-setup-message () | |
135 "Make Message do the right thing on exit." | |
136 (when (and (gnus-buffer-live-p gnus-summary-buffer) | |
78634
933891e04bae
Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78224
diff
changeset
|
137 (with-current-buffer gnus-summary-buffer |
17493 | 138 gnus-pick-mode)) |
139 (message-add-action | |
78634
933891e04bae
Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78224
diff
changeset
|
140 `(gnus-configure-windows ,gnus-current-window-configuration t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
141 'send 'exit 'postpone 'kill))) |
17493 | 142 |
143 (defvar gnus-pick-line-number 1) | |
144 (defun gnus-pick-line-number () | |
145 "Return the current line number." | |
146 (if (bobp) | |
147 (setq gnus-pick-line-number 1) | |
148 (incf gnus-pick-line-number))) | |
149 | |
150 (defun gnus-pick-start-reading (&optional catch-up) | |
151 "Start reading the picked articles. | |
152 If given a prefix, mark all unpicked articles as read." | |
153 (interactive "P") | |
154 (if gnus-newsgroup-processable | |
155 (progn | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
156 (gnus-summary-limit-to-articles nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
157 (when (or catch-up gnus-mark-unpicked-articles-as-read) |
17493 | 158 (gnus-summary-limit-mark-excluded-as-read)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
159 (gnus-summary-first-article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
160 (gnus-configure-windows |
17493 | 161 (if gnus-pick-display-summary 'article 'pick) t)) |
162 (if gnus-pick-elegant-flow | |
163 (progn | |
164 (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
|
165 (gnus-summary-catchup nil t)) |
17493 | 166 (if (gnus-group-quit-config gnus-newsgroup-name) |
167 (gnus-summary-exit) | |
168 (gnus-summary-next-group))) | |
169 (error "No articles have been picked")))) | |
170 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
171 (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
|
172 "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
|
173 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
|
174 (let (pos) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
175 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
176 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
177 (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
|
178 (setq pos (point)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
179 (if (not pos) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
180 (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
|
181 (goto-char pos)))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
182 |
17493 | 183 (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
|
184 "Pick the article on the current line. |
17493 | 185 If ARG, pick the article on that line instead." |
186 (interactive "P") | |
187 (when arg | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
188 (gnus-pick-goto-article arg)) |
17493 | 189 (gnus-summary-mark-as-processable 1)) |
190 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
191 (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
|
192 "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
|
193 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
|
194 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
|
195 (interactive "P") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
196 (when arg |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
197 (gnus-pick-goto-article arg)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
198 (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
|
199 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
200 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
201 (gnus-uu-mark-thread)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
202 (forward-line 1)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
203 (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
|
204 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
205 (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
|
206 "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
|
207 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
|
208 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
|
209 (interactive "P") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
210 (when arg |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
211 (gnus-pick-goto-article arg)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
212 (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
|
213 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
214 (gnus-uu-unmark-thread)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
215 (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
|
216 |
17493 | 217 (defun gnus-pick-mouse-pick (e) |
218 (interactive "e") | |
219 (mouse-set-point e) | |
220 (save-excursion | |
221 (gnus-summary-mark-as-processable 1))) | |
222 | |
223 (defun gnus-pick-mouse-pick-region (start-event) | |
224 "Pick articles that the mouse is dragged over. | |
225 This must be bound to a button-down mouse event." | |
226 (interactive "e") | |
227 (mouse-minibuffer-check start-event) | |
228 (let* ((echo-keystrokes 0) | |
229 (start-posn (event-start start-event)) | |
230 (start-point (posn-point start-posn)) | |
56945
69f3d9a9952b
(gnus-pick-mouse-pick-region): Switch 1 => point-min.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
56927
diff
changeset
|
231 (start-line (1+ (count-lines (point-min) start-point))) |
17493 | 232 (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
|
233 (bounds (gnus-window-edges start-window)) |
17493 | 234 (top (nth 1 bounds)) |
235 (bottom (if (window-minibuffer-p start-window) | |
236 (nth 3 bounds) | |
237 ;; Don't count the mode line. | |
238 (1- (nth 3 bounds)))) | |
239 (click-count (1- (event-click-count start-event)))) | |
240 (setq mouse-selection-click-count click-count) | |
241 (setq mouse-selection-click-count-buffer (current-buffer)) | |
242 (mouse-set-point start-event) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
243 ;; In case the down click is in the middle of some intangible text, |
17493 | 244 ;; use the end of that text, and put it in START-POINT. |
245 (when (< (point) start-point) | |
246 (goto-char start-point)) | |
247 (gnus-pick-article) | |
248 (setq start-point (point)) | |
249 ;; end-of-range is used only in the single-click case. | |
250 ;; It is the place where the drag has reached so far | |
251 ;; (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
|
252 (let (event end end-point (end-of-range (point))) |
17493 | 253 (track-mouse |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
254 (while (progn |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
255 (setq event (cdr (gnus-read-event-char))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
256 (or (mouse-movement-p event) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
257 (eq (car-safe event) 'switch-frame))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
258 (if (eq (car-safe event) 'switch-frame) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
259 nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
260 (setq end (event-end event) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
261 end-point (posn-point end)) |
17493 | 262 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
263 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
264 ;; Are we moving within the original window? |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
265 ((and (eq (posn-window end) start-window) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
266 (integer-or-marker-p end-point)) |
56945
69f3d9a9952b
(gnus-pick-mouse-pick-region): Switch 1 => point-min.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
56927
diff
changeset
|
267 ;; Go to START-POINT first, so that when we move to END-POINT, |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
268 ;; if it's in the middle of intangible text, |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
269 ;; point jumps in the direction away from START-POINT. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
270 (goto-char start-point) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
271 (goto-char end-point) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
272 (gnus-pick-article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
273 ;; In case the user moved his mouse really fast, pick |
56945
69f3d9a9952b
(gnus-pick-mouse-pick-region): Switch 1 => point-min.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
56927
diff
changeset
|
274 ;; articles on the line between this one and the last one. |
69f3d9a9952b
(gnus-pick-mouse-pick-region): Switch 1 => point-min.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
56927
diff
changeset
|
275 (let* ((this-line (1+ (count-lines (point-min) end-point))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
276 (min-line (min this-line start-line)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
277 (max-line (max this-line start-line))) |
56945
69f3d9a9952b
(gnus-pick-mouse-pick-region): Switch 1 => point-min.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
56927
diff
changeset
|
278 ;; Why not use `forward-line'? --Stef |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
279 (while (< min-line max-line) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
280 (goto-line min-line) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
281 (gnus-pick-article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
282 (setq min-line (1+ min-line))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
283 (setq start-line this-line)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
284 (when (zerop (% click-count 3)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
285 (setq end-of-range (point)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
286 (t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
287 (let ((mouse-row (cdr (cdr (mouse-position))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
288 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
289 ((null mouse-row)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
290 ((< mouse-row top) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
291 (mouse-scroll-subr start-window (- mouse-row top))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
292 ((>= mouse-row bottom) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
293 (mouse-scroll-subr start-window |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
294 (1+ (- mouse-row bottom))))))))))) |
17493 | 295 (when (consp event) |
296 (let ((fun (key-binding (vector (car event))))) | |
297 ;; Run the binding of the terminating up-event, if possible. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
298 ;; In the case of a multiple click, it gives the wrong results, |
17493 | 299 ;; because it would fail to set up a region. |
300 (when nil | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
301 ;; (and (= (mod mouse-selection-click-count 3) 0) (fboundp fun)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
302 ;; In this case, we can just let the up-event execute normally. |
17493 | 303 (let ((end (event-end event))) |
304 ;; Set the position in the event before we replay it, | |
305 ;; because otherwise it may have a position in the wrong | |
306 ;; buffer. | |
307 (setcar (cdr end) end-of-range) | |
308 ;; Delete the overlay before calling the function, | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
309 ;; because delete-overlay increases buffer-modified-tick. |
17493 | 310 (push event unread-command-events)))))))) |
311 | |
312 (defun gnus-pick-next-page () | |
313 "Go to the next page. If at the end of the buffer, start reading articles." | |
314 (interactive) | |
315 (let ((scroll-in-place nil)) | |
316 (condition-case nil | |
317 (scroll-up) | |
318 (end-of-buffer (gnus-pick-start-reading))))) | |
319 | |
320 ;;; | |
321 ;;; gnus-binary-mode | |
322 ;;; | |
323 | |
324 (defvar gnus-binary-mode nil | |
325 "Minor mode for providing a binary group interface in Gnus summary buffers.") | |
326 | |
327 (defvar gnus-binary-mode-hook nil | |
328 "Hook run in summary binary mode buffers.") | |
329 | |
330 (defvar gnus-binary-mode-map nil) | |
331 | |
332 (unless gnus-binary-mode-map | |
333 (setq gnus-binary-mode-map (make-sparse-keymap)) | |
334 | |
335 (gnus-define-keys | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
336 gnus-binary-mode-map |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
337 "g" gnus-binary-show-article)) |
17493 | 338 |
339 (defun gnus-binary-make-menu-bar () | |
340 (unless (boundp 'gnus-binary-menu) | |
341 (easy-menu-define | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
342 gnus-binary-menu gnus-binary-mode-map "" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
343 '("Pick" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
344 ["Switch binary mode off" gnus-binary-mode t])))) |
17493 | 345 |
346 (defun gnus-binary-mode (&optional arg) | |
347 "Minor mode for providing a binary group interface in Gnus summary buffers." | |
348 (interactive "P") | |
349 (when (eq major-mode 'gnus-summary-mode) | |
350 (make-local-variable 'gnus-binary-mode) | |
351 (setq gnus-binary-mode | |
352 (if (null arg) (not gnus-binary-mode) | |
353 (> (prefix-numeric-value arg) 0))) | |
354 (when gnus-binary-mode | |
355 ;; Make sure that we don't select any articles upon group entry. | |
356 (make-local-variable 'gnus-auto-select-first) | |
357 (setq gnus-auto-select-first nil) | |
358 (make-local-variable 'gnus-summary-display-article-function) | |
359 (setq gnus-summary-display-article-function 'gnus-binary-display-article) | |
360 ;; Set up the menu. | |
361 (when (gnus-visual-p 'binary-menu 'menu) | |
362 (gnus-binary-make-menu-bar)) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78634
diff
changeset
|
363 (add-minor-mode 'gnus-binary-mode " Binary" gnus-binary-mode-map) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
364 (gnus-run-hooks 'gnus-binary-mode-hook)))) |
17493 | 365 |
366 (defun gnus-binary-display-article (article &optional all-header) | |
367 "Run ARTICLE through the binary decode functions." | |
368 (when (gnus-summary-goto-subject article) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
369 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) |
17493 | 370 (gnus-uu-decode-uu)))) |
371 | |
372 (defun gnus-binary-show-article (&optional arg) | |
373 "Bypass the binary functions and show the article." | |
374 (interactive "P") | |
375 (let (gnus-summary-display-article-function) | |
376 (gnus-summary-show-article arg))) | |
377 | |
378 ;;; | |
379 ;;; gnus-tree-mode | |
380 ;;; | |
381 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
382 (defcustom gnus-tree-line-format "%(%[%3,3n%]%)" |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
383 "Format of tree elements." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
384 :type 'string |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
385 :group 'gnus-summary-tree) |
17493 | 386 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
387 (defcustom gnus-tree-minimize-window t |
17493 | 388 "If non-nil, minimize the tree buffer window. |
389 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
|
390 lines." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
391 :type '(choice boolean |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
392 integer) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
393 :group 'gnus-summary-tree) |
17493 | 394 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
395 (defcustom gnus-selected-tree-face 'modeline |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
396 "*Face used for highlighting selected articles in the thread tree." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
397 :type 'face |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
398 :group 'gnus-summary-tree) |
17493 | 399 |
400 (defvar gnus-tree-brackets '((?\[ . ?\]) (?\( . ?\)) | |
401 (?\{ . ?\}) (?< . ?>)) | |
402 "Brackets used in tree nodes.") | |
403 | |
404 (defvar gnus-tree-parent-child-edges '(?- ?\\ ?|) | |
405 "Characters used to connect parents with children.") | |
406 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
407 (defcustom gnus-tree-mode-line-format "Gnus: %%b %S %Z" |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
408 "*The format specification for the tree mode line." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
409 :type 'string |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
410 :group 'gnus-summary-tree) |
17493 | 411 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
412 (defcustom gnus-generate-tree-function 'gnus-generate-vertical-tree |
17493 | 413 "*Function for generating a thread tree. |
414 Two predefined functions are available: | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
415 `gnus-generate-horizontal-tree' and `gnus-generate-vertical-tree'." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
416 :type '(radio (function-item gnus-generate-vertical-tree) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
417 (function-item gnus-generate-horizontal-tree) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
418 (function :tag "Other" nil)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
419 :group 'gnus-summary-tree) |
17493 | 420 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
421 (defcustom gnus-tree-mode-hook nil |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
422 "*Hook run in tree mode buffers." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
423 :type 'hook |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
424 :group 'gnus-summary-tree) |
17493 | 425 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
426 (when (featurep 'xemacs) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
427 (add-hook 'gnus-tree-mode-hook 'gnus-xmas-tree-menu-add) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
428 (add-hook 'gnus-tree-mode-hook 'gnus-xmas-switch-horizontal-scrollbar-off)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
429 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
430 |
17493 | 431 ;;; Internal variables. |
432 | |
433 (defvar gnus-tree-line-format-alist | |
434 `((?n gnus-tmp-name ?s) | |
435 (?f gnus-tmp-from ?s) | |
436 (?N gnus-tmp-number ?d) | |
437 (?\[ gnus-tmp-open-bracket ?c) | |
438 (?\] gnus-tmp-close-bracket ?c) | |
439 (?s gnus-tmp-subject ?s))) | |
440 | |
441 (defvar gnus-tree-mode-line-format-alist gnus-summary-mode-line-format-alist) | |
442 | |
443 (defvar gnus-tree-mode-line-format-spec nil) | |
444 (defvar gnus-tree-line-format-spec nil) | |
445 | |
446 (defvar gnus-tree-node-length nil) | |
447 (defvar gnus-selected-tree-overlay nil) | |
448 | |
449 (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
|
450 (defvar gnus-tree-inhibit nil) |
17493 | 451 |
452 (defvar gnus-tree-mode-map nil) | |
453 (put 'gnus-tree-mode 'mode-class 'special) | |
454 | |
455 (unless gnus-tree-mode-map | |
456 (setq gnus-tree-mode-map (make-keymap)) | |
457 (suppress-keymap gnus-tree-mode-map) | |
458 (gnus-define-keys | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
459 gnus-tree-mode-map |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
460 "\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
|
461 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
|
462 "\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
|
463 "h" gnus-tree-show-summary |
17493 | 464 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
465 "\C-c\C-i" gnus-info-find-node) |
17493 | 466 |
467 (substitute-key-definition | |
468 'undefined 'gnus-tree-read-summary-keys gnus-tree-mode-map)) | |
469 | |
470 (defun gnus-tree-make-menu-bar () | |
471 (unless (boundp 'gnus-tree-menu) | |
472 (easy-menu-define | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
473 gnus-tree-menu gnus-tree-mode-map "" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
474 '("Tree" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
475 ["Select article" gnus-tree-select-article t])))) |
17493 | 476 |
477 (defun gnus-tree-mode () | |
478 "Major mode for displaying thread trees." | |
479 (interactive) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
480 (gnus-set-format 'tree-mode) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
481 (gnus-set-format 'tree t) |
17493 | 482 (when (gnus-visual-p 'tree-menu 'menu) |
483 (gnus-tree-make-menu-bar)) | |
484 (kill-all-local-variables) | |
485 (gnus-simplify-mode-line) | |
486 (setq mode-name "Tree") | |
487 (setq major-mode 'gnus-tree-mode) | |
488 (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
|
489 (buffer-disable-undo) |
17493 | 490 (setq buffer-read-only t) |
491 (setq truncate-lines t) | |
492 (save-excursion | |
493 (gnus-set-work-buffer) | |
494 (gnus-tree-node-insert (make-mail-header "") nil) | |
495 (setq gnus-tree-node-length (1- (point)))) | |
62890
4b7fa3ee8e9e
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-336
Miles Bader <miles@gnu.org>
parents:
56945
diff
changeset
|
496 (gnus-run-mode-hooks 'gnus-tree-mode-hook)) |
17493 | 497 |
498 (defun gnus-tree-read-summary-keys (&optional arg) | |
499 "Read a summary buffer key sequence and execute it." | |
500 (interactive "P") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
501 (unless gnus-tree-inhibit |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
502 (let ((buf (current-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
503 (gnus-tree-inhibit t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
504 win) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
505 (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
|
506 (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
|
507 (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
|
508 (select-window win) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
509 (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
|
510 (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
|
511 (gnus-tree-minimize))))) |
17493 | 512 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
513 (defun gnus-tree-show-summary () |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
514 "Reconfigure windows to show summary buffer." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
515 (interactive) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
516 (if (not (gnus-buffer-live-p gnus-summary-buffer)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
517 (error "There is no summary buffer for this tree buffer") |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
518 (gnus-configure-windows 'article) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
519 (gnus-summary-goto-subject gnus-current-article))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
520 |
17493 | 521 (defun gnus-tree-select-article (article) |
522 "Select the article under point, if any." | |
523 (interactive (list (gnus-tree-article-number))) | |
524 (let ((buf (current-buffer))) | |
525 (when article | |
78634
933891e04bae
Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78224
diff
changeset
|
526 (with-current-buffer gnus-summary-buffer |
17493 | 527 (gnus-summary-goto-article article)) |
528 (select-window (get-buffer-window buf))))) | |
529 | |
530 (defun gnus-tree-pick-article (e) | |
531 "Select the article under the mouse pointer." | |
532 (interactive "e") | |
533 (mouse-set-point e) | |
534 (gnus-tree-select-article (gnus-tree-article-number))) | |
535 | |
536 (defun gnus-tree-article-number () | |
537 (get-text-property (point) 'gnus-number)) | |
538 | |
539 (defun gnus-tree-article-region (article) | |
540 "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
|
541 (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
|
542 (point-min) (point-max) 'gnus-number article))) |
17493 | 543 (when pos |
544 (cons pos (next-single-property-change pos 'gnus-number))))) | |
545 | |
546 (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
|
547 (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
|
548 (point-min) (point-max) 'gnus-number article))) |
17493 | 549 (when pos |
550 (goto-char pos)))) | |
551 | |
552 (defun gnus-tree-recenter () | |
553 "Center point in the tree window." | |
554 (let ((selected (selected-window)) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
555 (tree-window (gnus-get-buffer-window gnus-tree-buffer t))) |
17493 | 556 (when tree-window |
557 (select-window tree-window) | |
558 (when gnus-selected-tree-overlay | |
559 (goto-char (or (gnus-overlay-end gnus-selected-tree-overlay) 1))) | |
560 (let* ((top (cond ((< (window-height) 4) 0) | |
561 ((< (window-height) 7) 1) | |
562 (t 2))) | |
563 (height (1- (window-height))) | |
564 (bottom (save-excursion (goto-char (point-max)) | |
565 (forward-line (- height)) | |
566 (point)))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
567 ;; Set the window start to either `bottom', which is the biggest |
17493 | 568 ;; possible valid number, or the second line from the top, |
569 ;; whichever is the least. | |
570 (set-window-start | |
571 tree-window (min bottom (save-excursion | |
572 (forward-line (- top)) (point))))) | |
573 (select-window selected)))) | |
574 | |
575 (defun gnus-get-tree-buffer () | |
576 "Return the tree buffer properly initialized." | |
78634
933891e04bae
Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78224
diff
changeset
|
577 (with-current-buffer (gnus-get-buffer-create gnus-tree-buffer) |
17493 | 578 (unless (eq major-mode 'gnus-tree-mode) |
579 (gnus-tree-mode)) | |
580 (current-buffer))) | |
581 | |
582 (defun gnus-tree-minimize () | |
583 (when (and gnus-tree-minimize-window | |
584 (not (one-window-p))) | |
585 (let ((windows 0) | |
586 tot-win-height) | |
587 (walk-windows (lambda (window) (incf windows))) | |
588 (setq tot-win-height | |
589 (- (frame-height) | |
590 (* window-min-height (1- windows)) | |
591 2)) | |
592 (let* ((window-min-height 2) | |
593 (height (count-lines (point-min) (point-max))) | |
594 (min (max (1- window-min-height) height)) | |
595 (tot (if (numberp gnus-tree-minimize-window) | |
596 (min gnus-tree-minimize-window min) | |
597 min)) | |
598 (win (get-buffer-window (current-buffer))) | |
599 (wh (and win (1- (window-height win))))) | |
600 (setq tot (min tot tot-win-height)) | |
601 (when (and win | |
602 (not (eq tot wh))) | |
603 (let ((selected (selected-window))) | |
604 (when (ignore-errors (select-window win)) | |
605 (enlarge-window (- tot wh)) | |
606 (select-window selected)))))))) | |
607 | |
608 ;;; Generating the tree. | |
609 | |
610 (defun gnus-tree-node-insert (header sparse &optional adopted) | |
611 (let* ((dummy (stringp header)) | |
612 (header (if (vectorp header) header | |
613 (progn | |
614 (setq header (make-mail-header "*****")) | |
615 (mail-header-set-number header 0) | |
616 (mail-header-set-lines header 0) | |
617 (mail-header-set-chars header 0) | |
618 header))) | |
619 (gnus-tmp-from (mail-header-from header)) | |
620 (gnus-tmp-subject (mail-header-subject header)) | |
621 (gnus-tmp-number (mail-header-number header)) | |
622 (gnus-tmp-name | |
623 (cond | |
624 ((string-match "(.+)" gnus-tmp-from) | |
625 (substring gnus-tmp-from | |
626 (1+ (match-beginning 0)) (1- (match-end 0)))) | |
627 ((string-match "<[^>]+> *$" gnus-tmp-from) | |
628 (let ((beg (match-beginning 0))) | |
629 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from) | |
630 (substring gnus-tmp-from (1+ (match-beginning 0)) | |
631 (1- (match-end 0)))) | |
632 (substring gnus-tmp-from 0 beg)))) | |
633 ((memq gnus-tmp-number sparse) | |
634 "***") | |
635 (t gnus-tmp-from))) | |
636 (gnus-tmp-open-bracket | |
637 (cond ((memq gnus-tmp-number sparse) | |
638 (caadr gnus-tree-brackets)) | |
639 (dummy (caaddr gnus-tree-brackets)) | |
640 (adopted (car (nth 3 gnus-tree-brackets))) | |
641 (t (caar gnus-tree-brackets)))) | |
642 (gnus-tmp-close-bracket | |
643 (cond ((memq gnus-tmp-number sparse) | |
644 (cdadr gnus-tree-brackets)) | |
645 (adopted (cdr (nth 3 gnus-tree-brackets))) | |
646 (dummy | |
647 (cdaddr gnus-tree-brackets)) | |
648 (t (cdar gnus-tree-brackets)))) | |
649 (buffer-read-only nil) | |
650 beg end) | |
651 (gnus-add-text-properties | |
652 (setq beg (point)) | |
653 (setq end (progn (eval gnus-tree-line-format-spec) (point))) | |
654 (list 'gnus-number gnus-tmp-number)) | |
655 (when (or t (gnus-visual-p 'tree-highlight 'highlight)) | |
656 (gnus-tree-highlight-node gnus-tmp-number beg end)))) | |
657 | |
658 (defun gnus-tree-highlight-node (article beg end) | |
659 "Highlight current line according to `gnus-summary-highlight'." | |
660 (let ((list gnus-summary-highlight) | |
661 face) | |
78634
933891e04bae
Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78224
diff
changeset
|
662 (with-current-buffer gnus-summary-buffer |
17493 | 663 (let* ((score (or (cdr (assq article gnus-newsgroup-scored)) |
664 gnus-summary-default-score 0)) | |
665 (default gnus-summary-default-score) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
666 (default-high gnus-summary-default-high-score) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
667 (default-low gnus-summary-default-low-score) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
668 (uncached (memq article gnus-newsgroup-undownloaded)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
669 (downloaded (not uncached)) |
17493 | 670 (mark (or (gnus-summary-article-mark article) gnus-unread-mark))) |
671 ;; Eval the cars of the lists until we find a match. | |
672 (while (and list | |
673 (not (eval (caar list)))) | |
674 (setq list (cdr list))))) | |
675 (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
|
676 (gnus-put-text-property-excluding-characters-with-faces |
17493 | 677 beg end 'face |
678 (if (boundp face) (symbol-value face) face))))) | |
679 | |
680 (defun gnus-tree-indent (level) | |
681 (insert (make-string (1- (* (1+ gnus-tree-node-length) level)) ? ))) | |
682 | |
683 (defvar gnus-tmp-limit) | |
684 (defvar gnus-tmp-sparse) | |
685 (defvar gnus-tmp-indent) | |
686 | |
687 (defun gnus-generate-tree (thread) | |
688 "Generate a thread tree for THREAD." | |
78634
933891e04bae
Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78224
diff
changeset
|
689 (with-current-buffer (gnus-get-tree-buffer) |
17493 | 690 (let ((buffer-read-only nil) |
691 (gnus-tmp-indent 0)) | |
692 (erase-buffer) | |
693 (funcall gnus-generate-tree-function thread 0) | |
694 (gnus-set-mode-line 'tree) | |
695 (goto-char (point-min)) | |
696 (gnus-tree-minimize) | |
697 (gnus-tree-recenter) | |
698 (let ((selected (selected-window))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
699 (when (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
700 (select-window (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t)) |
17493 | 701 (gnus-horizontal-recenter) |
702 (select-window selected)))))) | |
703 | |
704 (defun gnus-generate-horizontal-tree (thread level &optional dummyp adopted) | |
705 "Generate a horizontal tree." | |
706 (let* ((dummy (stringp (car thread))) | |
707 (do (or dummy | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
708 (and (car thread) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
709 (memq (mail-header-number (car thread)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
710 gnus-tmp-limit)))) |
17493 | 711 col beg) |
712 (if (not do) | |
713 ;; We don't want this article. | |
714 (setq thread (cdr thread)) | |
715 (if (not (bolp)) | |
716 ;; Not the first article on the line, so we insert a "-". | |
717 (insert (car gnus-tree-parent-child-edges)) | |
718 ;; If the level isn't zero, then we insert some indentation. | |
719 (unless (zerop level) | |
720 (gnus-tree-indent level) | |
721 (insert (cadr gnus-tree-parent-child-edges)) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78634
diff
changeset
|
722 (setq col (- (setq beg (point)) (point-at-bol) 1)) |
17493 | 723 ;; Draw "|" lines upwards. |
724 (while (progn | |
725 (forward-line -1) | |
726 (forward-char col) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
727 (eq (char-after) ? )) |
17493 | 728 (delete-char 1) |
729 (insert (caddr gnus-tree-parent-child-edges))) | |
730 (goto-char beg))) | |
731 (setq dummyp nil) | |
732 ;; Insert the article node. | |
733 (gnus-tree-node-insert (pop thread) gnus-tmp-sparse adopted)) | |
734 (if (null thread) | |
735 ;; End of the thread, so we go to the next line. | |
736 (unless (bolp) | |
737 (insert "\n")) | |
738 ;; Recurse downwards in all children of this article. | |
739 (while thread | |
740 (gnus-generate-horizontal-tree | |
741 (pop thread) (if do (1+ level) level) | |
742 (or dummyp dummy) dummy))))) | |
743 | |
744 (defsubst gnus-tree-indent-vertical () | |
745 (let ((len (- (* (1+ gnus-tree-node-length) gnus-tmp-indent) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78634
diff
changeset
|
746 (- (point) (point-at-bol))))) |
17493 | 747 (when (> len 0) |
748 (insert (make-string len ? ))))) | |
749 | |
750 (defsubst gnus-tree-forward-line (n) | |
751 (while (>= (decf n) 0) | |
752 (unless (zerop (forward-line 1)) | |
753 (end-of-line) | |
754 (insert "\n"))) | |
755 (end-of-line)) | |
756 | |
757 (defun gnus-generate-vertical-tree (thread level &optional dummyp adopted) | |
758 "Generate a vertical tree." | |
759 (let* ((dummy (stringp (car thread))) | |
760 (do (or dummy | |
761 (and (car thread) | |
762 (memq (mail-header-number (car thread)) | |
763 gnus-tmp-limit)))) | |
764 beg) | |
765 (if (not do) | |
766 ;; We don't want this article. | |
767 (setq thread (cdr thread)) | |
768 (if (not (save-excursion (beginning-of-line) (bobp))) | |
769 ;; Not the first article on the line, so we insert a "-". | |
770 (progn | |
771 (gnus-tree-indent-vertical) | |
772 (insert (make-string (/ gnus-tree-node-length 2) ? )) | |
773 (insert (caddr gnus-tree-parent-child-edges)) | |
774 (gnus-tree-forward-line 1)) | |
775 ;; If the level isn't zero, then we insert some indentation. | |
776 (unless (zerop gnus-tmp-indent) | |
777 (gnus-tree-forward-line (1- (* 2 level))) | |
778 (gnus-tree-indent-vertical) | |
779 (delete-char -1) | |
780 (insert (cadr gnus-tree-parent-child-edges)) | |
781 (setq beg (point)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
782 (forward-char -1) |
17493 | 783 ;; Draw "-" lines leftwards. |
56945
69f3d9a9952b
(gnus-pick-mouse-pick-region): Switch 1 => point-min.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
56927
diff
changeset
|
784 (while (and (not (bobp)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
785 (eq (char-after (1- (point))) ? )) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
786 (delete-char -1) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
787 (insert (car gnus-tree-parent-child-edges)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
788 (forward-char -1)) |
17493 | 789 (goto-char beg) |
790 (gnus-tree-forward-line 1))) | |
791 (setq dummyp nil) | |
792 ;; Insert the article node. | |
793 (gnus-tree-indent-vertical) | |
794 (gnus-tree-node-insert (pop thread) gnus-tmp-sparse adopted) | |
795 (gnus-tree-forward-line 1)) | |
796 (if (null thread) | |
797 ;; End of the thread, so we go to the next line. | |
798 (progn | |
799 (goto-char (point-min)) | |
800 (end-of-line) | |
801 (incf gnus-tmp-indent)) | |
802 ;; Recurse downwards in all children of this article. | |
803 (while thread | |
804 (gnus-generate-vertical-tree | |
805 (pop thread) (if do (1+ level) level) | |
806 (or dummyp dummy) dummy))))) | |
807 | |
808 ;;; Interface functions. | |
809 | |
810 (defun gnus-possibly-generate-tree (article &optional force) | |
811 "Generate the thread tree for ARTICLE if it isn't displayed already." | |
78634
933891e04bae
Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78224
diff
changeset
|
812 (when (with-current-buffer gnus-summary-buffer |
17493 | 813 (and gnus-use-trees |
814 gnus-show-threads | |
815 (vectorp (gnus-summary-article-header article)))) | |
816 (save-excursion | |
78634
933891e04bae
Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78224
diff
changeset
|
817 (let ((top (with-current-buffer gnus-summary-buffer |
17493 | 818 (gnus-cut-thread |
819 (gnus-remove-thread | |
820 (mail-header-id | |
821 (gnus-summary-article-header article)) | |
822 t)))) | |
823 (gnus-tmp-limit gnus-newsgroup-limit) | |
824 (gnus-tmp-sparse gnus-newsgroup-sparse)) | |
825 (when (or force | |
826 (not (eq top gnus-tree-displayed-thread))) | |
827 (gnus-generate-tree top) | |
828 (setq gnus-tree-displayed-thread top)))))) | |
829 | |
830 (defun gnus-tree-open (group) | |
831 (gnus-get-tree-buffer)) | |
832 | |
833 (defun gnus-tree-close (group) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
834 (gnus-kill-buffer gnus-tree-buffer)) |
17493 | 835 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
836 (defun gnus-tree-perhaps-minimize () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
837 (when (and gnus-tree-minimize-window |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
838 (get-buffer gnus-tree-buffer)) |
78634
933891e04bae
Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78224
diff
changeset
|
839 (with-current-buffer gnus-tree-buffer |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
840 (gnus-tree-minimize)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
841 |
17493 | 842 (defun gnus-highlight-selected-tree (article) |
843 "Highlight the selected article in the tree." | |
844 (let ((buf (current-buffer)) | |
845 region) | |
846 (set-buffer gnus-tree-buffer) | |
847 (when (setq region (gnus-tree-article-region article)) | |
848 (when (or (not gnus-selected-tree-overlay) | |
849 (gnus-extent-detached-p gnus-selected-tree-overlay)) | |
850 ;; Create a new overlay. | |
851 (gnus-overlay-put | |
56945
69f3d9a9952b
(gnus-pick-mouse-pick-region): Switch 1 => point-min.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
56927
diff
changeset
|
852 (setq gnus-selected-tree-overlay |
69f3d9a9952b
(gnus-pick-mouse-pick-region): Switch 1 => point-min.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
56927
diff
changeset
|
853 (gnus-make-overlay (point-min) (1+ (point-min)))) |
17493 | 854 'face gnus-selected-tree-face)) |
855 ;; Move the overlay to the article. | |
856 (gnus-move-overlay | |
857 gnus-selected-tree-overlay (goto-char (car region)) (cdr region)) | |
858 (gnus-tree-minimize) | |
859 (gnus-tree-recenter) | |
860 (let ((selected (selected-window))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
861 (when (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
862 (select-window (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t)) |
17493 | 863 (gnus-horizontal-recenter) |
864 (select-window selected)))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
865 ;; If we remove this save-excursion, it updates the wrong mode lines?!? |
78634
933891e04bae
Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78224
diff
changeset
|
866 (with-current-buffer gnus-tree-buffer |
17493 | 867 (gnus-set-mode-line 'tree)) |
868 (set-buffer buf))) | |
869 | |
870 (defun gnus-tree-highlight-article (article face) | |
78634
933891e04bae
Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78224
diff
changeset
|
871 (with-current-buffer (gnus-get-tree-buffer) |
17493 | 872 (let (region) |
873 (when (setq region (gnus-tree-article-region article)) | |
874 (gnus-put-text-property (car region) (cdr region) 'face face) | |
875 (set-window-point | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
876 (gnus-get-buffer-window (current-buffer) t) (cdr region)))))) |
17493 | 877 |
878 ;;; | |
879 ;;; gnus-carpal | |
880 ;;; | |
881 | |
882 (defvar gnus-carpal-group-buffer-buttons | |
883 '(("next" . gnus-group-next-unread-group) | |
884 ("prev" . gnus-group-prev-unread-group) | |
885 ("read" . gnus-group-read-group) | |
886 ("select" . gnus-group-select-group) | |
887 ("catch-up" . gnus-group-catchup-current) | |
888 ("new-news" . gnus-group-get-new-news-this-group) | |
889 ("toggle-sub" . gnus-group-unsubscribe-current-group) | |
890 ("subscribe" . gnus-group-unsubscribe-group) | |
891 ("kill" . gnus-group-kill-group) | |
892 ("yank" . gnus-group-yank-group) | |
893 ("describe" . gnus-group-describe-group) | |
894 "list" | |
895 ("subscribed" . gnus-group-list-groups) | |
896 ("all" . gnus-group-list-all-groups) | |
897 ("killed" . gnus-group-list-killed) | |
898 ("zombies" . gnus-group-list-zombies) | |
899 ("matching" . gnus-group-list-matching) | |
900 ("post" . gnus-group-post-news) | |
901 ("mail" . gnus-group-mail) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
902 ("local" . (lambda () (interactive) (gnus-group-news 0))) |
17493 | 903 ("rescan" . gnus-group-get-new-news) |
904 ("browse-foreign" . gnus-group-browse-foreign) | |
905 ("exit" . gnus-group-exit))) | |
906 | |
907 (defvar gnus-carpal-summary-buffer-buttons | |
908 '("mark" | |
909 ("read" . gnus-summary-mark-as-read-forward) | |
910 ("tick" . gnus-summary-tick-article-forward) | |
911 ("clear" . gnus-summary-clear-mark-forward) | |
912 ("expirable" . gnus-summary-mark-as-expirable) | |
913 "move" | |
914 ("scroll" . gnus-summary-next-page) | |
915 ("next-unread" . gnus-summary-next-unread-article) | |
916 ("prev-unread" . gnus-summary-prev-unread-article) | |
917 ("first" . gnus-summary-first-unread-article) | |
918 ("best" . gnus-summary-best-unread-article) | |
919 "article" | |
920 ("headers" . gnus-summary-toggle-header) | |
921 ("uudecode" . gnus-uu-decode-uu) | |
922 ("enter-digest" . gnus-summary-enter-digest-group) | |
923 ("fetch-parent" . gnus-summary-refer-parent-article) | |
924 "mail" | |
925 ("move" . gnus-summary-move-article) | |
926 ("copy" . gnus-summary-copy-article) | |
927 ("respool" . gnus-summary-respool-article) | |
928 "threads" | |
929 ("lower" . gnus-summary-lower-thread) | |
930 ("kill" . gnus-summary-kill-thread) | |
931 "post" | |
932 ("post" . gnus-summary-post-news) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
933 ("local" . gnus-summary-news-other-window) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
934 ("mail" . gnus-summary-mail-other-window) |
17493 | 935 ("followup" . gnus-summary-followup-with-original) |
936 ("reply" . gnus-summary-reply-with-original) | |
937 ("cancel" . gnus-summary-cancel-article) | |
938 "misc" | |
939 ("exit" . gnus-summary-exit) | |
940 ("fed-up" . gnus-summary-catchup-and-goto-next-group))) | |
941 | |
942 (defvar gnus-carpal-server-buffer-buttons | |
943 '(("add" . gnus-server-add-server) | |
944 ("browse" . gnus-server-browse-server) | |
945 ("list" . gnus-server-list-servers) | |
946 ("kill" . gnus-server-kill-server) | |
947 ("yank" . gnus-server-yank-server) | |
948 ("copy" . gnus-server-copy-server) | |
949 ("exit" . gnus-server-exit))) | |
950 | |
951 (defvar gnus-carpal-browse-buffer-buttons | |
952 '(("subscribe" . gnus-browse-unsubscribe-current-group) | |
953 ("exit" . gnus-browse-exit))) | |
954 | |
955 (defvar gnus-carpal-group-buffer "*Carpal Group*") | |
956 (defvar gnus-carpal-summary-buffer "*Carpal Summary*") | |
957 (defvar gnus-carpal-server-buffer "*Carpal Server*") | |
958 (defvar gnus-carpal-browse-buffer "*Carpal Browse*") | |
959 | |
960 (defvar gnus-carpal-attached-buffer nil) | |
961 | |
962 (defvar gnus-carpal-mode-hook nil | |
963 "*Hook run in carpal mode buffers.") | |
964 | |
965 (defvar gnus-carpal-button-face 'bold | |
966 "*Face used on carpal buttons.") | |
967 | |
968 (defvar gnus-carpal-header-face 'bold-italic | |
969 "*Face used on carpal buffer headers.") | |
970 | |
971 (defvar gnus-carpal-mode-map nil) | |
972 (put 'gnus-carpal-mode 'mode-class 'special) | |
973 | |
974 (if gnus-carpal-mode-map | |
975 nil | |
976 (setq gnus-carpal-mode-map (make-keymap)) | |
977 (suppress-keymap gnus-carpal-mode-map) | |
978 (define-key gnus-carpal-mode-map " " 'gnus-carpal-select) | |
979 (define-key gnus-carpal-mode-map "\r" 'gnus-carpal-select) | |
980 (define-key gnus-carpal-mode-map gnus-mouse-2 'gnus-carpal-mouse-select)) | |
981 | |
982 (defun gnus-carpal-mode () | |
983 "Major mode for clicking buttons. | |
984 | |
985 All normal editing commands are switched off. | |
986 \\<gnus-carpal-mode-map> | |
987 The following commands are available: | |
988 | |
989 \\{gnus-carpal-mode-map}" | |
990 (interactive) | |
991 (kill-all-local-variables) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
992 (setq mode-line-modified (cdr gnus-mode-line-modified)) |
17493 | 993 (setq major-mode 'gnus-carpal-mode) |
994 (setq mode-name "Gnus Carpal") | |
995 (setq mode-line-process nil) | |
996 (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
|
997 (buffer-disable-undo) |
17493 | 998 (setq buffer-read-only t) |
999 (make-local-variable 'gnus-carpal-attached-buffer) | |
62890
4b7fa3ee8e9e
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-336
Miles Bader <miles@gnu.org>
parents:
56945
diff
changeset
|
1000 (gnus-run-mode-hooks 'gnus-carpal-mode-hook)) |
17493 | 1001 |
1002 (defun gnus-carpal-setup-buffer (type) | |
1003 (let ((buffer (symbol-value (intern (format "gnus-carpal-%s-buffer" type))))) | |
1004 (if (get-buffer buffer) | |
1005 () | |
78634
933891e04bae
Use with-current-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78224
diff
changeset
|
1006 (with-current-buffer (gnus-get-buffer-create buffer) |
17493 | 1007 (gnus-carpal-mode) |
1008 (setq gnus-carpal-attached-buffer | |
1009 (intern (format "gnus-%s-buffer" type))) | |
1010 (let ((buttons (symbol-value | |
1011 (intern (format "gnus-carpal-%s-buffer-buttons" | |
1012 type)))) | |
1013 (buffer-read-only nil) | |
1014 button) | |
1015 (while buttons | |
1016 (setq button (car buttons) | |
1017 buttons (cdr buttons)) | |
1018 (if (stringp button) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78634
diff
changeset
|
1019 (set-text-properties |
17493 | 1020 (point) |
1021 (prog2 (insert button) (point) (insert " ")) | |
1022 (list 'face gnus-carpal-header-face)) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78634
diff
changeset
|
1023 (set-text-properties |
17493 | 1024 (point) |
1025 (prog2 (insert (car button)) (point) (insert " ")) | |
1026 (list 'gnus-callback (cdr button) | |
1027 'face gnus-carpal-button-face | |
1028 gnus-mouse-face-prop 'highlight)))) | |
1029 (let ((fill-column (- (window-width) 2))) | |
1030 (fill-region (point-min) (point-max))) | |
1031 (set-window-point (get-buffer-window (current-buffer)) | |
1032 (point-min))))))) | |
1033 | |
1034 (defun gnus-carpal-select () | |
1035 "Select the button under point." | |
1036 (interactive) | |
1037 (let ((func (get-text-property (point) 'gnus-callback))) | |
1038 (if (null func) | |
1039 () | |
1040 (pop-to-buffer (symbol-value gnus-carpal-attached-buffer)) | |
1041 (call-interactively func)))) | |
1042 | |
1043 (defun gnus-carpal-mouse-select (event) | |
1044 "Select the button under the mouse pointer." | |
1045 (interactive "e") | |
1046 (mouse-set-point event) | |
1047 (gnus-carpal-select)) | |
1048 | |
1049 ;;; Allow redefinition of functions. | |
1050 (gnus-ems-redefine) | |
1051 | |
1052 (provide 'gnus-salt) | |
1053 | |
56945
69f3d9a9952b
(gnus-pick-mouse-pick-region): Switch 1 => point-min.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
56927
diff
changeset
|
1054 ;; arch-tag: 35449164-77b3-4398-bcbd-a2e3e998f810 |
17493 | 1055 ;;; gnus-salt.el ends here |