comparison lisp/gnus/gnus-salt.el @ 89971:cce1c0ee76ee

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-36 Merge from emacs--cvs-trunk--0, emacs--gnus--5.10, gnus--rel--5.10 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523 Merge from emacs--gnus--5.10, gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-524 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-534 Update from CVS * miles@gnu.org--gnu-2004/emacs--gnus--5.10--base-0 tag of miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-464 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-1 Import from CVS branch gnus-5_10-branch * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-2 Merge from lorentey@elte.hu--2004/emacs--multi-tty--0, emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-3 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-4 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-18 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-19 Remove autoconf-generated files from archive * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-20 Update from CVS
author Miles Bader <miles@gnu.org>
date Thu, 09 Sep 2004 09:36:36 +0000
parents 561b856c5b1f 69f3d9a9952b
children 01137c1fdbe9
comparison
equal deleted inserted replaced
89970:a849e5779b8c 89971:cce1c0ee76ee
1 ;;; gnus-salt.el --- alternate summary mode interfaces for Gnus 1 ;;; gnus-salt.el --- alternate summary mode interfaces for Gnus
2 2
3 ;; Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. 3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2001
4 ;; Free Software Foundation, Inc.
4 5
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> 6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6 ;; Keywords: news 7 ;; Keywords: news
7 8
8 ;; This file is part of GNU Emacs. 9 ;; This file is part of GNU Emacs.
28 29
29 (eval-when-compile (require 'cl)) 30 (eval-when-compile (require 'cl))
30 31
31 (require 'gnus) 32 (require 'gnus)
32 (require 'gnus-sum) 33 (require 'gnus-sum)
34 (require 'gnus-win)
33 35
34 ;;; 36 ;;;
35 ;;; gnus-pick-mode 37 ;;; gnus-pick-mode
36 ;;; 38 ;;;
37 39
38 (defvar gnus-pick-mode nil 40 (defvar gnus-pick-mode nil
39 "Minor mode for providing a pick-and-read interface in Gnus summary buffers.") 41 "Minor mode for providing a pick-and-read interface in Gnus
42 summary buffers.")
40 43
41 (defcustom gnus-pick-display-summary nil 44 (defcustom gnus-pick-display-summary nil
42 "*Display summary while reading." 45 "*Display summary while reading."
43 :type 'boolean 46 :type 'boolean
44 :group 'gnus-summary-pick) 47 :group 'gnus-summary-pick)
46 (defcustom gnus-pick-mode-hook nil 49 (defcustom gnus-pick-mode-hook nil
47 "Hook run in summary pick mode buffers." 50 "Hook run in summary pick mode buffers."
48 :type 'hook 51 :type 'hook
49 :group 'gnus-summary-pick) 52 :group 'gnus-summary-pick)
50 53
54 (when (featurep 'xemacs)
55 (add-hook 'gnus-pick-mode-hook 'gnus-xmas-pick-menu-add))
56
51 (defcustom gnus-mark-unpicked-articles-as-read nil 57 (defcustom gnus-mark-unpicked-articles-as-read nil
52 "*If non-nil, mark all unpicked articles as read." 58 "*If non-nil, mark all unpicked articles as read."
53 :type 'boolean 59 :type 'boolean
54 :group 'gnus-summary-pick) 60 :group 'gnus-summary-pick)
55 61
56 (defcustom gnus-pick-elegant-flow t 62 (defcustom gnus-pick-elegant-flow t
57 "If non-nil, `gnus-pick-start-reading' runs `gnus-summary-next-group' when no articles have been picked." 63 "If non-nil, `gnus-pick-start-reading' runs
64 `gnus-summary-next-group' when no articles have been picked."
58 :type 'boolean 65 :type 'boolean
59 :group 'gnus-summary-pick) 66 :group 'gnus-summary-pick)
60 67
61 (defcustom gnus-summary-pick-line-format 68 (defcustom gnus-summary-pick-line-format
62 "%-5P %U\%R\%z\%I\%(%[%4L: %-20,20n%]%) %s\n" 69 "%-5P %U\%R\%z\%I\%(%[%4L: %-23,23n%]%) %s\n"
63 "*The format specification of the lines in pick buffers. 70 "*The format specification of the lines in pick buffers.
64 It accepts the same format specs that `gnus-summary-line-format' does." 71 It accepts the same format specs that `gnus-summary-line-format' does."
65 :type 'string 72 :type 'string
66 :group 'gnus-summary-pick) 73 :group 'gnus-summary-pick)
67 74
80 "\r" gnus-pick-start-reading)) 87 "\r" gnus-pick-start-reading))
81 88
82 (defun gnus-pick-make-menu-bar () 89 (defun gnus-pick-make-menu-bar ()
83 (unless (boundp 'gnus-pick-menu) 90 (unless (boundp 'gnus-pick-menu)
84 (easy-menu-define 91 (easy-menu-define
85 gnus-pick-menu gnus-pick-mode-map "" 92 gnus-pick-menu gnus-pick-mode-map ""
86 '("Pick" 93 '("Pick"
87 ("Pick" 94 ("Pick"
88 ["Article" gnus-summary-mark-as-processable t] 95 ["Article" gnus-summary-mark-as-processable t]
89 ["Thread" gnus-uu-mark-thread t] 96 ["Thread" gnus-uu-mark-thread t]
90 ["Region" gnus-uu-mark-region t] 97 ["Region" gnus-uu-mark-region t]
91 ["Regexp" gnus-uu-mark-by-regexp t] 98 ["Regexp" gnus-uu-mark-by-regexp t]
92 ["Buffer" gnus-uu-mark-buffer t]) 99 ["Buffer" gnus-uu-mark-buffer t])
93 ("Unpick" 100 ("Unpick"
94 ["Article" gnus-summary-unmark-as-processable t] 101 ["Article" gnus-summary-unmark-as-processable t]
95 ["Thread" gnus-uu-unmark-thread t] 102 ["Thread" gnus-uu-unmark-thread t]
96 ["Region" gnus-uu-unmark-region t] 103 ["Region" gnus-uu-unmark-region t]
97 ["Regexp" gnus-uu-unmark-by-regexp t] 104 ["Regexp" gnus-uu-unmark-by-regexp t]
98 ["Buffer" gnus-summary-unmark-all-processable t]) 105 ["Buffer" gnus-summary-unmark-all-processable t])
99 ["Start reading" gnus-pick-start-reading t] 106 ["Start reading" gnus-pick-start-reading t]
100 ["Switch pick mode off" gnus-pick-mode gnus-pick-mode])))) 107 ["Switch pick mode off" gnus-pick-mode gnus-pick-mode]))))
101 108
102 (defun gnus-pick-mode (&optional arg) 109 (defun gnus-pick-mode (&optional arg)
103 "Minor mode for providing a pick-and-read interface in Gnus summary buffers. 110 "Minor mode for providing a pick-and-read interface in Gnus summary buffers.
104 111
105 \\{gnus-pick-mode-map}" 112 \\{gnus-pick-mode-map}"
146 "Start reading the picked articles. 153 "Start reading the picked articles.
147 If given a prefix, mark all unpicked articles as read." 154 If given a prefix, mark all unpicked articles as read."
148 (interactive "P") 155 (interactive "P")
149 (if gnus-newsgroup-processable 156 (if gnus-newsgroup-processable
150 (progn 157 (progn
151 (gnus-summary-limit-to-articles nil) 158 (gnus-summary-limit-to-articles nil)
152 (when (or catch-up gnus-mark-unpicked-articles-as-read) 159 (when (or catch-up gnus-mark-unpicked-articles-as-read)
153 (gnus-summary-limit-mark-excluded-as-read)) 160 (gnus-summary-limit-mark-excluded-as-read))
154 (gnus-summary-first-article) 161 (gnus-summary-first-article)
155 (gnus-configure-windows 162 (gnus-configure-windows
156 (if gnus-pick-display-summary 'article 'pick) t)) 163 (if gnus-pick-display-summary 'article 'pick) t))
157 (if gnus-pick-elegant-flow 164 (if gnus-pick-elegant-flow
158 (progn 165 (progn
159 (when (or catch-up gnus-mark-unpicked-articles-as-read) 166 (when (or catch-up gnus-mark-unpicked-articles-as-read)
160 (gnus-summary-catchup nil t)) 167 (gnus-summary-catchup nil t))
221 (interactive "e") 228 (interactive "e")
222 (mouse-minibuffer-check start-event) 229 (mouse-minibuffer-check start-event)
223 (let* ((echo-keystrokes 0) 230 (let* ((echo-keystrokes 0)
224 (start-posn (event-start start-event)) 231 (start-posn (event-start start-event))
225 (start-point (posn-point start-posn)) 232 (start-point (posn-point start-posn))
226 (start-line (1+ (count-lines 1 start-point))) 233 (start-line (1+ (count-lines (point-min) start-point)))
227 (start-window (posn-window start-posn)) 234 (start-window (posn-window start-posn))
228 (bounds (gnus-window-edges start-window)) 235 (bounds (gnus-window-edges start-window))
229 (top (nth 1 bounds)) 236 (top (nth 1 bounds))
230 (bottom (if (window-minibuffer-p start-window) 237 (bottom (if (window-minibuffer-p start-window)
231 (nth 3 bounds) 238 (nth 3 bounds)
233 (1- (nth 3 bounds)))) 240 (1- (nth 3 bounds))))
234 (click-count (1- (event-click-count start-event)))) 241 (click-count (1- (event-click-count start-event))))
235 (setq mouse-selection-click-count click-count) 242 (setq mouse-selection-click-count click-count)
236 (setq mouse-selection-click-count-buffer (current-buffer)) 243 (setq mouse-selection-click-count-buffer (current-buffer))
237 (mouse-set-point start-event) 244 (mouse-set-point start-event)
238 ;; In case the down click is in the middle of some intangible text, 245 ;; In case the down click is in the middle of some intangible text,
239 ;; use the end of that text, and put it in START-POINT. 246 ;; use the end of that text, and put it in START-POINT.
240 (when (< (point) start-point) 247 (when (< (point) start-point)
241 (goto-char start-point)) 248 (goto-char start-point))
242 (gnus-pick-article) 249 (gnus-pick-article)
243 (setq start-point (point)) 250 (setq start-point (point))
244 ;; end-of-range is used only in the single-click case. 251 ;; end-of-range is used only in the single-click case.
245 ;; It is the place where the drag has reached so far 252 ;; It is the place where the drag has reached so far
246 ;; (but not outside the window where the drag started). 253 ;; (but not outside the window where the drag started).
247 (let (event end end-point (end-of-range (point))) 254 (let (event end end-point (end-of-range (point)))
248 (track-mouse 255 (track-mouse
249 (while (progn 256 (while (progn
250 (setq event (cdr (gnus-read-event-char))) 257 (setq event (cdr (gnus-read-event-char)))
251 (or (mouse-movement-p event) 258 (or (mouse-movement-p event)
252 (eq (car-safe event) 'switch-frame))) 259 (eq (car-safe event) 'switch-frame)))
253 (if (eq (car-safe event) 'switch-frame) 260 (if (eq (car-safe event) 'switch-frame)
254 nil 261 nil
255 (setq end (event-end event) 262 (setq end (event-end event)
256 end-point (posn-point end)) 263 end-point (posn-point end))
257 264
258 (cond 265 (cond
259 ;; Are we moving within the original window? 266 ;; Are we moving within the original window?
260 ((and (eq (posn-window end) start-window) 267 ((and (eq (posn-window end) start-window)
261 (integer-or-marker-p end-point)) 268 (integer-or-marker-p end-point))
262 ;; Go to START-POINT first, so that when we move to END-POINT, 269 ;; Go to START-POINT first, so that when we move to END-POINT,
263 ;; if it's in the middle of intangible text, 270 ;; if it's in the middle of intangible text,
264 ;; point jumps in the direction away from START-POINT. 271 ;; point jumps in the direction away from START-POINT.
265 (goto-char start-point) 272 (goto-char start-point)
266 (goto-char end-point) 273 (goto-char end-point)
267 (gnus-pick-article) 274 (gnus-pick-article)
268 ;; In case the user moved his mouse really fast, pick 275 ;; In case the user moved his mouse really fast, pick
269 ;; articles on the line between this one and the last one. 276 ;; articles on the line between this one and the last one.
270 (let* ((this-line (1+ (count-lines 1 end-point))) 277 (let* ((this-line (1+ (count-lines (point-min) end-point)))
271 (min-line (min this-line start-line)) 278 (min-line (min this-line start-line))
272 (max-line (max this-line start-line))) 279 (max-line (max this-line start-line)))
273 (while (< min-line max-line) 280 ;; Why not use `forward-line'? --Stef
274 (goto-line min-line) 281 (while (< min-line max-line)
275 (gnus-pick-article) 282 (goto-line min-line)
276 (setq min-line (1+ min-line))) 283 (gnus-pick-article)
277 (setq start-line this-line)) 284 (setq min-line (1+ min-line)))
278 (when (zerop (% click-count 3)) 285 (setq start-line this-line))
279 (setq end-of-range (point)))) 286 (when (zerop (% click-count 3))
280 (t 287 (setq end-of-range (point))))
281 (let ((mouse-row (cdr (cdr (mouse-position))))) 288 (t
282 (cond 289 (let ((mouse-row (cdr (cdr (mouse-position)))))
283 ((null mouse-row)) 290 (cond
284 ((< mouse-row top) 291 ((null mouse-row))
285 (mouse-scroll-subr start-window (- mouse-row top))) 292 ((< mouse-row top)
286 ((>= mouse-row bottom) 293 (mouse-scroll-subr start-window (- mouse-row top)))
287 (mouse-scroll-subr start-window 294 ((>= mouse-row bottom)
288 (1+ (- mouse-row bottom))))))))))) 295 (mouse-scroll-subr start-window
296 (1+ (- mouse-row bottom)))))))))))
289 (when (consp event) 297 (when (consp event)
290 (let ((fun (key-binding (vector (car event))))) 298 (let ((fun (key-binding (vector (car event)))))
291 ;; Run the binding of the terminating up-event, if possible. 299 ;; Run the binding of the terminating up-event, if possible.
292 ;; In the case of a multiple click, it gives the wrong results, 300 ;; In the case of a multiple click, it gives the wrong results,
293 ;; because it would fail to set up a region. 301 ;; because it would fail to set up a region.
294 (when nil 302 (when nil
295 ;; (and (= (mod mouse-selection-click-count 3) 0) (fboundp fun)) 303 ;; (and (= (mod mouse-selection-click-count 3) 0) (fboundp fun))
296 ;; In this case, we can just let the up-event execute normally. 304 ;; In this case, we can just let the up-event execute normally.
297 (let ((end (event-end event))) 305 (let ((end (event-end event)))
298 ;; Set the position in the event before we replay it, 306 ;; Set the position in the event before we replay it,
299 ;; because otherwise it may have a position in the wrong 307 ;; because otherwise it may have a position in the wrong
300 ;; buffer. 308 ;; buffer.
301 (setcar (cdr end) end-of-range) 309 (setcar (cdr end) end-of-range)
302 ;; Delete the overlay before calling the function, 310 ;; Delete the overlay before calling the function,
303 ;; because delete-overlay increases buffer-modified-tick. 311 ;; because delete-overlay increases buffer-modified-tick.
304 (push event unread-command-events)))))))) 312 (push event unread-command-events))))))))
305 313
306 (defun gnus-pick-next-page () 314 (defun gnus-pick-next-page ()
307 "Go to the next page. If at the end of the buffer, start reading articles." 315 "Go to the next page. If at the end of the buffer, start reading articles."
308 (interactive) 316 (interactive)
331 "g" gnus-binary-show-article)) 339 "g" gnus-binary-show-article))
332 340
333 (defun gnus-binary-make-menu-bar () 341 (defun gnus-binary-make-menu-bar ()
334 (unless (boundp 'gnus-binary-menu) 342 (unless (boundp 'gnus-binary-menu)
335 (easy-menu-define 343 (easy-menu-define
336 gnus-binary-menu gnus-binary-mode-map "" 344 gnus-binary-menu gnus-binary-mode-map ""
337 '("Pick" 345 '("Pick"
338 ["Switch binary mode off" gnus-binary-mode t])))) 346 ["Switch binary mode off" gnus-binary-mode t]))))
339 347
340 (defun gnus-binary-mode (&optional arg) 348 (defun gnus-binary-mode (&optional arg)
341 "Minor mode for providing a binary group interface in Gnus summary buffers." 349 "Minor mode for providing a binary group interface in Gnus summary buffers."
342 (interactive "P") 350 (interactive "P")
343 (when (eq major-mode 'gnus-summary-mode) 351 (when (eq major-mode 'gnus-summary-mode)
359 (gnus-run-hooks 'gnus-binary-mode-hook)))) 367 (gnus-run-hooks 'gnus-binary-mode-hook))))
360 368
361 (defun gnus-binary-display-article (article &optional all-header) 369 (defun gnus-binary-display-article (article &optional all-header)
362 "Run ARTICLE through the binary decode functions." 370 "Run ARTICLE through the binary decode functions."
363 (when (gnus-summary-goto-subject article) 371 (when (gnus-summary-goto-subject article)
364 (let ((gnus-view-pseudos 'automatic)) 372 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic)))
365 (gnus-uu-decode-uu)))) 373 (gnus-uu-decode-uu))))
366 374
367 (defun gnus-binary-show-article (&optional arg) 375 (defun gnus-binary-show-article (&optional arg)
368 "Bypass the binary functions and show the article." 376 "Bypass the binary functions and show the article."
369 (interactive "P") 377 (interactive "P")
415 423
416 (defcustom gnus-tree-mode-hook nil 424 (defcustom gnus-tree-mode-hook nil
417 "*Hook run in tree mode buffers." 425 "*Hook run in tree mode buffers."
418 :type 'hook 426 :type 'hook
419 :group 'gnus-summary-tree) 427 :group 'gnus-summary-tree)
428
429 (when (featurep 'xemacs)
430 (add-hook 'gnus-tree-mode-hook 'gnus-xmas-tree-menu-add)
431 (add-hook 'gnus-tree-mode-hook 'gnus-xmas-switch-horizontal-scrollbar-off))
432
420 433
421 ;;; Internal variables. 434 ;;; Internal variables.
422 435
423 (defvar gnus-tree-line-format-alist 436 (defvar gnus-tree-line-format-alist
424 `((?n gnus-tmp-name ?s) 437 `((?n gnus-tmp-name ?s)
458 'undefined 'gnus-tree-read-summary-keys gnus-tree-mode-map)) 471 'undefined 'gnus-tree-read-summary-keys gnus-tree-mode-map))
459 472
460 (defun gnus-tree-make-menu-bar () 473 (defun gnus-tree-make-menu-bar ()
461 (unless (boundp 'gnus-tree-menu) 474 (unless (boundp 'gnus-tree-menu)
462 (easy-menu-define 475 (easy-menu-define
463 gnus-tree-menu gnus-tree-mode-map "" 476 gnus-tree-menu gnus-tree-mode-map ""
464 '("Tree" 477 '("Tree"
465 ["Select article" gnus-tree-select-article t])))) 478 ["Select article" gnus-tree-select-article t]))))
466 479
467 (defun gnus-tree-mode () 480 (defun gnus-tree-mode ()
468 "Major mode for displaying thread trees." 481 "Major mode for displaying thread trees."
469 (interactive) 482 (interactive)
470 (gnus-set-format 'tree-mode) 483 (gnus-set-format 'tree-mode)
541 (goto-char pos)))) 554 (goto-char pos))))
542 555
543 (defun gnus-tree-recenter () 556 (defun gnus-tree-recenter ()
544 "Center point in the tree window." 557 "Center point in the tree window."
545 (let ((selected (selected-window)) 558 (let ((selected (selected-window))
546 (tree-window (get-buffer-window gnus-tree-buffer t))) 559 (tree-window (gnus-get-buffer-window gnus-tree-buffer t)))
547 (when tree-window 560 (when tree-window
548 (select-window tree-window) 561 (select-window tree-window)
549 (when gnus-selected-tree-overlay 562 (when gnus-selected-tree-overlay
550 (goto-char (or (gnus-overlay-end gnus-selected-tree-overlay) 1))) 563 (goto-char (or (gnus-overlay-end gnus-selected-tree-overlay) 1)))
551 (let* ((top (cond ((< (window-height) 4) 0) 564 (let* ((top (cond ((< (window-height) 4) 0)
553 (t 2))) 566 (t 2)))
554 (height (1- (window-height))) 567 (height (1- (window-height)))
555 (bottom (save-excursion (goto-char (point-max)) 568 (bottom (save-excursion (goto-char (point-max))
556 (forward-line (- height)) 569 (forward-line (- height))
557 (point)))) 570 (point))))
558 ;; Set the window start to either `bottom', which is the biggest 571 ;; Set the window start to either `bottom', which is the biggest
559 ;; possible valid number, or the second line from the top, 572 ;; possible valid number, or the second line from the top,
560 ;; whichever is the least. 573 ;; whichever is the least.
561 (set-window-start 574 (set-window-start
562 tree-window (min bottom (save-excursion 575 tree-window (min bottom (save-excursion
563 (forward-line (- top)) (point))))) 576 (forward-line (- top)) (point)))))
654 (save-excursion 667 (save-excursion
655 (set-buffer gnus-summary-buffer) 668 (set-buffer gnus-summary-buffer)
656 (let* ((score (or (cdr (assq article gnus-newsgroup-scored)) 669 (let* ((score (or (cdr (assq article gnus-newsgroup-scored))
657 gnus-summary-default-score 0)) 670 gnus-summary-default-score 0))
658 (default gnus-summary-default-score) 671 (default gnus-summary-default-score)
672 (default-high gnus-summary-default-high-score)
673 (default-low gnus-summary-default-low-score)
674 (uncached (memq article gnus-newsgroup-undownloaded))
675 (downloaded (not uncached))
659 (mark (or (gnus-summary-article-mark article) gnus-unread-mark))) 676 (mark (or (gnus-summary-article-mark article) gnus-unread-mark)))
660 ;; Eval the cars of the lists until we find a match. 677 ;; Eval the cars of the lists until we find a match.
661 (while (and list 678 (while (and list
662 (not (eval (caar list)))) 679 (not (eval (caar list))))
663 (setq list (cdr list))))) 680 (setq list (cdr list)))))
684 (gnus-set-mode-line 'tree) 701 (gnus-set-mode-line 'tree)
685 (goto-char (point-min)) 702 (goto-char (point-min))
686 (gnus-tree-minimize) 703 (gnus-tree-minimize)
687 (gnus-tree-recenter) 704 (gnus-tree-recenter)
688 (let ((selected (selected-window))) 705 (let ((selected (selected-window)))
689 (when (get-buffer-window (set-buffer gnus-tree-buffer) t) 706 (when (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t)
690 (select-window (get-buffer-window (set-buffer gnus-tree-buffer) t)) 707 (select-window (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t))
691 (gnus-horizontal-recenter) 708 (gnus-horizontal-recenter)
692 (select-window selected)))))) 709 (select-window selected))))))
693 710
694 (defun gnus-generate-horizontal-tree (thread level &optional dummyp adopted) 711 (defun gnus-generate-horizontal-tree (thread level &optional dummyp adopted)
695 "Generate a horizontal tree." 712 "Generate a horizontal tree."
769 (delete-char -1) 786 (delete-char -1)
770 (insert (cadr gnus-tree-parent-child-edges)) 787 (insert (cadr gnus-tree-parent-child-edges))
771 (setq beg (point)) 788 (setq beg (point))
772 (forward-char -1) 789 (forward-char -1)
773 ;; Draw "-" lines leftwards. 790 ;; Draw "-" lines leftwards.
774 (while (and (> (point) 1) 791 (while (and (not (bobp))
775 (eq (char-after (1- (point))) ? )) 792 (eq (char-after (1- (point))) ? ))
776 (delete-char -1) 793 (delete-char -1)
777 (insert (car gnus-tree-parent-child-edges)) 794 (insert (car gnus-tree-parent-child-edges))
778 (forward-char -1)) 795 (forward-char -1))
779 (goto-char beg) 796 (goto-char beg)
823 (gnus-get-tree-buffer)) 840 (gnus-get-tree-buffer))
824 841
825 (defun gnus-tree-close (group) 842 (defun gnus-tree-close (group)
826 (gnus-kill-buffer gnus-tree-buffer)) 843 (gnus-kill-buffer gnus-tree-buffer))
827 844
845 (defun gnus-tree-perhaps-minimize ()
846 (when (and gnus-tree-minimize-window
847 (get-buffer gnus-tree-buffer))
848 (save-excursion
849 (set-buffer gnus-tree-buffer)
850 (gnus-tree-minimize))))
851
828 (defun gnus-highlight-selected-tree (article) 852 (defun gnus-highlight-selected-tree (article)
829 "Highlight the selected article in the tree." 853 "Highlight the selected article in the tree."
830 (let ((buf (current-buffer)) 854 (let ((buf (current-buffer))
831 region) 855 region)
832 (set-buffer gnus-tree-buffer) 856 (set-buffer gnus-tree-buffer)
833 (when (setq region (gnus-tree-article-region article)) 857 (when (setq region (gnus-tree-article-region article))
834 (when (or (not gnus-selected-tree-overlay) 858 (when (or (not gnus-selected-tree-overlay)
835 (gnus-extent-detached-p gnus-selected-tree-overlay)) 859 (gnus-extent-detached-p gnus-selected-tree-overlay))
836 ;; Create a new overlay. 860 ;; Create a new overlay.
837 (gnus-overlay-put 861 (gnus-overlay-put
838 (setq gnus-selected-tree-overlay (gnus-make-overlay 1 2)) 862 (setq gnus-selected-tree-overlay
863 (gnus-make-overlay (point-min) (1+ (point-min))))
839 'face gnus-selected-tree-face)) 864 'face gnus-selected-tree-face))
840 ;; Move the overlay to the article. 865 ;; Move the overlay to the article.
841 (gnus-move-overlay 866 (gnus-move-overlay
842 gnus-selected-tree-overlay (goto-char (car region)) (cdr region)) 867 gnus-selected-tree-overlay (goto-char (car region)) (cdr region))
843 (gnus-tree-minimize) 868 (gnus-tree-minimize)
844 (gnus-tree-recenter) 869 (gnus-tree-recenter)
845 (let ((selected (selected-window))) 870 (let ((selected (selected-window)))
846 (when (get-buffer-window (set-buffer gnus-tree-buffer) t) 871 (when (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t)
847 (select-window (get-buffer-window (set-buffer gnus-tree-buffer) t)) 872 (select-window (gnus-get-buffer-window (set-buffer gnus-tree-buffer) t))
848 (gnus-horizontal-recenter) 873 (gnus-horizontal-recenter)
849 (select-window selected)))) 874 (select-window selected))))
850 ;; If we remove this save-excursion, it updates the wrong mode lines?!? 875 ;; If we remove this save-excursion, it updates the wrong mode lines?!?
851 (save-excursion 876 (save-excursion
852 (set-buffer gnus-tree-buffer) 877 (set-buffer gnus-tree-buffer)
853 (gnus-set-mode-line 'tree)) 878 (gnus-set-mode-line 'tree))
854 (set-buffer buf))) 879 (set-buffer buf)))
855 880
858 (set-buffer (gnus-get-tree-buffer)) 883 (set-buffer (gnus-get-tree-buffer))
859 (let (region) 884 (let (region)
860 (when (setq region (gnus-tree-article-region article)) 885 (when (setq region (gnus-tree-article-region article))
861 (gnus-put-text-property (car region) (cdr region) 'face face) 886 (gnus-put-text-property (car region) (cdr region) 'face face)
862 (set-window-point 887 (set-window-point
863 (get-buffer-window (current-buffer) t) (cdr region)))))) 888 (gnus-get-buffer-window (current-buffer) t) (cdr region))))))
864 889
865 ;;; 890 ;;;
866 ;;; gnus-carpal 891 ;;; gnus-carpal
867 ;;; 892 ;;;
868 893
884 ("killed" . gnus-group-list-killed) 909 ("killed" . gnus-group-list-killed)
885 ("zombies" . gnus-group-list-zombies) 910 ("zombies" . gnus-group-list-zombies)
886 ("matching" . gnus-group-list-matching) 911 ("matching" . gnus-group-list-matching)
887 ("post" . gnus-group-post-news) 912 ("post" . gnus-group-post-news)
888 ("mail" . gnus-group-mail) 913 ("mail" . gnus-group-mail)
914 ("local" . (lambda () (interactive) (gnus-group-news 0)))
889 ("rescan" . gnus-group-get-new-news) 915 ("rescan" . gnus-group-get-new-news)
890 ("browse-foreign" . gnus-group-browse-foreign) 916 ("browse-foreign" . gnus-group-browse-foreign)
891 ("exit" . gnus-group-exit))) 917 ("exit" . gnus-group-exit)))
892 918
893 (defvar gnus-carpal-summary-buffer-buttons 919 (defvar gnus-carpal-summary-buffer-buttons
914 "threads" 940 "threads"
915 ("lower" . gnus-summary-lower-thread) 941 ("lower" . gnus-summary-lower-thread)
916 ("kill" . gnus-summary-kill-thread) 942 ("kill" . gnus-summary-kill-thread)
917 "post" 943 "post"
918 ("post" . gnus-summary-post-news) 944 ("post" . gnus-summary-post-news)
919 ("mail" . gnus-summary-mail) 945 ("local" . gnus-summary-news-other-window)
946 ("mail" . gnus-summary-mail-other-window)
920 ("followup" . gnus-summary-followup-with-original) 947 ("followup" . gnus-summary-followup-with-original)
921 ("reply" . gnus-summary-reply-with-original) 948 ("reply" . gnus-summary-reply-with-original)
922 ("cancel" . gnus-summary-cancel-article) 949 ("cancel" . gnus-summary-cancel-article)
923 "misc" 950 "misc"
924 ("exit" . gnus-summary-exit) 951 ("exit" . gnus-summary-exit)
1035 ;;; Allow redefinition of functions. 1062 ;;; Allow redefinition of functions.
1036 (gnus-ems-redefine) 1063 (gnus-ems-redefine)
1037 1064
1038 (provide 'gnus-salt) 1065 (provide 'gnus-salt)
1039 1066
1040 ;;; arch-tag: 35449164-77b3-4398-bcbd-a2e3e998f810 1067 ;; arch-tag: 35449164-77b3-4398-bcbd-a2e3e998f810
1041 ;;; gnus-salt.el ends here 1068 ;;; gnus-salt.el ends here