Mercurial > hg > xemacs-beta
comparison lisp/gnus/gnus-salt.el @ 108:360340f9fd5f r20-1b6
Import from CVS: tag r20-1b6
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:18:39 +0200 |
parents | 0d2f883870bc |
children | 25f70ba0133c |
comparison
equal
deleted
inserted
replaced
107:523141596bda | 108:360340f9fd5f |
---|---|
131 "Make Message do the right thing on exit." | 131 "Make Message do the right thing on exit." |
132 (when (and (gnus-buffer-live-p gnus-summary-buffer) | 132 (when (and (gnus-buffer-live-p gnus-summary-buffer) |
133 (save-excursion | 133 (save-excursion |
134 (set-buffer gnus-summary-buffer) | 134 (set-buffer gnus-summary-buffer) |
135 gnus-pick-mode)) | 135 gnus-pick-mode)) |
136 (message-add-action | 136 (message-add-action |
137 '(gnus-configure-windows 'pick t) 'send 'exit 'postpone 'kill))) | 137 '(gnus-configure-windows 'pick t) 'send 'exit 'postpone 'kill))) |
138 | 138 |
139 (defvar gnus-pick-line-number 1) | 139 (defvar gnus-pick-line-number 1) |
140 (defun gnus-pick-line-number () | 140 (defun gnus-pick-line-number () |
141 "Return the current line number." | 141 "Return the current line number." |
151 (progn | 151 (progn |
152 (gnus-summary-limit-to-articles nil) | 152 (gnus-summary-limit-to-articles nil) |
153 (when (or catch-up gnus-mark-unpicked-articles-as-read) | 153 (when (or catch-up gnus-mark-unpicked-articles-as-read) |
154 (gnus-summary-limit-mark-excluded-as-read)) | 154 (gnus-summary-limit-mark-excluded-as-read)) |
155 (gnus-summary-first-article) | 155 (gnus-summary-first-article) |
156 (gnus-configure-windows | 156 (gnus-configure-windows |
157 (if gnus-pick-display-summary 'article 'pick) t)) | 157 (if gnus-pick-display-summary 'article 'pick) t)) |
158 (if gnus-pick-elegant-flow | 158 (if gnus-pick-elegant-flow |
159 (progn | 159 (progn |
160 (when (or catch-up gnus-mark-unpicked-articles-as-read) | 160 (when (or catch-up gnus-mark-unpicked-articles-as-read) |
161 (gnus-summary-limit-mark-excluded-as-read)) | 161 (gnus-summary-limit-mark-excluded-as-read)) |
313 (defun gnus-binary-mode (&optional arg) | 313 (defun gnus-binary-mode (&optional arg) |
314 "Minor mode for providing a binary group interface in Gnus summary buffers." | 314 "Minor mode for providing a binary group interface in Gnus summary buffers." |
315 (interactive "P") | 315 (interactive "P") |
316 (when (eq major-mode 'gnus-summary-mode) | 316 (when (eq major-mode 'gnus-summary-mode) |
317 (make-local-variable 'gnus-binary-mode) | 317 (make-local-variable 'gnus-binary-mode) |
318 (setq gnus-binary-mode | 318 (setq gnus-binary-mode |
319 (if (null arg) (not gnus-binary-mode) | 319 (if (null arg) (not gnus-binary-mode) |
320 (> (prefix-numeric-value arg) 0))) | 320 (> (prefix-numeric-value arg) 0))) |
321 (when gnus-binary-mode | 321 (when gnus-binary-mode |
322 ;; Make sure that we don't select any articles upon group entry. | 322 ;; Make sure that we don't select any articles upon group entry. |
323 (make-local-variable 'gnus-auto-select-first) | 323 (make-local-variable 'gnus-auto-select-first) |
379 (defvar gnus-tree-mode-hook nil | 379 (defvar gnus-tree-mode-hook nil |
380 "*Hook run in tree mode buffers.") | 380 "*Hook run in tree mode buffers.") |
381 | 381 |
382 ;;; Internal variables. | 382 ;;; Internal variables. |
383 | 383 |
384 (defvar gnus-tree-line-format-alist | 384 (defvar gnus-tree-line-format-alist |
385 `((?n gnus-tmp-name ?s) | 385 `((?n gnus-tmp-name ?s) |
386 (?f gnus-tmp-from ?s) | 386 (?f gnus-tmp-from ?s) |
387 (?N gnus-tmp-number ?d) | 387 (?N gnus-tmp-number ?d) |
388 (?\[ gnus-tmp-open-bracket ?c) | 388 (?\[ gnus-tmp-open-bracket ?c) |
389 (?\] gnus-tmp-close-bracket ?c) | 389 (?\] gnus-tmp-close-bracket ?c) |
424 ["Select article" gnus-tree-select-article t])))) | 424 ["Select article" gnus-tree-select-article t])))) |
425 | 425 |
426 (defun gnus-tree-mode () | 426 (defun gnus-tree-mode () |
427 "Major mode for displaying thread trees." | 427 "Major mode for displaying thread trees." |
428 (interactive) | 428 (interactive) |
429 (setq gnus-tree-mode-line-format-spec | 429 (setq gnus-tree-mode-line-format-spec |
430 (gnus-parse-format gnus-tree-mode-line-format | 430 (gnus-parse-format gnus-tree-mode-line-format |
431 gnus-summary-mode-line-format-alist)) | 431 gnus-summary-mode-line-format-alist)) |
432 (setq gnus-tree-line-format-spec | 432 (setq gnus-tree-line-format-spec |
433 (gnus-parse-format gnus-tree-line-format | 433 (gnus-parse-format gnus-tree-line-format |
434 gnus-tree-line-format-alist t)) | 434 gnus-tree-line-format-alist t)) |
435 (when (gnus-visual-p 'tree-menu 'menu) | 435 (when (gnus-visual-p 'tree-menu 'menu) |
436 (gnus-tree-make-menu-bar)) | 436 (gnus-tree-make-menu-bar)) |
437 (kill-all-local-variables) | 437 (kill-all-local-variables) |
438 (gnus-simplify-mode-line) | 438 (gnus-simplify-mode-line) |
507 (point)))) | 507 (point)))) |
508 ;; Set the window start to either `bottom', which is the biggest | 508 ;; Set the window start to either `bottom', which is the biggest |
509 ;; possible valid number, or the second line from the top, | 509 ;; possible valid number, or the second line from the top, |
510 ;; whichever is the least. | 510 ;; whichever is the least. |
511 (set-window-start | 511 (set-window-start |
512 tree-window (min bottom (save-excursion | 512 tree-window (min bottom (save-excursion |
513 (forward-line (- top)) (point))))) | 513 (forward-line (- top)) (point))))) |
514 (select-window selected)))) | 514 (select-window selected)))) |
515 | 515 |
516 (defun gnus-get-tree-buffer () | 516 (defun gnus-get-tree-buffer () |
517 "Return the tree buffer properly initialized." | 517 "Return the tree buffer properly initialized." |
526 (when (and gnus-tree-minimize-window | 526 (when (and gnus-tree-minimize-window |
527 (not (one-window-p))) | 527 (not (one-window-p))) |
528 (let ((windows 0) | 528 (let ((windows 0) |
529 tot-win-height) | 529 tot-win-height) |
530 (walk-windows (lambda (window) (incf windows))) | 530 (walk-windows (lambda (window) (incf windows))) |
531 (setq tot-win-height | 531 (setq tot-win-height |
532 (- (frame-height) | 532 (- (frame-height) |
533 (* window-min-height (1- windows)) | 533 (* window-min-height (1- windows)) |
534 2)) | 534 2)) |
535 (let* ((window-min-height 2) | 535 (let* ((window-min-height 2) |
536 (height (count-lines (point-min) (point-max))) | 536 (height (count-lines (point-min) (point-max))) |
611 ;; Eval the cars of the lists until we find a match. | 611 ;; Eval the cars of the lists until we find a match. |
612 (while (and list | 612 (while (and list |
613 (not (eval (caar list)))) | 613 (not (eval (caar list)))) |
614 (setq list (cdr list))))) | 614 (setq list (cdr list))))) |
615 (unless (eq (setq face (cdar list)) (get-text-property beg 'face)) | 615 (unless (eq (setq face (cdar list)) (get-text-property beg 'face)) |
616 (gnus-put-text-property | 616 (gnus-put-text-property |
617 beg end 'face | 617 beg end 'face |
618 (if (boundp face) (symbol-value face) face))))) | 618 (if (boundp face) (symbol-value face) face))))) |
619 | 619 |
620 (defun gnus-tree-indent (level) | 620 (defun gnus-tree-indent (level) |
621 (insert (make-string (1- (* (1+ gnus-tree-node-length) level)) ? ))) | 621 (insert (make-string (1- (* (1+ gnus-tree-node-length) level)) ? ))) |
622 | 622 |
755 (vectorp (gnus-summary-article-header article)))) | 755 (vectorp (gnus-summary-article-header article)))) |
756 (save-excursion | 756 (save-excursion |
757 (let ((top (save-excursion | 757 (let ((top (save-excursion |
758 (set-buffer gnus-summary-buffer) | 758 (set-buffer gnus-summary-buffer) |
759 (gnus-cut-thread | 759 (gnus-cut-thread |
760 (gnus-remove-thread | 760 (gnus-remove-thread |
761 (mail-header-id | 761 (mail-header-id |
762 (gnus-summary-article-header article)) | 762 (gnus-summary-article-header article)) |
763 t)))) | 763 t)))) |
764 (gnus-tmp-limit gnus-newsgroup-limit) | 764 (gnus-tmp-limit gnus-newsgroup-limit) |
765 (gnus-tmp-sparse gnus-newsgroup-sparse)) | 765 (gnus-tmp-sparse gnus-newsgroup-sparse)) |
766 (when (or force | 766 (when (or force |
786 ;; Create a new overlay. | 786 ;; Create a new overlay. |
787 (gnus-overlay-put | 787 (gnus-overlay-put |
788 (setq gnus-selected-tree-overlay (gnus-make-overlay 1 2)) | 788 (setq gnus-selected-tree-overlay (gnus-make-overlay 1 2)) |
789 'face gnus-selected-tree-face)) | 789 'face gnus-selected-tree-face)) |
790 ;; Move the overlay to the article. | 790 ;; Move the overlay to the article. |
791 (gnus-move-overlay | 791 (gnus-move-overlay |
792 gnus-selected-tree-overlay (goto-char (car region)) (cdr region)) | 792 gnus-selected-tree-overlay (goto-char (car region)) (cdr region)) |
793 (gnus-tree-minimize) | 793 (gnus-tree-minimize) |
794 (gnus-tree-recenter) | 794 (gnus-tree-recenter) |
795 (let ((selected (selected-window))) | 795 (let ((selected (selected-window))) |
796 (when (get-buffer-window (set-buffer gnus-tree-buffer) t) | 796 (when (get-buffer-window (set-buffer gnus-tree-buffer) t) |
807 (save-excursion | 807 (save-excursion |
808 (set-buffer (gnus-get-tree-buffer)) | 808 (set-buffer (gnus-get-tree-buffer)) |
809 (let (region) | 809 (let (region) |
810 (when (setq region (gnus-tree-article-region article)) | 810 (when (setq region (gnus-tree-article-region article)) |
811 (gnus-put-text-property (car region) (cdr region) 'face face) | 811 (gnus-put-text-property (car region) (cdr region) 'face face) |
812 (set-window-point | 812 (set-window-point |
813 (get-buffer-window (current-buffer) t) (cdr region)))))) | 813 (get-buffer-window (current-buffer) t) (cdr region)))))) |
814 | 814 |
815 ;;; | 815 ;;; |
816 ;;; gnus-carpal | 816 ;;; gnus-carpal |
817 ;;; | 817 ;;; |
839 ("rescan" . gnus-group-get-new-news) | 839 ("rescan" . gnus-group-get-new-news) |
840 ("browse-foreign" . gnus-group-browse-foreign) | 840 ("browse-foreign" . gnus-group-browse-foreign) |
841 ("exit" . gnus-group-exit))) | 841 ("exit" . gnus-group-exit))) |
842 | 842 |
843 (defvar gnus-carpal-summary-buffer-buttons | 843 (defvar gnus-carpal-summary-buffer-buttons |
844 '("mark" | 844 '("mark" |
845 ("read" . gnus-summary-mark-as-read-forward) | 845 ("read" . gnus-summary-mark-as-read-forward) |
846 ("tick" . gnus-summary-tick-article-forward) | 846 ("tick" . gnus-summary-tick-article-forward) |
847 ("clear" . gnus-summary-clear-mark-forward) | 847 ("clear" . gnus-summary-clear-mark-forward) |
848 ("expirable" . gnus-summary-mark-as-expirable) | 848 ("expirable" . gnus-summary-mark-as-expirable) |
849 "move" | 849 "move" |
872 ("cancel" . gnus-summary-cancel-article) | 872 ("cancel" . gnus-summary-cancel-article) |
873 "misc" | 873 "misc" |
874 ("exit" . gnus-summary-exit) | 874 ("exit" . gnus-summary-exit) |
875 ("fed-up" . gnus-summary-catchup-and-goto-next-group))) | 875 ("fed-up" . gnus-summary-catchup-and-goto-next-group))) |
876 | 876 |
877 (defvar gnus-carpal-server-buffer-buttons | 877 (defvar gnus-carpal-server-buffer-buttons |
878 '(("add" . gnus-server-add-server) | 878 '(("add" . gnus-server-add-server) |
879 ("browse" . gnus-server-browse-server) | 879 ("browse" . gnus-server-browse-server) |
880 ("list" . gnus-server-list-servers) | 880 ("list" . gnus-server-list-servers) |
881 ("kill" . gnus-server-kill-server) | 881 ("kill" . gnus-server-kill-server) |
882 ("yank" . gnus-server-yank-server) | 882 ("yank" . gnus-server-yank-server) |
939 (if (get-buffer buffer) | 939 (if (get-buffer buffer) |
940 () | 940 () |
941 (save-excursion | 941 (save-excursion |
942 (set-buffer (get-buffer-create buffer)) | 942 (set-buffer (get-buffer-create buffer)) |
943 (gnus-carpal-mode) | 943 (gnus-carpal-mode) |
944 (setq gnus-carpal-attached-buffer | 944 (setq gnus-carpal-attached-buffer |
945 (intern (format "gnus-%s-buffer" type))) | 945 (intern (format "gnus-%s-buffer" type))) |
946 (gnus-add-current-to-buffer-list) | 946 (gnus-add-current-to-buffer-list) |
947 (let ((buttons (symbol-value | 947 (let ((buttons (symbol-value |
948 (intern (format "gnus-carpal-%s-buffer-buttons" | 948 (intern (format "gnus-carpal-%s-buffer-buttons" |
949 type)))) | 949 type)))) |
950 (buffer-read-only nil) | 950 (buffer-read-only nil) |
951 button) | 951 button) |
952 (while buttons | 952 (while buttons |