aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-11-08 17:36:41 +0000
committerDave Love2000-11-08 17:36:41 +0000
commit60bd558946caff11d85a82500a88951725d5d880 (patch)
tree5ef142f98a2de1d4bfa6a9fcaec73c1aca3e22c1
parent939ac10c1e10e1548f23d0e813cb19a284d861e8 (diff)
downloademacs-60bd558946caff11d85a82500a88951725d5d880.tar.gz
emacs-60bd558946caff11d85a82500a88951725d5d880.zip
Put some defvars in eval-when-compile.
(gnus-summary-mode-hook): Add :options. (gnus-summary-make-menu-bar): Add some :help, used by tool bar. (gnus-summary-tool-bar-map): New variable. (gnus-summary-make-tool-bar): New function. (gnus-summary-mode): Put kill-all-local-variables first.
-rw-r--r--lisp/gnus/gnus-sum.el98
1 files changed, 78 insertions, 20 deletions
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index d712dc64f53..2d9b6eafe8c 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -3,7 +3,6 @@
3;; Free Software Foundation, Inc. 3;; Free Software Foundation, Inc.
4 4
5;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> 5;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6;; Maintainer: bugs@gnus.org
7;; Keywords: news 6;; Keywords: news
8 7
9;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
@@ -635,6 +634,7 @@ This variable is local to the summary buffers."
635(defcustom gnus-summary-mode-hook nil 634(defcustom gnus-summary-mode-hook nil
636 "*A hook for Gnus summary mode. 635 "*A hook for Gnus summary mode.
637This hook is run before any variables are set in the summary buffer." 636This hook is run before any variables are set in the summary buffer."
637 :options '(turn-on-gnus-mailing-list-mode)
638 :group 'gnus-summary-various 638 :group 'gnus-summary-various
639 :type 'hook) 639 :type 'hook)
640 640
@@ -1133,7 +1133,7 @@ the type of the variable (string, integer, character, etc).")
1133 "Variables that are buffer-local to the summary buffers.") 1133 "Variables that are buffer-local to the summary buffers.")
1134 1134
1135;; Byte-compiler warning. 1135;; Byte-compiler warning.
1136(defvar gnus-article-mode-map) 1136(eval-when-compile (defvar gnus-article-mode-map))
1137 1137
1138;; MIME stuff. 1138;; MIME stuff.
1139 1139
@@ -1735,7 +1735,8 @@ increase the score of each group you read."
1735 ["Show X-Face" gnus-article-display-x-face t] 1735 ["Show X-Face" gnus-article-display-x-face t]
1736 ["Quoted-Printable" gnus-article-de-quoted-unreadable t] 1736 ["Quoted-Printable" gnus-article-de-quoted-unreadable t]
1737 ["Base64" gnus-article-de-base64-unreadable t] 1737 ["Base64" gnus-article-de-base64-unreadable t]
1738 ["Rot 13" gnus-summary-caesar-message t] 1738 ["Rot 13" gnus-summary-caesar-message
1739 :help "\"Caesar rotate\" article by 13"]
1739 ["Unix pipe" gnus-summary-pipe-message t] 1740 ["Unix pipe" gnus-summary-pipe-message t]
1740 ["Add buttons" gnus-article-add-buttons t] 1741 ["Add buttons" gnus-article-add-buttons t]
1741 ["Add buttons to head" gnus-article-add-buttons-to-head t] 1742 ["Add buttons to head" gnus-article-add-buttons-to-head t]
@@ -1745,8 +1746,10 @@ increase the score of each group you read."
1745 ["Html" gnus-article-wash-html t] 1746 ["Html" gnus-article-wash-html t]
1746 ["HZ" gnus-article-decode-HZ t]) 1747 ["HZ" gnus-article-decode-HZ t])
1747 ("Output" 1748 ("Output"
1748 ["Save in default format" gnus-summary-save-article t] 1749 ["Save in default format" gnus-summary-save-article
1749 ["Save in file" gnus-summary-save-article-file t] 1750 :help "Save article using default method"]
1751 ["Save in file" gnus-summary-save-article-file
1752 :help "Save article in file"]
1750 ["Save in Unix mail format" gnus-summary-save-article-mail t] 1753 ["Save in Unix mail format" gnus-summary-save-article-mail t]
1751 ["Save in MH folder" gnus-summary-save-article-folder t] 1754 ["Save in MH folder" gnus-summary-save-article-folder t]
1752 ["Save in VM folder" gnus-summary-save-article-vm t] 1755 ["Save in VM folder" gnus-summary-save-article-vm t]
@@ -1777,7 +1780,8 @@ increase the score of each group you read."
1777 (gnus-check-backend-function 1780 (gnus-check-backend-function
1778 'request-expire-articles gnus-newsgroup-name)]) 1781 'request-expire-articles gnus-newsgroup-name)])
1779 ("Extract" 1782 ("Extract"
1780 ["Uudecode" gnus-uu-decode-uu t] 1783 ["Uudecode" gnus-uu-decode-uu
1784 :help "Decode uuencoded article(s)"]
1781 ["Uudecode and save" gnus-uu-decode-uu-and-save t] 1785 ["Uudecode and save" gnus-uu-decode-uu-and-save t]
1782 ["Unshar" gnus-uu-decode-unshar t] 1786 ["Unshar" gnus-uu-decode-unshar t]
1783 ["Unshar and save" gnus-uu-decode-unshar-and-save t] 1787 ["Unshar and save" gnus-uu-decode-unshar-and-save t]
@@ -1827,15 +1831,20 @@ increase the score of each group you read."
1827 (easy-menu-define 1831 (easy-menu-define
1828 gnus-summary-post-menu gnus-summary-mode-map "" 1832 gnus-summary-post-menu gnus-summary-mode-map ""
1829 '("Post" 1833 '("Post"
1830 ["Post an article" gnus-summary-post-news t] 1834 ["Post an article" gnus-summary-post-news
1831 ["Followup" gnus-summary-followup t] 1835 :help "Post an article"]
1832 ["Followup and yank" gnus-summary-followup-with-original t] 1836 ["Followup" gnus-summary-followup
1837 :help "Post followup to this article"]
1838 ["Followup and yank" gnus-summary-followup-with-original
1839 :help "Post followup to this article, quoting its contents"]
1833 ["Supersede article" gnus-summary-supersede-article t] 1840 ["Supersede article" gnus-summary-supersede-article t]
1834 ["Cancel article" gnus-summary-cancel-article t] 1841 ["Cancel article" gnus-summary-cancel-article
1842 :help "Cancel an article you posted"]
1835 ["Reply" gnus-summary-reply t] 1843 ["Reply" gnus-summary-reply t]
1836 ["Reply and yank" gnus-summary-reply-with-original t] 1844 ["Reply and yank" gnus-summary-reply-with-original t]
1837 ["Wide reply" gnus-summary-wide-reply t] 1845 ["Wide reply" gnus-summary-wide-reply t]
1838 ["Wide reply and yank" gnus-summary-wide-reply-with-original t] 1846 ["Wide reply and yank" gnus-summary-wide-reply-with-original
1847 :help "Mail a reply, quoting this article"]
1839 ["Mail forward" gnus-summary-mail-forward t] 1848 ["Mail forward" gnus-summary-mail-forward t]
1840 ["Post forward" gnus-summary-post-forward t] 1849 ["Post forward" gnus-summary-post-forward t]
1841 ["Digest and mail" gnus-uu-digest-mail-forward t] 1850 ["Digest and mail" gnus-uu-digest-mail-forward t]
@@ -1843,7 +1852,8 @@ increase the score of each group you read."
1843 ["Resend message" gnus-summary-resend-message t] 1852 ["Resend message" gnus-summary-resend-message t]
1844 ["Send bounced mail" gnus-summary-resend-bounced-mail t] 1853 ["Send bounced mail" gnus-summary-resend-bounced-mail t]
1845 ["Send a mail" gnus-summary-mail-other-window t] 1854 ["Send a mail" gnus-summary-mail-other-window t]
1846 ["Uuencode and post" gnus-uu-post-news t] 1855 ["Uuencode and post" gnus-uu-post-news
1856 :help "Post a uuencoded article"]
1847 ["Followup via news" gnus-summary-followup-to-mail t] 1857 ["Followup via news" gnus-summary-followup-to-mail t]
1848 ["Followup via news and yank" 1858 ["Followup via news and yank"
1849 gnus-summary-followup-to-mail-with-original t] 1859 gnus-summary-followup-to-mail-with-original t]
@@ -1860,7 +1870,8 @@ increase the score of each group you read."
1860 ["Mark same subject and select" 1870 ["Mark same subject and select"
1861 gnus-summary-kill-same-subject-and-select t] 1871 gnus-summary-kill-same-subject-and-select t]
1862 ["Mark same subject" gnus-summary-kill-same-subject t] 1872 ["Mark same subject" gnus-summary-kill-same-subject t]
1863 ["Catchup" gnus-summary-catchup t] 1873 ["Catchup" gnus-summary-catchup
1874 :help "Mark unread articles in this group as read"]
1864 ["Catchup all" gnus-summary-catchup-all t] 1875 ["Catchup all" gnus-summary-catchup-all t]
1865 ["Catchup to here" gnus-summary-catchup-to-here t] 1876 ["Catchup to here" gnus-summary-catchup-to-here t]
1866 ["Catchup region" gnus-summary-mark-region-as-read t] 1877 ["Catchup region" gnus-summary-mark-region-as-read t]
@@ -1910,8 +1921,10 @@ increase the score of each group you read."
1910 gnus-newsgroup-process-stack] 1921 gnus-newsgroup-process-stack]
1911 ["Save" gnus-summary-save-process-mark t])) 1922 ["Save" gnus-summary-save-process-mark t]))
1912 ("Scroll article" 1923 ("Scroll article"
1913 ["Page forward" gnus-summary-next-page t] 1924 ["Page forward" gnus-summary-next-page
1914 ["Page backward" gnus-summary-prev-page t] 1925 :help "Show next page of article"]
1926 ["Page backward" gnus-summary-prev-page
1927 :help "Show previous page of article"]
1915 ["Line forward" gnus-summary-scroll-up t]) 1928 ["Line forward" gnus-summary-scroll-up t])
1916 ("Move" 1929 ("Move"
1917 ["Next unread article" gnus-summary-next-unread-article t] 1930 ["Next unread article" gnus-summary-next-unread-article t]
@@ -1962,10 +1975,12 @@ increase the score of each group you read."
1962 ["Customize group parameters" gnus-summary-customize-parameters t] 1975 ["Customize group parameters" gnus-summary-customize-parameters t]
1963 ["Send a bug report" gnus-bug t] 1976 ["Send a bug report" gnus-bug t]
1964 ("Exit" 1977 ("Exit"
1965 ["Catchup and exit" gnus-summary-catchup-and-exit t] 1978 ["Catchup and exit" gnus-summary-catchup-and-exit
1979 :help "Mark unread articles in this group as read, then exit"]
1966 ["Catchup all and exit" gnus-summary-catchup-all-and-exit t] 1980 ["Catchup all and exit" gnus-summary-catchup-all-and-exit t]
1967 ["Catchup and goto next" gnus-summary-catchup-and-goto-next-group t] 1981 ["Catchup and goto next" gnus-summary-catchup-and-goto-next-group t]
1968 ["Exit group" gnus-summary-exit t] 1982 ["Exit group" gnus-summary-exit
1983 :help "Exit current group, return to group selection mode"]
1969 ["Exit group without updating" gnus-summary-exit-no-update t] 1984 ["Exit group without updating" gnus-summary-exit-no-update t]
1970 ["Exit and goto next group" gnus-summary-next-group t] 1985 ["Exit and goto next group" gnus-summary-next-group t]
1971 ["Exit and goto prev group" gnus-summary-prev-group t] 1986 ["Exit and goto prev group" gnus-summary-prev-group t]
@@ -1975,6 +1990,48 @@ increase the score of each group you read."
1975 1990
1976 (gnus-run-hooks 'gnus-summary-menu-hook))) 1991 (gnus-run-hooks 'gnus-summary-menu-hook)))
1977 1992
1993(defvar gnus-summary-tool-bar-map nil)
1994
1995(defun gnus-summary-make-tool-bar ()
1996 (if (and (fboundp 'tool-bar-add-item-from-menu)
1997 (default-value 'tool-bar-mode)
1998 (not gnus-summary-tool-bar-map))
1999 (setq gnus-summary-tool-bar-map
2000 (let ((tool-bar-map (make-sparse-keymap)))
2001 (tool-bar-add-item-from-menu
2002 'gnus-summary-prev-unread "prev-ur" gnus-summary-mode-map)
2003 (tool-bar-add-item-from-menu
2004 'gnus-summary-next-unread "next-ur" gnus-summary-mode-map)
2005 (tool-bar-add-item-from-menu
2006 'gnus-summary-post-news "post" gnus-summary-mode-map)
2007 (tool-bar-add-item-from-menu
2008 'gnus-summary-followup-with-original "fuwo" gnus-summary-mode-map)
2009 (tool-bar-add-item-from-menu
2010 'gnus-summary-followup "followup" gnus-summary-mode-map)
2011 (tool-bar-add-item-from-menu
2012 'gnus-summary-reply-with-original "reply-wo" gnus-summary-mode-map)
2013 (tool-bar-add-item-from-menu
2014 'gnus-summary-reply "reply" gnus-summary-mode-map)
2015 (tool-bar-add-item-from-menu
2016 'gnus-summary-caesar-message "rot13" gnus-summary-mode-map)
2017 (tool-bar-add-item-from-menu
2018 'gnus-uu-decode-uu "uu-decode" gnus-summary-mode-map)
2019 (tool-bar-add-item-from-menu
2020 'gnus-summary-save-article-file "save-aif" gnus-summary-mode-map)
2021 (tool-bar-add-item-from-menu
2022 'gnus-summary-save-article "save-art" gnus-summary-mode-map)
2023 (tool-bar-add-item-from-menu
2024 'gnus-uu-post-news "uu-post" gnus-summary-mode-map)
2025 (tool-bar-add-item-from-menu
2026 'gnus-summary-catchup "catchup" gnus-summary-mode-map)
2027 (tool-bar-add-item-from-menu
2028 'gnus-summary-catchup-and-exit "cu-exit" gnus-summary-mode-map)
2029 (tool-bar-add-item-from-menu
2030 'gnus-summary-exit "exit-summ" gnus-summary-mode-map)
2031 tool-bar-map)))
2032 (if gnus-summary-tool-bar-map
2033 (set (make-local-variable 'tool-bar-map) gnus-summary-tool-bar-map)))
2034
1978(defun gnus-score-set-default (var value) 2035(defun gnus-score-set-default (var value)
1979 "A version of set that updates the GNU Emacs menu-bar." 2036 "A version of set that updates the GNU Emacs menu-bar."
1980 (set var value) 2037 (set var value)
@@ -2083,9 +2140,10 @@ The following commands are available:
2083 2140
2084\\{gnus-summary-mode-map}" 2141\\{gnus-summary-mode-map}"
2085 (interactive) 2142 (interactive)
2086 (when (gnus-visual-p 'summary-menu 'menu)
2087 (gnus-summary-make-menu-bar))
2088 (kill-all-local-variables) 2143 (kill-all-local-variables)
2144 (when (gnus-visual-p 'summary-menu 'menu)
2145 (gnus-summary-make-menu-bar)
2146 (gnus-summary-make-tool-bar))
2089 (gnus-summary-make-local-variables) 2147 (gnus-summary-make-local-variables)
2090 (gnus-make-thread-indent-array) 2148 (gnus-make-thread-indent-array)
2091 (gnus-simplify-mode-line) 2149 (gnus-simplify-mode-line)
@@ -3817,7 +3875,7 @@ Unscored articles will be counted as having a score of zero."
3817(defvar gnus-tmp-root-expunged nil) 3875(defvar gnus-tmp-root-expunged nil)
3818(defvar gnus-tmp-dummy-line nil) 3876(defvar gnus-tmp-dummy-line nil)
3819 3877
3820(defvar gnus-tmp-header) 3878(eval-when-compile (defvar gnus-tmp-header))
3821(defun gnus-extra-header (type &optional header) 3879(defun gnus-extra-header (type &optional header)
3822 "Return the extra header of TYPE." 3880 "Return the extra header of TYPE."
3823 (or (cdr (assq type (mail-header-extra (or header gnus-tmp-header)))) 3881 (or (cdr (assq type (mail-header-extra (or header gnus-tmp-header))))