1 ;;; gnus.el --- a newsreader for GNU Emacs
2 ;; Copyright (C) 1987, 1988, 1989, 1990, 1993, 1994, 1995, 1996,
4 ;; Free Software Foundation, Inc.
6 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
7 ;; Lars Magne Ingebrigtsen <larsi@gnus.org>
8 ;; Keywords: news, mail
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
31 (eval '(run-hooks 'gnus-load-hook))
33 (eval-when-compile (require 'cl))
39 "The coffee-brewing, all singing, all dancing, kitchen sink newsreader."
43 (defgroup gnus-charset nil
44 "Group character set issues."
45 :link '(custom-manual "(gnus)Charsets")
48 (defgroup gnus-cache nil
52 (defgroup gnus-start nil
53 "Starting your favorite newsreader."
56 (defgroup gnus-start-server nil
57 "Server options at startup."
60 ;; These belong to gnus-group.el.
61 (defgroup gnus-group nil
63 :link '(custom-manual "(gnus)The Group Buffer")
66 (defgroup gnus-group-foreign nil
68 :link '(custom-manual "(gnus)Foreign Groups")
71 (defgroup gnus-group-new nil
72 "Automatic subscription of new groups."
75 (defgroup gnus-group-levels nil
77 :link '(custom-manual "(gnus)Group Levels")
80 (defgroup gnus-group-select nil
82 :link '(custom-manual "(gnus)Selecting a Group")
85 (defgroup gnus-group-listing nil
86 "Showing slices of the group list."
87 :link '(custom-manual "(gnus)Listing Groups")
90 (defgroup gnus-group-visual nil
91 "Sorting the group buffer."
92 :link '(custom-manual "(gnus)Group Buffer Format")
96 (defgroup gnus-group-various nil
97 "Various group options."
98 :link '(custom-manual "(gnus)Scanning New Messages")
101 ;; These belong to gnus-sum.el.
102 (defgroup gnus-summary nil
104 :link '(custom-manual "(gnus)The Summary Buffer")
107 (defgroup gnus-summary-exit nil
108 "Leaving summary buffers."
109 :link '(custom-manual "(gnus)Exiting the Summary Buffer")
110 :group 'gnus-summary)
112 (defgroup gnus-summary-marks nil
113 "Marks used in summary buffers."
114 :link '(custom-manual "(gnus)Marking Articles")
115 :group 'gnus-summary)
117 (defgroup gnus-thread nil
118 "Ordering articles according to replies."
119 :link '(custom-manual "(gnus)Threading")
120 :group 'gnus-summary)
122 (defgroup gnus-summary-format nil
123 "Formatting of the summary buffer."
124 :link '(custom-manual "(gnus)Summary Buffer Format")
125 :group 'gnus-summary)
127 (defgroup gnus-summary-choose nil
129 :link '(custom-manual "(gnus)Choosing Articles")
130 :group 'gnus-summary)
132 (defgroup gnus-summary-maneuvering nil
133 "Summary movement commands."
134 :link '(custom-manual "(gnus)Summary Maneuvering")
135 :group 'gnus-summary)
137 (defgroup gnus-summary-mail nil
138 "Mail group commands."
139 :link '(custom-manual "(gnus)Mail Group Commands")
140 :group 'gnus-summary)
142 (defgroup gnus-summary-sort nil
143 "Sorting the summary buffer."
144 :link '(custom-manual "(gnus)Sorting")
145 :group 'gnus-summary)
147 (defgroup gnus-summary-visual nil
148 "Highlighting and menus in the summary buffer."
149 :link '(custom-manual "(gnus)Summary Highlighting")
151 :group 'gnus-summary)
153 (defgroup gnus-summary-various nil
154 "Various summary buffer options."
155 :link '(custom-manual "(gnus)Various Summary Stuff")
156 :group 'gnus-summary)
158 (defgroup gnus-summary-pick nil
159 "Pick mode in the summary buffer."
160 :link '(custom-manual "(gnus)Pick and Read")
162 :group 'gnus-summary)
164 (defgroup gnus-summary-tree nil
165 "Tree display of threads in the summary buffer."
166 :link '(custom-manual "(gnus)Tree Display")
168 :group 'gnus-summary)
170 ;; Belongs to gnus-uu.el
171 (defgroup gnus-extract-view nil
172 "Viewing extracted files."
173 :link '(custom-manual "(gnus)Viewing Files")
174 :group 'gnus-extract)
176 ;; Belongs to gnus-score.el
177 (defgroup gnus-score nil
178 "Score and kill file handling."
181 (defgroup gnus-score-kill nil
185 (defgroup gnus-score-adapt nil
186 "Adaptive score files."
189 (defgroup gnus-score-default nil
190 "Default values for score files."
193 (defgroup gnus-score-expire nil
194 "Expiring score rules."
197 (defgroup gnus-score-decay nil
198 "Decaying score rules."
201 (defgroup gnus-score-files nil
202 "Score and kill file names."
206 (defgroup gnus-score-various nil
207 "Various scoring and killing options."
211 (defgroup gnus-visual nil
212 "Options controling the visual fluff."
216 (defgroup gnus-agent nil
217 "Offline support for Gnus."
220 (defgroup gnus-files nil
221 "Files used by Gnus."
224 (defgroup gnus-dribble-file nil
226 :link '(custom-manual "(gnus)Auto Save")
229 (defgroup gnus-newsrc nil
230 "Storing Gnus state."
233 (defgroup gnus-server nil
234 "Options related to newsservers and other servers used by Gnus."
237 (defgroup gnus-message '((message custom-group))
238 "Composing replies and followups in Gnus."
241 (defgroup gnus-meta nil
242 "Meta variables controling major portions of Gnus.
243 In general, modifying these variables does not take affect until Gnus
244 is restarted, and sometimes reloaded."
247 (defgroup gnus-various nil
248 "Other Gnus options."
249 :link '(custom-manual "(gnus)Various Various")
252 (defgroup gnus-mime nil
253 "Variables for controlling the Gnus MIME interface."
256 (defgroup gnus-exit nil
258 :link '(custom-manual "(gnus)Exiting Gnus")
261 (defconst gnus-version-number "5.8.5"
262 "Version number for this version of Gnus.")
264 (defconst gnus-version (format "Gnus v%s" gnus-version-number)
265 "Version string for this version of Gnus.")
267 (defcustom gnus-inhibit-startup-message nil
268 "If non-nil, the startup message will not be displayed.
269 This variable is used before `.gnus.el' is loaded, so it should
270 be set in `.emacs' instead."
274 (defcustom gnus-play-startup-jingle nil
275 "If non-nil, play the Gnus jingle at startup."
279 (unless (featurep 'gnus-xmas)
280 (defalias 'gnus-make-overlay 'make-overlay)
281 (defalias 'gnus-delete-overlay 'delete-overlay)
282 (defalias 'gnus-overlay-put 'overlay-put)
283 (defalias 'gnus-move-overlay 'move-overlay)
284 (defalias 'gnus-overlay-end 'overlay-end)
285 (defalias 'gnus-extent-detached-p 'ignore)
286 (defalias 'gnus-extent-start-open 'ignore)
287 (defalias 'gnus-set-text-properties 'set-text-properties)
288 (defalias 'gnus-group-remove-excess-properties 'ignore)
289 (defalias 'gnus-appt-select-lowest-window 'appt-select-lowest-window)
290 (defalias 'gnus-mail-strip-quoted-names 'mail-strip-quoted-names)
291 (defalias 'gnus-character-to-event 'identity)
292 (defalias 'gnus-add-text-properties 'add-text-properties)
293 (defalias 'gnus-put-text-property 'put-text-property)
294 (defalias 'gnus-mode-line-buffer-identification 'identity)
295 (defalias 'gnus-characterp 'numberp)
296 (defalias 'gnus-deactivate-mark 'deactivate-mark)
297 (defalias 'gnus-window-edges 'window-edges)
298 (defalias 'gnus-key-press-event-p 'numberp)
299 (defalias 'gnus-decode-rfc1522 'ignore))
301 ;; We define these group faces here to avoid the display
302 ;; update forced when creating new faces.
304 (defface gnus-group-news-1-face
307 (:foreground "PaleTurquoise" :bold t))
310 (:foreground "ForestGreen" :bold t))
313 "Level 1 newsgroup face.")
315 (defface gnus-group-news-1-empty-face
318 (:foreground "PaleTurquoise"))
321 (:foreground "ForestGreen"))
324 "Level 1 empty newsgroup face.")
326 (defface gnus-group-news-2-face
329 (:foreground "turquoise" :bold t))
332 (:foreground "CadetBlue4" :bold t))
335 "Level 2 newsgroup face.")
337 (defface gnus-group-news-2-empty-face
340 (:foreground "turquoise"))
343 (:foreground "CadetBlue4"))
346 "Level 2 empty newsgroup face.")
348 (defface gnus-group-news-3-face
357 "Level 3 newsgroup face.")
359 (defface gnus-group-news-3-empty-face
368 "Level 3 empty newsgroup face.")
370 (defface gnus-group-news-4-face
379 "Level 4 newsgroup face.")
381 (defface gnus-group-news-4-empty-face
390 "Level 4 empty newsgroup face.")
392 (defface gnus-group-news-5-face
401 "Level 5 newsgroup face.")
403 (defface gnus-group-news-5-empty-face
412 "Level 5 empty newsgroup face.")
414 (defface gnus-group-news-6-face
423 "Level 6 newsgroup face.")
425 (defface gnus-group-news-6-empty-face
434 "Level 6 empty newsgroup face.")
436 (defface gnus-group-news-low-face
439 (:foreground "DarkTurquoise" :bold t))
442 (:foreground "DarkGreen" :bold t))
445 "Low level newsgroup face.")
447 (defface gnus-group-news-low-empty-face
450 (:foreground "DarkTurquoise"))
453 (:foreground "DarkGreen"))
456 "Low level empty newsgroup face.")
458 (defface gnus-group-mail-1-face
461 (:foreground "aquamarine1" :bold t))
464 (:foreground "DeepPink3" :bold t))
467 "Level 1 mailgroup face.")
469 (defface gnus-group-mail-1-empty-face
472 (:foreground "aquamarine1"))
475 (:foreground "DeepPink3"))
477 (:italic t :bold t)))
478 "Level 1 empty mailgroup face.")
480 (defface gnus-group-mail-2-face
483 (:foreground "aquamarine2" :bold t))
486 (:foreground "HotPink3" :bold t))
489 "Level 2 mailgroup face.")
491 (defface gnus-group-mail-2-empty-face
494 (:foreground "aquamarine2"))
497 (:foreground "HotPink3"))
500 "Level 2 empty mailgroup face.")
502 (defface gnus-group-mail-3-face
505 (:foreground "aquamarine3" :bold t))
508 (:foreground "magenta4" :bold t))
511 "Level 3 mailgroup face.")
513 (defface gnus-group-mail-3-empty-face
516 (:foreground "aquamarine3"))
519 (:foreground "magenta4"))
522 "Level 3 empty mailgroup face.")
524 (defface gnus-group-mail-low-face
527 (:foreground "aquamarine4" :bold t))
530 (:foreground "DeepPink4" :bold t))
533 "Low level mailgroup face.")
535 (defface gnus-group-mail-low-empty-face
538 (:foreground "aquamarine4"))
541 (:foreground "DeepPink4"))
544 "Low level empty mailgroup face.")
546 ;; Summary mode faces.
548 (defface gnus-summary-selected-face '((t
550 "Face used for selected articles.")
552 (defface gnus-summary-cancelled-face
554 (:foreground "yellow" :background "black")))
555 "Face used for cancelled articles.")
557 (defface gnus-summary-high-ticked-face
560 (:foreground "pink" :bold t))
563 (:foreground "firebrick" :bold t))
566 "Face used for high interest ticked articles.")
568 (defface gnus-summary-low-ticked-face
571 (:foreground "pink" :italic t))
574 (:foreground "firebrick" :italic t))
577 "Face used for low interest ticked articles.")
579 (defface gnus-summary-normal-ticked-face
582 (:foreground "pink"))
585 (:foreground "firebrick"))
588 "Face used for normal interest ticked articles.")
590 (defface gnus-summary-high-ancient-face
593 (:foreground "SkyBlue" :bold t))
596 (:foreground "RoyalBlue" :bold t))
599 "Face used for high interest ancient articles.")
601 (defface gnus-summary-low-ancient-face
604 (:foreground "SkyBlue" :italic t))
607 (:foreground "RoyalBlue" :italic t))
610 "Face used for low interest ancient articles.")
612 (defface gnus-summary-normal-ancient-face
615 (:foreground "SkyBlue"))
618 (:foreground "RoyalBlue"))
621 "Face used for normal interest ancient articles.")
623 (defface gnus-summary-high-unread-face
626 "Face used for high interest unread articles.")
628 (defface gnus-summary-low-unread-face
631 "Face used for low interest unread articles.")
633 (defface gnus-summary-normal-unread-face
636 "Face used for normal interest unread articles.")
638 (defface gnus-summary-high-read-face
641 (:foreground "PaleGreen"
645 (:foreground "DarkGreen"
649 "Face used for high interest read articles.")
651 (defface gnus-summary-low-read-face
654 (:foreground "PaleGreen"
658 (:foreground "DarkGreen"
662 "Face used for low interest read articles.")
664 (defface gnus-summary-normal-read-face
667 (:foreground "PaleGreen"))
670 (:foreground "DarkGreen"))
673 "Face used for normal interest read articles.")
680 (defvar gnus-buffers nil)
682 (defun gnus-get-buffer-create (name)
683 "Do the same as `get-buffer-create', but store the created buffer."
684 (or (get-buffer name)
685 (car (push (get-buffer-create name) gnus-buffers))))
687 (defun gnus-add-buffer ()
688 "Add the current buffer to the list of Gnus buffers."
689 (push (current-buffer) gnus-buffers))
691 (defun gnus-buffers ()
692 "Return a list of live Gnus buffers."
693 (while (and gnus-buffers
694 (not (buffer-name (car gnus-buffers))))
696 (let ((buffers gnus-buffers))
698 (if (buffer-name (cadr buffers))
700 (setcdr buffers (cddr buffers)))))
705 (defvar gnus-group-buffer "*Group*")
708 (autoload 'gnus-play-jingle "gnus-audio"))
710 (defface gnus-splash-face
713 (:foreground "Brown"))
716 (:foreground "Brown"))
719 "Face of the splash screen.")
721 (defun gnus-splash ()
723 (switch-to-buffer (gnus-get-buffer-create gnus-group-buffer))
724 (let ((buffer-read-only nil))
726 (unless gnus-inhibit-startup-message
727 (gnus-group-startup-message)
729 (when gnus-play-startup-jingle
730 (gnus-play-jingle))))))
732 (defun gnus-indent-rigidly (start end arg)
733 "Indent rigidly using only spaces and no tabs."
736 (narrow-to-region start end)
738 (indent-rigidly start end arg)
739 ;; We translate tabs into spaces -- not everybody uses
740 ;; an 8-character tab.
741 (goto-char (point-min))
742 (while (search-forward "\t" nil t)
743 (replace-match " " t t))))))
745 (defvar gnus-simple-splash nil)
747 (defun gnus-group-startup-message (&optional x y)
748 "Insert startup message in current buffer."
749 ;; Insert the message.
754 _ ___ __ ___ __ _ ___
774 (gnus-indent-rigidly (point-min) (point-max)
775 (/ (max (- (window-width) (or x 46)) 0) 2))
776 (goto-char (point-min))
778 (let* ((pheight (count-lines (point-min) (point-max)))
779 (wheight (window-height))
780 (rest (- wheight pheight)))
781 (insert (make-string (max 0 (* 2 (/ rest 3))) ?\n)))
783 (put-text-property (point-min) (point-max) 'face 'gnus-splash-face)
784 (goto-char (point-min))
785 (setq mode-line-buffer-identification (concat " " gnus-version))
786 (setq gnus-simple-splash t)
787 (set-buffer-modified-p t))
790 (let ((command (format "%s" this-command)))
791 (if (and (string-match "gnus" command)
792 (not (string-match "gnus-other-frame" command)))
794 (gnus-get-buffer-create gnus-group-buffer))))
802 (defcustom gnus-home-directory "~/"
803 "Directory variable that specifies the \"home\" directory.
804 All other Gnus path variables are initialized from this variable."
808 (defcustom gnus-directory (or (getenv "SAVEDIR")
809 (nnheader-concat gnus-home-directory "News/"))
810 "*Directory variable from which all other Gnus file variables are derived.
812 Note that Gnus is mostly loaded when the `.gnus.el' file is read.
813 This means that other directory variables that are initialized from
814 this variable won't be set properly if you set this variable in `.gnus.el'.
815 Set this variable in `.emacs' instead."
819 (defcustom gnus-default-directory nil
820 "*Default directory for all Gnus buffers."
822 :type '(choice (const :tag "current" nil)
825 ;; Site dependent variables. These variables should be defined in
828 (defvar gnus-default-nntp-server nil
829 "Specify a default NNTP server.
830 This variable should be defined in paths.el, and should never be set
832 If you want to change servers, you should use `gnus-select-method'.
833 See the documentation to that variable.")
835 ;; Don't touch this variable.
836 (defvar gnus-nntp-service "nntp"
837 "NNTP service name (\"nntp\" or 119).
838 This is an obsolete variable, which is scarcely used. If you use an
839 nntp server for your newsgroup and want to change the port number
840 used to 899, you would say something along these lines:
842 (setq gnus-select-method '(nntp \"my.nntp.server\" (nntp-port-number 899)))")
844 (defcustom gnus-nntpserver-file "/etc/nntpserver"
845 "A file with only the name of the nntp server in it."
850 ;; This function is used to check both the environment variable
851 ;; NNTPSERVER and the /etc/nntpserver file to see whether one can find
852 ;; an nntp server name default.
853 (defun gnus-getenv-nntpserver ()
854 (or (getenv "NNTPSERVER")
855 (and (file-readable-p gnus-nntpserver-file)
857 (set-buffer (gnus-get-buffer-create " *gnus nntp*"))
858 (insert-file-contents gnus-nntpserver-file)
859 (let ((name (buffer-string)))
861 (if (string-match "\\'[ \t\n]*$" name)
864 (kill-buffer (current-buffer))))))))
866 (defcustom gnus-select-method
869 (list 'nntp (or (condition-case nil
870 (gnus-getenv-nntpserver)
872 (when (and gnus-default-nntp-server
873 (not (string= gnus-default-nntp-server "")))
874 gnus-default-nntp-server)
876 (if (or (null gnus-nntp-service)
877 (equal gnus-nntp-service "nntp"))
879 (list gnus-nntp-service)))
881 "Default method for selecting a newsgroup.
882 This variable should be a list, where the first element is how the
883 news is to be fetched, the second is the address.
885 For instance, if you want to get your news via NNTP from
886 \"flab.flab.edu\", you could say:
888 \(setq gnus-select-method '(nntp \"flab.flab.edu\"))
890 If you want to use your local spool, say:
892 \(setq gnus-select-method (list 'nnspool (system-name)))
894 If you use this variable, you must set `gnus-nntp-server' to nil.
896 There is a lot more to know about select methods and virtual servers -
897 see the manual for details."
899 :type 'gnus-select-method)
901 (defcustom gnus-message-archive-method
904 (nnfolder-directory ,(nnheader-concat message-directory "archive"))
905 (nnfolder-active-file
906 ,(nnheader-concat message-directory "archive/active"))
907 (nnfolder-get-new-mail nil)
908 (nnfolder-inhibit-expiry t))
909 "*Method used for archiving messages you've sent.
910 This should be a mail method.
912 It's probably not a very effective to change this variable once you've
913 run Gnus once. After doing that, you must edit this server from the
917 :type 'gnus-select-method)
919 (defcustom gnus-message-archive-group nil
920 "*Name of the group in which to save the messages you've written.
921 This can either be a string; a list of strings; or an alist
922 of regexps/functions/forms to be evaluated to return a string (or a list
923 of strings). The functions are called with the name of the current
924 group (or nil) as a parameter.
926 If you want to save your mail in one group and the news articles you
927 write in another group, you could say something like:
929 \(setq gnus-message-archive-group
930 '((if (message-news-p)
934 Normally the group names returned by this variable should be
935 unprefixed -- which implicitly means \"store on the archive server\".
936 However, you may wish to store the message on some other server. In
937 that case, just return a fully prefixed name of the group --
938 \"nnml+private:mail.misc\", for instance."
940 :type '(choice (const :tag "none" nil)
945 (defcustom gnus-secondary-servers nil
946 "List of NNTP servers that the user can choose between interactively.
947 To make Gnus query you for a server, you have to give `gnus' a
948 non-numeric prefix - `C-u M-x gnus', in short."
950 :type '(repeat string))
952 (defcustom gnus-nntp-server nil
953 "*The name of the host running the NNTP server.
954 This variable is semi-obsolete. Use the `gnus-select-method'
957 :type '(choice (const :tag "disable" nil)
960 (defcustom gnus-secondary-select-methods nil
961 "A list of secondary methods that will be used for reading news.
962 This is a list where each element is a complete select method (see
963 `gnus-select-method').
965 If, for instance, you want to read your mail with the nnml backend,
966 you could set this variable:
968 \(setq gnus-secondary-select-methods '((nnml \"\")))"
970 :type '(repeat gnus-select-method))
972 (defvar gnus-backup-default-subscribed-newsgroups
973 '("news.announce.newusers" "news.groups.questions" "gnu.emacs.gnus")
974 "Default default new newsgroups the first time Gnus is run.
975 Should be set in paths.el, and shouldn't be touched by the user.")
977 (defcustom gnus-local-domain nil
978 "Local domain name without a host name.
979 The DOMAINNAME environment variable is used instead if it is defined.
980 If the `system-name' function returns the full Internet name, there is
981 no need to set this variable."
983 :type '(choice (const :tag "default" nil)
986 (defvar gnus-local-organization nil
987 "String with a description of what organization (if any) the user belongs to.
988 Obsolete variable; use `message-user-organization' instead.")
990 ;; Customization variables
992 (defcustom gnus-refer-article-method nil
993 "Preferred method for fetching an article by Message-ID.
994 If you are reading news from the local spool (with nnspool), fetching
995 articles by Message-ID is painfully slow. By setting this method to an
996 nntp method, you might get acceptable results.
998 The value of this variable must be a valid select method as discussed
999 in the documentation of `gnus-select-method'.
1001 It can also be a list of select methods, as well as the special symbol
1002 `current', which means to use the current select method. If it is a
1003 list, Gnus will try all the methods in the list until it finds a match."
1005 :type '(choice (const :tag "default" nil)
1006 (const :tag "DejaNews" (nnweb "refer" (nnweb-type dejanews)))
1008 (repeat :menu-tag "Try multiple"
1010 :value (current (nnweb "refer" (nnweb-type dejanews)))
1011 (choice :tag "Method"
1013 (const :tag "DejaNews"
1014 (nnweb "refer" (nnweb-type dejanews)))
1015 gnus-select-method))))
1017 (defcustom gnus-group-faq-directory
1018 '("/ftp@mirrors.aol.com:/pub/rtfm/usenet/"
1019 "/ftp@sunsite.auc.dk:/pub/usenet/"
1020 "/ftp@sunsite.doc.ic.ac.uk:/pub/usenet/news-faqs/"
1021 "/ftp@src.doc.ic.ac.uk:/usenet/news-FAQS/"
1022 "/ftp@ftp.seas.gwu.edu:/pub/rtfm/"
1023 "/ftp@rtfm.mit.edu:/pub/usenet/"
1024 "/ftp@ftp.uni-paderborn.de:/pub/FAQ/"
1025 "/ftp@ftp.sunet.se:/pub/usenet/"
1026 "/ftp@nctuccca.edu.tw:/USENET/FAQ/"
1027 "/ftp@hwarang.postech.ac.kr:/pub/usenet/"
1028 "/ftp@ftp.hk.super.net:/mirror/faqs/")
1029 "*Directory where the group FAQs are stored.
1030 This will most commonly be on a remote machine, and the file will be
1031 fetched by ange-ftp.
1033 This variable can also be a list of directories. In that case, the
1034 first element in the list will be used by default. The others can
1035 be used when being prompted for a site.
1037 Note that Gnus uses an aol machine as the default directory. If this
1038 feels fundamentally unclean, just think of it as a way to finally get
1039 something of value back from them.
1041 If the default site is too slow, try one of these:
1043 North America: mirrors.aol.com /pub/rtfm/usenet
1044 ftp.seas.gwu.edu /pub/rtfm
1045 rtfm.mit.edu /pub/usenet
1046 Europe: ftp.uni-paderborn.de /pub/FAQ
1047 src.doc.ic.ac.uk /usenet/news-FAQS
1048 ftp.sunet.se /pub/usenet
1049 sunsite.auc.dk /pub/usenet
1050 Asia: nctuccca.edu.tw /USENET/FAQ
1051 hwarang.postech.ac.kr /pub/usenet
1052 ftp.hk.super.net /mirror/faqs"
1053 :group 'gnus-group-various
1054 :type '(choice directory
1055 (repeat directory)))
1057 (defcustom gnus-use-cross-reference t
1058 "*Non-nil means that cross referenced articles will be marked as read.
1059 If nil, ignore cross references. If t, mark articles as read in
1060 subscribed newsgroups. If neither t nor nil, mark as read in all
1063 :type '(choice (const :tag "off" nil)
1064 (const :tag "subscribed" t)
1068 (defcustom gnus-process-mark ?#
1070 :group 'gnus-group-visual
1071 :group 'gnus-summary-marks
1074 (defcustom gnus-asynchronous nil
1075 "*If non-nil, Gnus will supply backends with data needed for async article fetching."
1076 :group 'gnus-asynchronous
1079 (defcustom gnus-large-newsgroup 200
1080 "*The number of articles which indicates a large newsgroup.
1081 If the number of articles in a newsgroup is greater than this value,
1082 confirmation is required for selecting the newsgroup."
1083 :group 'gnus-group-select
1086 (defcustom gnus-use-long-file-name (not (memq system-type '(usg-unix-v xenix)))
1087 "*Non-nil means that the default name of a file to save articles in is the group name.
1088 If it's nil, the directory form of the group name is used instead.
1090 If this variable is a list, and the list contains the element
1091 `not-score', long file names will not be used for score files; if it
1092 contains the element `not-save', long file names will not be used for
1093 saving; and if it contains the element `not-kill', long file names
1094 will not be used for kill files.
1096 Note that the default for this variable varies according to what system
1097 type you're using. On `usg-unix-v' and `xenix' this variable defaults
1098 to nil while on all other systems it defaults to t."
1102 (defcustom gnus-kill-files-directory gnus-directory
1103 "*Name of the directory where kill files will be stored (default \"~/News\")."
1104 :group 'gnus-score-files
1105 :group 'gnus-score-kill
1108 (defcustom gnus-save-score nil
1109 "*If non-nil, save group scoring info."
1110 :group 'gnus-score-various
1114 (defcustom gnus-use-undo t
1115 "*If non-nil, allow undoing in Gnus group mode buffers."
1119 (defcustom gnus-use-adaptive-scoring nil
1120 "*If non-nil, use some adaptive scoring scheme.
1121 If a list, then the values `word' and `line' are meaningful. The
1122 former will perform adaption on individual words in the subject
1123 header while `line' will perform adaption on several headers."
1125 :group 'gnus-score-adapt
1126 :type '(set (const word) (const line)))
1128 (defcustom gnus-use-cache 'passive
1129 "*If nil, Gnus will ignore the article cache.
1130 If `passive', it will allow entering (and reading) articles
1131 explicitly entered into the cache. If anything else, use the
1132 cache to the full extent of the law."
1135 :type '(choice (const :tag "off" nil)
1136 (const :tag "passive" passive)
1137 (const :tag "active" t)))
1139 (defcustom gnus-use-trees nil
1140 "*If non-nil, display a thread tree buffer."
1144 (defcustom gnus-use-grouplens nil
1145 "*If non-nil, use GroupLens ratings."
1149 (defcustom gnus-keep-backlog nil
1150 "*If non-nil, Gnus will keep read articles for later re-retrieval.
1151 If it is a number N, then Gnus will only keep the last N articles
1152 read. If it is neither nil nor a number, Gnus will keep all read
1153 articles. This is not a good idea."
1155 :type '(choice (const :tag "off" nil)
1160 (defcustom gnus-use-nocem nil
1161 "*If non-nil, Gnus will read NoCeM cancel messages."
1165 (defcustom gnus-suppress-duplicates nil
1166 "*If non-nil, Gnus will mark duplicate copies of the same article as read."
1170 (defcustom gnus-use-scoring t
1171 "*If non-nil, enable scoring."
1175 (defcustom gnus-use-picons nil
1176 "*If non-nil, display picons in a frame of their own."
1180 (defcustom gnus-summary-prepare-exit-hook
1181 '(gnus-summary-expire-articles)
1182 "*A hook called when preparing to exit from the summary buffer.
1183 It calls `gnus-summary-expire-articles' by default."
1184 :group 'gnus-summary-exit
1187 (defcustom gnus-novice-user t
1188 "*Non-nil means that you are a usenet novice.
1189 If non-nil, verbose messages may be displayed and confirmations may be
1194 (defcustom gnus-expert-user nil
1195 "*Non-nil means that you will never be asked for confirmation about anything.
1196 That doesn't mean *anything* anything; particularly destructive
1197 commands will still require prompting."
1201 (defcustom gnus-interactive-catchup t
1202 "*If non-nil, require your confirmation when catching up a group."
1203 :group 'gnus-group-select
1206 (defcustom gnus-interactive-exit t
1207 "*If non-nil, require your confirmation when exiting Gnus."
1211 (defcustom gnus-extract-address-components 'gnus-extract-address-components
1212 "*Function for extracting address components from a From header.
1213 Two pre-defined function exist: `gnus-extract-address-components',
1214 which is the default, quite fast, and too simplistic solution, and
1215 `mail-extract-address-components', which works much better, but is
1217 :group 'gnus-summary-format
1218 :type '(radio (function-item gnus-extract-address-components)
1219 (function-item mail-extract-address-components)
1220 (function :tag "Other")))
1222 (defcustom gnus-carpal nil
1223 "*If non-nil, display clickable icons."
1227 (defcustom gnus-shell-command-separator ";"
1228 "String used to separate to shell commands."
1232 (defcustom gnus-valid-select-methods
1233 '(("nntp" post address prompt-address physical-address)
1234 ("nnspool" post address)
1235 ("nnvirtual" post-mail virtual prompt-address)
1236 ("nnmbox" mail respool address)
1237 ("nnml" mail respool address)
1238 ("nnmh" mail respool address)
1239 ("nndir" post-mail prompt-address physical-address)
1240 ("nneething" none address prompt-address physical-address)
1241 ("nndoc" none address prompt-address)
1242 ("nnbabyl" mail address respool)
1243 ("nnkiboze" post virtual)
1244 ("nnsoup" post-mail address)
1245 ("nndraft" post-mail)
1246 ("nnfolder" mail respool address)
1247 ("nngateway" post-mail address prompt-address physical-address)
1253 ("nnagent" post-mail)
1254 ("nnimap" post-mail address prompt-address physical-address))
1255 "*An alist of valid select methods.
1256 The first element of each list lists should be a string with the name
1257 of the select method. The other elements may be the category of
1258 this method (i. e., `post', `mail', `none' or whatever) or other
1259 properties that this method has (like being respoolable).
1260 If you implement a new select method, all you should have to change is
1261 this variable. I think."
1263 :type '(repeat (group (string :tag "Name")
1264 (radio-button-choice (const :format "%v " post)
1265 (const :format "%v " mail)
1266 (const :format "%v " none)
1268 (checklist :inline t
1269 (const :format "%v " address)
1270 (const :format "%v " prompt-address)
1271 (const :format "%v " physical-address)
1272 (const :format "%v " virtual)
1275 (define-widget 'gnus-select-method 'list
1276 "Widget for entering a select method."
1278 :tag "Select Method"
1279 :args `((choice :tag "Method"
1280 ,@(mapcar (lambda (entry)
1281 (list 'const :format "%v\n"
1282 (intern (car entry))))
1283 gnus-valid-select-methods))
1284 (string :tag "Address")
1285 (repeat :tag "Options"
1289 (sexp :tag "Value")))))
1291 (defcustom gnus-updated-mode-lines '(group article summary tree)
1292 "List of buffers that should update their mode lines.
1293 The list may contain the symbols `group', `article', `tree' and
1294 `summary'. If the corresponding symbol is present, Gnus will keep
1295 that mode line updated with information that may be pertinent.
1296 If this variable is nil, screen refresh may be quicker."
1297 :group 'gnus-various
1298 :type '(set (const group)
1303 ;; Added by Keinonen Kari <kk85613@cs.tut.fi>.
1304 (defcustom gnus-mode-non-string-length nil
1305 "*Max length of mode-line non-string contents.
1306 If this is nil, Gnus will take space as is needed, leaving the rest
1307 of the modeline intact. Note that the default of nil is unlikely
1308 to be desirable; see the manual for further details."
1309 :group 'gnus-various
1310 :type '(choice (const nil)
1313 (defcustom gnus-auto-expirable-newsgroups nil
1314 "*Groups in which to automatically mark read articles as expirable.
1315 If non-nil, this should be a regexp that should match all groups in
1316 which to perform auto-expiry. This only makes sense for mail groups."
1317 :group 'nnmail-expire
1318 :type '(choice (const nil)
1321 (defcustom gnus-total-expirable-newsgroups nil
1322 "*Groups in which to perform expiry of all read articles.
1323 Use with extreme caution. All groups that match this regexp will be
1324 expiring - which means that all read articles will be deleted after
1325 \(say) one week. (This only goes for mail groups and the like, of
1327 :group 'nnmail-expire
1328 :type '(choice (const nil)
1331 (defcustom gnus-group-uncollapsed-levels 1
1332 "Number of group name elements to leave alone when making a short group name."
1333 :group 'gnus-group-visual
1336 (defcustom gnus-group-use-permanent-levels nil
1337 "*If non-nil, once you set a level, Gnus will use this level."
1338 :group 'gnus-group-levels
1343 (defcustom gnus-load-hook nil
1344 "A hook run while Gnus is loaded."
1348 (defcustom gnus-apply-kill-hook '(gnus-apply-kill-file)
1349 "A hook called to apply kill files to a group.
1350 This hook is intended to apply a kill file to the selected newsgroup.
1351 The function `gnus-apply-kill-file' is called by default.
1353 Since a general kill file is too heavy to use only for a few
1354 newsgroups, I recommend you to use a lighter hook function. For
1355 example, if you'd like to apply a kill file to articles which contains
1356 a string `rmgroup' in subject in newsgroup `control', you can use the
1359 (setq gnus-apply-kill-hook
1362 (cond ((string-match \"control\" gnus-newsgroup-name)
1363 (gnus-kill \"Subject\" \"rmgroup\")
1364 (gnus-expunge \"X\"))))))"
1365 :group 'gnus-score-kill
1366 :options '(gnus-apply-kill-file)
1369 (defcustom gnus-group-change-level-function nil
1370 "Function run when a group level is changed.
1371 It is called with three parameters -- GROUP, LEVEL and OLDLEVEL."
1372 :group 'gnus-group-levels
1377 (defcustom gnus-visual
1378 '(summary-highlight group-highlight article-highlight
1380 summary-menu group-menu article-menu
1381 tree-highlight menu highlight
1382 browse-menu server-menu
1383 page-marker tree-menu binary-menu pick-menu
1385 "*Enable visual features.
1386 If `visual' is disabled, there will be no menus and few faces. Most of
1387 the visual customization options below will be ignored. Gnus will use
1388 less space and be faster as a result.
1390 This variable can also be a list of visual elements to switch on. For
1391 instance, to switch off all visual things except menus, you can say:
1393 (setq gnus-visual '(menu))
1395 Valid elements include `summary-highlight', `group-highlight',
1396 `article-highlight', `mouse-face', `summary-menu', `group-menu',
1397 `article-menu', `tree-highlight', `menu', `highlight', `browse-menu',
1398 `server-menu', `page-marker', `tree-menu', `binary-menu', `pick-menu',
1399 and `grouplens-menu'."
1402 :type '(set (const summary-highlight)
1403 (const group-highlight)
1404 (const article-highlight)
1406 (const summary-menu)
1408 (const article-menu)
1409 (const tree-highlight)
1418 (const grouplens-menu)))
1420 (defcustom gnus-mouse-face
1422 (if (gnus-visual-p 'mouse-face 'highlight)
1423 (if (boundp 'gnus-mouse-face)
1424 (or gnus-mouse-face 'highlight)
1428 "*Face used for group or summary buffer mouse highlighting.
1429 The line beneath the mouse pointer will be highlighted with this
1434 (defcustom gnus-article-save-directory gnus-directory
1435 "*Name of the directory articles will be saved in (default \"~/News\")."
1436 :group 'gnus-article-saving
1439 (defvar gnus-plugged t
1440 "Whether Gnus is plugged or not.")
1442 (defcustom gnus-default-charset 'iso-8859-1
1443 "Default charset assumed to be used when viewing non-ASCII characters.
1444 This variable is overridden on a group-to-group basis by the
1445 gnus-group-charset-alist variable and is only used on groups not
1446 covered by that variable."
1448 :group 'gnus-charset)
1450 (defcustom gnus-default-posting-charset nil
1451 "Default charset assumed to be used when posting non-ASCII characters.
1452 This variable is overridden on a group-to-group basis by the
1453 gnus-group-posting-charset-alist variable and is only used on groups not
1454 covered by that variable.
1455 If nil, no default charset is assumed when posting."
1457 :group 'gnus-charset)
1460 ;;; Internal variables
1462 (defvar gnus-agent-meta-information-header "X-Gnus-Agent-Meta-Information")
1463 (defvar gnus-group-get-parameter-function 'gnus-group-get-parameter)
1464 (defvar gnus-original-article-buffer " *Original Article*")
1465 (defvar gnus-newsgroup-name nil)
1466 (defvar gnus-ephemeral-servers nil)
1468 (defvar gnus-agent nil
1469 "Whether we want to use the Gnus agent or not.")
1471 (defvar gnus-command-method nil
1472 "Dynamically bound variable that says what the current backend is.")
1474 (defvar gnus-current-select-method nil
1475 "The current method for selecting a newsgroup.")
1477 (defvar gnus-tree-buffer "*Tree*"
1478 "Buffer where Gnus thread trees are displayed.")
1481 (defvar gnus-use-generic-from nil)
1483 ;; Variable holding the user answers to all method prompts.
1484 (defvar gnus-method-history nil)
1486 ;; Variable holding the user answers to all mail method prompts.
1487 (defvar gnus-mail-method-history nil)
1489 ;; Variable holding the user answers to all group prompts.
1490 (defvar gnus-group-history nil)
1492 (defvar gnus-server-alist nil
1493 "List of available servers.")
1495 (defcustom gnus-cache-directory
1496 (nnheader-concat gnus-directory "cache/")
1497 "*The directory where cached articles will be stored."
1501 (defvar gnus-predefined-server-alist
1504 (nnspool-spool-directory ,gnus-cache-directory)
1505 (nnspool-nov-directory ,gnus-cache-directory)
1506 (nnspool-active-file
1507 ,(nnheader-concat gnus-cache-directory "active"))))
1508 "List of predefined (convenience) servers.")
1510 (defvar gnus-topic-indentation "");; Obsolete variable.
1512 (defconst gnus-article-mark-lists
1513 '((marked . tick) (replied . reply)
1514 (expirable . expire) (killed . killed)
1515 (bookmarks . bookmark) (dormant . dormant)
1516 (scored . score) (saved . save)
1517 (cached . cache) (downloadable . download)
1518 (unsendable . unsend)))
1520 (defvar gnus-headers-retrieved-by nil)
1521 (defvar gnus-article-reply nil)
1522 (defvar gnus-override-method nil)
1523 (defvar gnus-article-check-size nil)
1524 (defvar gnus-opened-servers nil)
1526 (defvar gnus-current-kill-article nil)
1528 (defvar gnus-have-read-active-file nil)
1530 (defconst gnus-maintainer
1531 "bugs@gnus.org (The Gnus Bugfixing Girls + Boys)"
1532 "The mail address of the Gnus maintainers.")
1534 (defvar gnus-info-nodes
1535 '((gnus-group-mode "(gnus)The Group Buffer")
1536 (gnus-summary-mode "(gnus)The Summary Buffer")
1537 (gnus-article-mode "(gnus)The Article Buffer")
1538 (gnus-server-mode "(gnus)The Server Buffer")
1539 (gnus-browse-mode "(gnus)Browse Foreign Server")
1540 (gnus-tree-mode "(gnus)Tree Display"))
1541 "Alist of major modes and related Info nodes.")
1543 (defvar gnus-group-buffer "*Group*")
1544 (defvar gnus-summary-buffer "*Summary*")
1545 (defvar gnus-article-buffer "*Article*")
1546 (defvar gnus-server-buffer "*Server*")
1548 (defvar gnus-slave nil
1549 "Whether this Gnus is a slave or not.")
1551 (defvar gnus-batch-mode nil
1552 "Whether this Gnus is running in batch mode or not.")
1554 (defvar gnus-variable-list
1555 '(gnus-newsrc-options gnus-newsrc-options-n
1556 gnus-newsrc-last-checked-date
1557 gnus-newsrc-alist gnus-server-alist
1558 gnus-killed-list gnus-zombie-list
1559 gnus-topic-topology gnus-topic-alist
1561 "Gnus variables saved in the quick startup file.")
1563 (defvar gnus-newsrc-alist nil
1564 "Assoc list of read articles.
1565 gnus-newsrc-hashtb should be kept so that both hold the same information.")
1567 (defvar gnus-newsrc-hashtb nil
1568 "Hashtable of gnus-newsrc-alist.")
1570 (defvar gnus-killed-list nil
1571 "List of killed newsgroups.")
1573 (defvar gnus-killed-hashtb nil
1574 "Hash table equivalent of gnus-killed-list.")
1576 (defvar gnus-zombie-list nil
1577 "List of almost dead newsgroups.")
1579 (defvar gnus-description-hashtb nil
1580 "Descriptions of newsgroups.")
1582 (defvar gnus-list-of-killed-groups nil
1583 "List of newsgroups that have recently been killed by the user.")
1585 (defvar gnus-active-hashtb nil
1586 "Hashtable of active articles.")
1588 (defvar gnus-moderated-hashtb nil
1589 "Hashtable of moderated newsgroups.")
1591 ;; Save window configuration.
1592 (defvar gnus-prev-winconf nil)
1594 (defvar gnus-reffed-article-number nil)
1596 ;;; Let the byte-compiler know that we know about this variable.
1597 (defvar rmail-default-rmail-file)
1599 (defvar gnus-dead-summary nil)
1601 ;;; End of variables.
1603 ;; Define some autoload functions Gnus might use.
1606 ;; This little mapcar goes through the list below and marks the
1607 ;; symbols in question as autoloaded functions.
1610 (let ((interactive (nth 1 (memq ':interactive package))))
1614 (when (consp function)
1615 (setq keymap (car (memq 'keymap function)))
1616 (setq function (car function)))
1617 (unless (fboundp function)
1618 (autoload function (car package) nil interactive keymap))))
1619 (if (eq (nth 1 package) ':interactive)
1622 '(("info" :interactive t Info-goto-node)
1623 ("pp" pp pp-to-string pp-eval-expression)
1624 ("qp" quoted-printable-decode-region quoted-printable-decode-string)
1625 ("ps-print" ps-print-preprint)
1626 ("browse-url" :interactive t browse-url)
1627 ("message" :interactive t
1628 message-send-and-exit message-yank-original)
1629 ("babel" babel-as-string)
1630 ("nnmail" nnmail-split-fancy nnmail-article-group)
1631 ("nnvirtual" nnvirtual-catchup-group nnvirtual-convert-headers)
1632 ("rmailout" rmail-output rmail-output-to-rmail-file)
1633 ("rmail" rmail-insert-rmail-file-header rmail-count-new-messages
1634 rmail-show-message rmail-summary-exists
1635 rmail-select-summary rmail-update-summary)
1636 ("gnus-audio" :interactive t gnus-audio-play)
1637 ("gnus-xmas" gnus-xmas-splash)
1638 ("gnus-soup" :interactive t
1639 gnus-group-brew-soup gnus-brew-soup gnus-soup-add-article
1640 gnus-soup-send-replies gnus-soup-save-areas gnus-soup-pack-packet)
1641 ("nnsoup" nnsoup-pack-replies)
1642 ("score-mode" :interactive t gnus-score-mode)
1643 ("gnus-mh" gnus-summary-save-article-folder
1644 gnus-Folder-save-name gnus-folder-save-name)
1645 ("gnus-mh" :interactive t gnus-summary-save-in-folder)
1646 ("gnus-demon" gnus-demon-add-nocem gnus-demon-add-scanmail
1647 gnus-demon-add-rescan gnus-demon-add-scan-timestamps
1648 gnus-demon-add-disconnection gnus-demon-add-handler
1649 gnus-demon-remove-handler)
1650 ("gnus-demon" :interactive t
1651 gnus-demon-init gnus-demon-cancel)
1652 ("gnus-salt" gnus-highlight-selected-tree gnus-possibly-generate-tree
1653 gnus-tree-open gnus-tree-close gnus-carpal-setup-buffer)
1654 ("gnus-nocem" gnus-nocem-scan-groups gnus-nocem-close
1655 gnus-nocem-unwanted-article-p)
1656 ("gnus-srvr" gnus-enter-server-buffer gnus-server-set-info
1657 gnus-server-server-name)
1658 ("gnus-srvr" gnus-browse-foreign-server)
1659 ("gnus-cite" :interactive t
1660 gnus-article-highlight-citation gnus-article-hide-citation-maybe
1661 gnus-article-hide-citation gnus-article-fill-cited-article
1662 gnus-article-hide-citation-in-followups)
1663 ("gnus-kill" gnus-kill gnus-apply-kill-file-internal
1664 gnus-kill-file-edit-file gnus-kill-file-raise-followups-to-author
1665 gnus-execute gnus-expunge gnus-batch-kill gnus-batch-score)
1666 ("gnus-cache" gnus-cache-possibly-enter-article gnus-cache-save-buffers
1667 gnus-cache-possibly-remove-articles gnus-cache-request-article
1668 gnus-cache-retrieve-headers gnus-cache-possibly-alter-active
1669 gnus-cache-enter-remove-article gnus-cached-article-p
1670 gnus-cache-open gnus-cache-close gnus-cache-update-article
1671 gnus-cache-articles-in-group)
1672 ("gnus-cache" :interactive t gnus-jog-cache gnus-cache-enter-article
1673 gnus-cache-remove-article gnus-summary-insert-cached-articles)
1674 ("gnus-score" :interactive t
1675 gnus-summary-increase-score gnus-summary-set-score
1676 gnus-summary-raise-thread gnus-summary-raise-same-subject
1677 gnus-summary-raise-score gnus-summary-raise-same-subject-and-select
1678 gnus-summary-lower-thread gnus-summary-lower-same-subject
1679 gnus-summary-lower-score gnus-summary-lower-same-subject-and-select
1680 gnus-summary-current-score gnus-score-delta-default
1681 gnus-score-flush-cache gnus-score-close
1682 gnus-possibly-score-headers gnus-score-followup-article
1683 gnus-score-followup-thread)
1685 (gnus-summary-score-map keymap) gnus-score-save gnus-score-headers
1686 gnus-current-score-file-nondirectory gnus-score-adaptive
1687 gnus-score-find-trace gnus-score-file-name)
1688 ("gnus-cus" :interactive t gnus-group-customize gnus-score-customize)
1689 ("gnus-topic" :interactive t gnus-topic-mode)
1690 ("gnus-topic" gnus-topic-remove-group gnus-topic-set-parameters
1691 gnus-subscribe-topics)
1692 ("gnus-salt" :interactive t gnus-pick-mode gnus-binary-mode)
1693 ("gnus-uu" (gnus-uu-extract-map keymap) (gnus-uu-mark-map keymap))
1694 ("gnus-uu" :interactive t
1695 gnus-uu-digest-mail-forward gnus-uu-digest-post-forward
1696 gnus-uu-mark-series gnus-uu-mark-region gnus-uu-mark-buffer
1697 gnus-uu-mark-by-regexp gnus-uu-mark-all
1698 gnus-uu-mark-sparse gnus-uu-mark-thread gnus-uu-decode-uu
1699 gnus-uu-decode-uu-and-save gnus-uu-decode-unshar
1700 gnus-uu-decode-unshar-and-save gnus-uu-decode-save
1701 gnus-uu-decode-binhex gnus-uu-decode-uu-view
1702 gnus-uu-decode-uu-and-save-view gnus-uu-decode-unshar-view
1703 gnus-uu-decode-unshar-and-save-view gnus-uu-decode-save-view
1704 gnus-uu-decode-binhex-view gnus-uu-unmark-thread
1705 gnus-uu-mark-over gnus-uu-post-news)
1706 ("gnus-uu" gnus-uu-delete-work-dir gnus-uu-unmark-thread)
1707 ("gnus-msg" (gnus-summary-send-map keymap)
1708 gnus-article-mail gnus-copy-article-buffer gnus-extended-version)
1709 ("gnus-msg" :interactive t
1710 gnus-group-post-news gnus-group-mail gnus-summary-post-news
1711 gnus-summary-followup gnus-summary-followup-with-original
1712 gnus-summary-cancel-article gnus-summary-supersede-article
1713 gnus-post-news gnus-summary-reply gnus-summary-reply-with-original
1714 gnus-summary-mail-forward gnus-summary-mail-other-window
1715 gnus-summary-resend-message gnus-summary-resend-bounced-mail
1716 gnus-summary-wide-reply gnus-summary-followup-to-mail
1717 gnus-summary-followup-to-mail-with-original gnus-bug
1718 gnus-summary-wide-reply-with-original
1719 gnus-summary-post-forward gnus-summary-wide-reply-with-original
1720 gnus-summary-post-forward)
1721 ("gnus-picon" :interactive t gnus-article-display-picons
1722 gnus-group-display-picons gnus-picons-article-display-x-face
1723 gnus-picons-display-x-face)
1724 ("gnus-picon" gnus-picons-buffer-name)
1725 ("gnus-gl" bbb-login bbb-logout bbb-grouplens-group-p
1726 gnus-grouplens-mode)
1727 ("smiley" :interactive t gnus-smiley-display)
1728 ("gnus-win" gnus-configure-windows gnus-add-configuration)
1729 ("gnus-sum" gnus-summary-insert-line gnus-summary-read-group
1730 gnus-list-of-unread-articles gnus-list-of-read-articles
1731 gnus-offer-save-summaries gnus-make-thread-indent-array
1732 gnus-summary-exit gnus-update-read-articles gnus-summary-last-subject
1733 gnus-summary-skip-intangible gnus-summary-article-number
1734 gnus-data-header gnus-data-find)
1735 ("gnus-group" gnus-group-insert-group-line gnus-group-quit
1736 gnus-group-list-groups gnus-group-first-unread-group
1737 gnus-group-set-mode-line gnus-group-set-info gnus-group-save-newsrc
1738 gnus-group-setup-buffer gnus-group-get-new-news
1739 gnus-group-make-help-group gnus-group-update-group
1740 gnus-group-iterate gnus-group-group-name)
1741 ("gnus-bcklg" gnus-backlog-request-article gnus-backlog-enter-article
1742 gnus-backlog-remove-article)
1743 ("gnus-art" gnus-article-read-summary-keys gnus-article-save
1744 gnus-article-prepare gnus-article-set-window-start
1745 gnus-article-next-page gnus-article-prev-page
1746 gnus-request-article-this-buffer gnus-article-mode
1747 gnus-article-setup-buffer gnus-narrow-to-page
1748 gnus-article-delete-invisible-text gnus-treat-article)
1749 ("gnus-art" :interactive t
1750 gnus-article-hide-headers gnus-article-hide-boring-headers
1751 gnus-article-treat-overstrike
1752 gnus-article-remove-cr gnus-article-remove-trailing-blank-lines
1753 gnus-article-display-x-face gnus-article-de-quoted-unreadable
1754 gnus-article-decode-HZ
1755 gnus-article-hide-pgp
1756 gnus-article-hide-pem gnus-article-hide-signature
1757 gnus-article-strip-leading-blank-lines gnus-article-date-local
1758 gnus-article-date-original gnus-article-date-lapsed
1759 gnus-article-show-all-headers
1760 gnus-article-edit-mode gnus-article-edit-article
1761 gnus-article-edit-done gnus-article-decode-encoded-words
1762 gnus-start-date-timer gnus-stop-date-timer
1763 gnus-mime-view-all-parts)
1764 ("gnus-int" gnus-request-type)
1765 ("gnus-start" gnus-newsrc-parse-options gnus-1 gnus-no-server-1
1766 gnus-dribble-enter gnus-read-init-file gnus-dribble-touch)
1767 ("gnus-dup" gnus-dup-suppress-articles gnus-dup-unsuppress-article
1768 gnus-dup-enter-articles)
1769 ("gnus-range" gnus-copy-sequence)
1770 ("gnus-eform" gnus-edit-form)
1771 ("gnus-move" :interactive t
1772 gnus-group-move-group-to-server gnus-change-server)
1773 ("gnus-logic" gnus-score-advanced)
1774 ("gnus-undo" gnus-undo-mode gnus-undo-register)
1775 ("gnus-async" gnus-async-request-fetched-article gnus-async-prefetch-next
1776 gnus-async-prefetch-article gnus-async-prefetch-remove-group
1777 gnus-async-halt-prefetch)
1778 ("gnus-agent" gnus-open-agent gnus-agent-get-function
1779 gnus-agent-save-groups gnus-agent-save-active gnus-agent-method-p
1780 gnus-agent-get-undownloaded-list gnus-agent-fetch-session
1781 gnus-summary-set-agent-mark gnus-agent-save-group-info)
1782 ("gnus-agent" :interactive t
1783 gnus-unplugged gnus-agentize gnus-agent-batch)
1784 ("gnus-vm" :interactive t gnus-summary-save-in-vm
1785 gnus-summary-save-article-vm)
1786 ("gnus-draft" :interactive t gnus-draft-mode gnus-group-send-drafts)
1787 ("gnus-mlspl" gnus-group-split gnus-group-split-fancy)
1788 ("gnus-mlspl" :interactive t gnus-group-split-setup
1789 gnus-group-split-update))))
1791 ;;; gnus-sum.el thingies
1794 (defcustom gnus-summary-line-format "%U%R%z%I%(%[%4L: %-20,20n%]%) %s\n"
1795 "*The format specification of the lines in the summary buffer.
1797 It works along the same lines as a normal formatting string,
1798 with some simple extensions.
1800 %N Article number, left padded with spaces (string)
1802 %s Subject if it is at the root of a thread, and \"\" otherwise (string)
1803 %n Name of the poster (string)
1804 %a Extracted name of the poster (string)
1805 %A Extracted address of the poster (string)
1806 %F Contents of the From: header (string)
1807 %f Contents of the From: or To: headers (string)
1808 %x Contents of the Xref: header (string)
1809 %D Date of the article (string)
1810 %d Date of the article (string) in DD-MMM format
1811 %M Message-id of the article (string)
1812 %r References of the article (string)
1813 %c Number of characters in the article (integer)
1814 %L Number of lines in the article (integer)
1815 %I Indentation based on thread level (a string of spaces)
1816 %T A string with two possible values: 80 spaces if the article
1817 is on thread level two or larger and 0 spaces on level one
1818 %R \"A\" if this article has been replied to, \" \" otherwise (character)
1819 %U Status of this article (character, \"R\", \"K\", \"-\" or \" \")
1820 %[ Opening bracket (character, \"[\" or \"<\")
1821 %] Closing bracket (character, \"]\" or \">\")
1822 %> Spaces of length thread-level (string)
1823 %< Spaces of length (- 20 thread-level) (string)
1824 %i Article score (number)
1825 %z Article zcore (character)
1826 %t Number of articles under the current thread (number).
1827 %e Whether the thread is empty or not (character).
1828 %l GroupLens score (string).
1829 %V Total thread score (number).
1830 %P The line number (number).
1831 %O Download mark (character).
1832 %u User defined specifier. The next character in the format string should
1833 be a letter. Gnus will call the function gnus-user-format-function-X,
1834 where X is the letter following %u. The function will be passed the
1835 current header as argument. The function should return a string, which
1836 will be inserted into the summary just like information from any other
1839 Text between %( and %) will be highlighted with `gnus-mouse-face'
1840 when the mouse point is placed inside the area. There can only be one
1843 The %U (status), %R (replied) and %z (zcore) specs have to be handled
1844 with care. For reasons of efficiency, Gnus will compute what column
1845 these characters will end up in, and \"hard-code\" that. This means that
1846 it is invalid to have these specs after a variable-length spec. Well,
1847 you might not be arrested, but your summary buffer will look strange,
1848 which is bad enough.
1850 The smart choice is to have these specs as for to the left as
1853 This restriction may disappear in later versions of Gnus."
1855 :group 'gnus-summary-format)
1858 ;;; Skeleton keymaps
1861 (defun gnus-suppress-keymap (keymap)
1862 (suppress-keymap keymap)
1863 (let ((keys `([backspace] [delete] "\177" "\M-u"))) ;gnus-mouse-2
1865 (define-key keymap (pop keys) 'undefined))))
1867 (defvar gnus-article-mode-map
1868 (let ((keymap (make-sparse-keymap)))
1869 (gnus-suppress-keymap keymap)
1871 (defvar gnus-summary-mode-map
1872 (let ((keymap (make-keymap)))
1873 (gnus-suppress-keymap keymap)
1875 (defvar gnus-group-mode-map
1876 (let ((keymap (make-keymap)))
1877 (gnus-suppress-keymap keymap)
1882 ;; Fix by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
1883 ;; If you want the cursor to go somewhere else, set these two
1884 ;; functions in some startup hook to whatever you want.
1885 (defalias 'gnus-summary-position-point 'gnus-goto-colon)
1886 (defalias 'gnus-group-position-point 'gnus-goto-colon)
1888 ;;; Various macros and substs.
1890 (defun gnus-header-from (header)
1891 (mail-header-from header))
1893 (defmacro gnus-gethash (string hashtable)
1894 "Get hash value of STRING in HASHTABLE."
1895 `(symbol-value (intern-soft ,string ,hashtable)))
1897 (defmacro gnus-sethash (string value hashtable)
1898 "Set hash value. Arguments are STRING, VALUE, and HASHTABLE."
1899 `(set (intern ,string ,hashtable) ,value))
1900 (put 'gnus-sethash 'edebug-form-spec '(form form form))
1902 (defmacro gnus-group-unread (group)
1903 "Get the currently computed number of unread articles in GROUP."
1904 `(car (gnus-gethash ,group gnus-newsrc-hashtb)))
1906 (defmacro gnus-group-entry (group)
1907 "Get the newsrc entry for GROUP."
1908 `(gnus-gethash ,group gnus-newsrc-hashtb))
1910 (defmacro gnus-active (group)
1911 "Get active info on GROUP."
1912 `(gnus-gethash ,group gnus-active-hashtb))
1914 (defmacro gnus-set-active (group active)
1915 "Set GROUP's active info."
1916 `(gnus-sethash ,group ,active gnus-active-hashtb))
1918 ;; Info access macros.
1920 (defmacro gnus-info-group (info)
1922 (defmacro gnus-info-rank (info)
1924 (defmacro gnus-info-read (info)
1926 (defmacro gnus-info-marks (info)
1928 (defmacro gnus-info-method (info)
1930 (defmacro gnus-info-params (info)
1933 (defmacro gnus-info-level (info)
1934 `(let ((rank (gnus-info-rank ,info)))
1938 (defmacro gnus-info-score (info)
1939 `(let ((rank (gnus-info-rank ,info)))
1940 (or (and (consp rank) (cdr rank)) 0)))
1942 (defmacro gnus-info-set-group (info group)
1943 `(setcar ,info ,group))
1944 (defmacro gnus-info-set-rank (info rank)
1945 `(setcar (nthcdr 1 ,info) ,rank))
1946 (defmacro gnus-info-set-read (info read)
1947 `(setcar (nthcdr 2 ,info) ,read))
1948 (defmacro gnus-info-set-marks (info marks &optional extend)
1950 `(gnus-info-set-entry ,info ,marks 3)
1951 `(setcar (nthcdr 3 ,info) ,marks)))
1952 (defmacro gnus-info-set-method (info method &optional extend)
1954 `(gnus-info-set-entry ,info ,method 4)
1955 `(setcar (nthcdr 4 ,info) ,method)))
1956 (defmacro gnus-info-set-params (info params &optional extend)
1958 `(gnus-info-set-entry ,info ,params 5)
1959 `(setcar (nthcdr 5 ,info) ,params)))
1961 (defun gnus-info-set-entry (info entry number)
1962 ;; Extend the info until we have enough elements.
1963 (while (<= (length info) number)
1964 (nconc info (list nil)))
1966 (setcar (nthcdr number info) entry))
1968 (defmacro gnus-info-set-level (info level)
1969 `(let ((rank (cdr ,info)))
1970 (if (consp (car rank))
1971 (setcar (car rank) ,level)
1972 (setcar rank ,level))))
1973 (defmacro gnus-info-set-score (info score)
1974 `(let ((rank (cdr ,info)))
1975 (if (consp (car rank))
1976 (setcdr (car rank) ,score)
1977 (setcar rank (cons (car rank) ,score)))))
1979 (defmacro gnus-get-info (group)
1980 `(nth 2 (gnus-gethash ,group gnus-newsrc-hashtb)))
1982 ;; Byte-compiler warning.
1983 (defvar gnus-visual)
1984 ;; Find out whether the gnus-visual TYPE is wanted.
1985 (defun gnus-visual-p (&optional type class)
1986 (and gnus-visual ; Has to be non-nil, at least.
1987 (if (not type) ; We don't care about type.
1989 (if (listp gnus-visual) ; It's a list, so we check it.
1990 (or (memq type gnus-visual)
1991 (memq class gnus-visual))
1994 ;;; Load the compatability functions.
2003 (defvar gnus-shutdown-alist nil)
2005 (defun gnus-add-shutdown (function &rest symbols)
2006 "Run FUNCTION whenever one of SYMBOLS is shut down."
2007 (push (cons function symbols) gnus-shutdown-alist))
2009 (defun gnus-shutdown (symbol)
2010 "Shut down everything that waits for SYMBOL."
2011 (let ((alist gnus-shutdown-alist)
2013 (while (setq entry (pop alist))
2014 (when (memq symbol (cdr entry))
2015 (funcall (car entry))))))
2019 ;;; Gnus Utility Functions
2023 (defmacro gnus-string-or (&rest strings)
2024 "Return the first element of STRINGS that is a non-blank string.
2025 STRINGS will be evaluated in normal `or' order."
2026 `(gnus-string-or-1 ',strings))
2028 (defun gnus-string-or-1 (strings)
2031 (setq string (eval (pop strings)))
2032 (if (string-match "^[ \t]*$" string)
2034 (setq strings nil)))
2037 (defun gnus-version (&optional arg)
2038 "Version number of this version of Gnus.
2039 If ARG, insert string at point."
2042 (insert (message gnus-version))
2043 (message gnus-version)))
2045 (defun gnus-continuum-version (version)
2046 "Return VERSION as a floating point number."
2047 (when (or (string-match "^\\([^ ]+\\)? ?Gnus v?\\([0-9.]+\\)$" version)
2048 (string-match "^\\(.?\\)gnus-\\([0-9.]+\\)$" version))
2049 (let ((alpha (and (match-beginning 1) (match-string 1 version)))
2050 (number (match-string 2 version))
2052 (unless (string-match
2053 "\\([0-9]\\)\\.\\([0-9]+\\)\\.?\\([0-9]+\\)?" number)
2054 (error "Invalid version string: %s" version))
2055 (setq major (string-to-number (match-string 1 number))
2056 minor (string-to-number (match-string 2 number))
2057 least (if (match-beginning 3)
2058 (string-to-number (match-string 3 number))
2062 (format "%s00%02d%02d"
2063 (if (member alpha '("(ding)" "d"))
2067 (- (mm-char-int (aref (downcase alpha) 0))
2071 (format "%d.%02d%02d" major minor least))))))
2073 (defun gnus-info-find-node ()
2074 "Find Info documentation of Gnus."
2076 ;; Enlarge info window if needed.
2077 (let (gnus-info-buffer)
2078 (Info-goto-node (cadr (assq major-mode gnus-info-nodes)))
2079 (setq gnus-info-buffer (current-buffer))
2080 (gnus-configure-windows 'info)))
2083 ;;; gnus-interactive
2086 (defvar gnus-current-prefix-symbol nil
2087 "Current prefix symbol.")
2089 (defvar gnus-current-prefix-symbols nil
2090 "List of current prefix symbols.")
2092 (defun gnus-interactive (string &optional params)
2093 "Return a list that can be fed to `interactive'.
2094 See `interactive' for full documentation.
2096 Adds the following specs:
2098 y -- The current symbolic prefix.
2099 Y -- A list of the current symbolic prefix(es).
2100 A -- Article number.
2101 H -- Article header.
2105 (while (< i (length string))
2106 (string-match ".\\([^\n]*\\)\n?" string i)
2107 (setq c (aref string i))
2109 (setq prompt (match-string 1 string)))
2110 (setq i (match-end 0))
2111 ;; We basically emulate just about everything that
2112 ;; `interactive' does, but add the specs listed above.
2116 (completing-read prompt obarray 'fboundp t))
2118 (read-buffer prompt (current-buffer) t))
2120 (read-buffer prompt (other-buffer (current-buffer))))
2124 (completing-read prompt obarray 'commandp t))
2128 (read-file-name prompt nil default-directory 'lambda))
2130 (read-file-name prompt nil nil 'lambda))
2132 (read-file-name prompt))
2134 (read-key-sequence prompt))
2136 (error "Not implemented spec"))
2138 (error "Not implemented spec"))
2142 (error "Not implemented spec"))
2144 (string-to-number (read-from-minibuffer prompt)))
2146 (prefix-numeric-value current-prefix-arg))
2152 (read-string prompt))
2154 (intern (read-string prompt)))
2156 (read-variable prompt))
2158 (read-minibuffer prompt))
2160 (eval-minibuffer prompt))
2161 ;; And here the new specs come.
2163 gnus-current-prefix-symbol)
2165 gnus-current-prefix-symbols)
2167 (gnus-group-group-name))
2169 (gnus-summary-skip-intangible)
2170 (or (get-text-property (point) 'gnus-number)
2171 (gnus-summary-last-subject)))
2173 (gnus-data-header (gnus-data-find (gnus-summary-article-number))))
2175 (error "Non-implemented spec")))
2179 (push (if (< (point) (mark) (point) (mark))) out)
2180 (push (if (> (point) (mark) (point) (mark))) out))))
2181 (setq out (delq 'gnus-prefix-nil out))
2184 (defun gnus-symbolic-argument (&optional arg)
2185 "Read a symbolic argument and a command, and then execute command."
2187 (let* ((in-command (this-command-keys))
2188 (command in-command)
2189 gnus-current-prefix-symbols
2190 gnus-current-prefix-symbol
2192 (while (equal in-command command)
2193 (message "%s-" (key-description (this-command-keys)))
2194 (push (intern (char-to-string (read-char))) syms)
2195 (setq command (read-key-sequence nil t)))
2196 (setq gnus-current-prefix-symbols (nreverse syms)
2197 gnus-current-prefix-symbol (car gnus-current-prefix-symbols))
2198 (call-interactively (key-binding command t))))
2200 ;;; More various functions.
2202 (defsubst gnus-check-backend-function (func group)
2203 "Check whether GROUP supports function FUNC.
2204 GROUP can either be a string (a group name) or a select method."
2206 (let ((method (if (stringp group)
2207 (car (gnus-find-method-for-group group))
2209 (unless (featurep method)
2211 (fboundp (intern (format "%s-%s" method func))))))
2213 (defun gnus-group-read-only-p (&optional group)
2214 "Check whether GROUP supports editing or not.
2215 If GROUP is nil, `gnus-newsgroup-name' will be checked instead. Note
2216 that that variable is buffer-local to the summary buffers."
2217 (let ((group (or group gnus-newsgroup-name)))
2218 (not (gnus-check-backend-function 'request-replace-article group))))
2220 (defun gnus-group-total-expirable-p (group)
2221 "Check whether GROUP is total-expirable or not."
2222 (let ((params (gnus-group-find-parameter group))
2225 ((memq 'total-expire params)
2227 ((setq val (assq 'total-expire params)) ; (auto-expire . t)
2229 (gnus-total-expirable-newsgroups ; Check var.
2230 (string-match gnus-total-expirable-newsgroups group)))))
2232 (defun gnus-group-auto-expirable-p (group)
2233 "Check whether GROUP is auto-expirable or not."
2234 (let ((params (gnus-group-find-parameter group))
2237 ((memq 'auto-expire params)
2239 ((setq val (assq 'auto-expire params)) ; (auto-expire . t)
2241 (gnus-auto-expirable-newsgroups ; Check var.
2242 (string-match gnus-auto-expirable-newsgroups group)))))
2244 (defun gnus-virtual-group-p (group)
2245 "Say whether GROUP is virtual or not."
2246 (memq 'virtual (assoc (symbol-name (car (gnus-find-method-for-group group)))
2247 gnus-valid-select-methods)))
2249 (defun gnus-news-group-p (group &optional article)
2250 "Return non-nil if GROUP (and ARTICLE) come from a news server."
2251 (or (gnus-member-of-valid 'post group) ; Ordinary news group.
2252 (and (gnus-member-of-valid 'post-mail group) ; Combined group.
2253 (if (or (null article)
2254 (not (< article 0)))
2255 (eq (gnus-request-type group article) 'news)
2256 (if (not (vectorp article))
2258 ;; It's a real article.
2259 (eq (gnus-request-type group (mail-header-id article))
2262 ;; Returns a list of writable groups.
2263 (defun gnus-writable-groups ()
2264 (let ((alist gnus-newsrc-alist)
2266 (while (setq group (car (pop alist)))
2267 (unless (gnus-group-read-only-p group)
2268 (push group groups)))
2271 ;; Check whether to use long file names.
2272 (defun gnus-use-long-file-name (symbol)
2273 ;; The variable has to be set...
2274 (and gnus-use-long-file-name
2275 ;; If it isn't a list, then we return t.
2276 (or (not (listp gnus-use-long-file-name))
2277 ;; If it is a list, and the list contains `symbol', we
2279 (not (memq symbol gnus-use-long-file-name)))))
2281 ;; Generate a unique new group name.
2282 (defun gnus-generate-new-group-name (leaf)
2285 (while (gnus-gethash name gnus-newsrc-hashtb)
2286 (setq name (concat leaf "<" (int-to-string (setq num (1+ num))) ">")))
2289 (defun gnus-ephemeral-group-p (group)
2290 "Say whether GROUP is ephemeral or not."
2291 (gnus-group-get-parameter group 'quit-config t))
2293 (defun gnus-group-quit-config (group)
2294 "Return the quit-config of GROUP."
2295 (gnus-group-get-parameter group 'quit-config t))
2297 (defun gnus-kill-ephemeral-group (group)
2298 "Remove ephemeral GROUP from relevant structures."
2299 (gnus-sethash group nil gnus-newsrc-hashtb))
2301 (defun gnus-simplify-mode-line ()
2302 "Make mode lines a bit simpler."
2303 (setq mode-line-modified (cdr gnus-mode-line-modified))
2304 (when (listp mode-line-format)
2305 (make-local-variable 'mode-line-format)
2306 (setq mode-line-format (copy-sequence mode-line-format))
2307 (when (equal (nth 3 mode-line-format) " ")
2308 (setcar (nthcdr 3 mode-line-format) " "))))
2310 ;;; Servers and groups.
2312 (defsubst gnus-server-add-address (method)
2313 (let ((method-name (symbol-name (car method))))
2314 (if (and (memq 'address (assoc method-name gnus-valid-select-methods))
2315 (not (assq (intern (concat method-name "-address")) method))
2316 (memq 'physical-address (assq (car method)
2317 gnus-valid-select-methods)))
2318 (append method (list (list (intern (concat method-name "-address"))
2322 (defsubst gnus-server-get-method (group method)
2323 ;; Input either a server name, and extended server name, or a
2324 ;; select method, and return a select method.
2325 (cond ((stringp method)
2326 (gnus-server-to-method method))
2327 ((equal method gnus-select-method)
2329 ((and (stringp (car method))
2331 (gnus-server-extend-method group method))
2334 (equal (cadr method) ""))
2337 (gnus-server-add-address method))))
2339 (defun gnus-server-to-method (server)
2340 "Map virtual server names to select methods."
2342 ;; Is this a method, perhaps?
2343 (and server (listp server) server)
2344 ;; Perhaps this is the native server?
2345 (and (equal server "native") gnus-select-method)
2346 ;; It should be in the server alist.
2347 (cdr (assoc server gnus-server-alist))
2348 ;; It could be in the predefined server alist.
2349 (cdr (assoc server gnus-predefined-server-alist))
2350 ;; If not, we look through all the opened server
2351 ;; to see whether we can find it there.
2352 (let ((opened gnus-opened-servers))
2354 (not (equal server (format "%s:%s" (caaar opened)
2358 ;; It could be a named method, search all servers
2359 (let ((servers gnus-secondary-select-methods))
2361 (not (equal server (format "%s:%s" (caar servers)
2366 (defmacro gnus-method-equal (ss1 ss2)
2367 "Say whether two servers are equal."
2371 (and (= (length s1) (length s2))
2373 (while (and s1 (member (car s1) s2))
2377 (defun gnus-methods-equal-p (m1 m2)
2378 (let ((m1 (or m1 gnus-select-method))
2379 (m2 (or m2 gnus-select-method)))
2381 (and (eq (car m1) (car m2))
2382 (or (not (memq 'address (assoc (symbol-name (car m1))
2383 gnus-valid-select-methods)))
2384 (equal (nth 1 m1) (nth 1 m2)))))))
2386 (defun gnus-server-equal (m1 m2)
2387 "Say whether two methods are equal."
2388 (let ((m1 (cond ((null m1) gnus-select-method)
2389 ((stringp m1) (gnus-server-to-method m1))
2391 (m2 (cond ((null m2) gnus-select-method)
2392 ((stringp m2) (gnus-server-to-method m2))
2394 (gnus-method-equal m1 m2)))
2396 (defun gnus-servers-using-backend (backend)
2397 "Return a list of known servers using BACKEND."
2398 (let ((opened gnus-opened-servers)
2401 (when (eq backend (caaar opened))
2402 (push (caar opened) out))
2406 (defun gnus-archive-server-wanted-p ()
2407 "Say whether the user wants to use the archive server."
2409 ((or (not gnus-message-archive-method)
2410 (not gnus-message-archive-group))
2412 ((and gnus-message-archive-method gnus-message-archive-group)
2415 (let ((active (cadr (assq 'nnfolder-active-file
2416 gnus-message-archive-method))))
2418 (file-exists-p active))))))
2420 (defun gnus-group-prefixed-name (group method)
2421 "Return the whole name from GROUP and METHOD."
2422 (and (stringp method) (setq method (gnus-server-to-method method)))
2423 (if (or (not method)
2424 (gnus-server-equal method "native"))
2426 (concat (format "%s" (car method))
2428 (or (assoc (format "%s" (car method))
2429 (gnus-methods-using 'address))
2430 (gnus-server-equal method gnus-message-archive-method))
2432 (not (string= (nth 1 method) "")))
2433 (concat "+" (nth 1 method)))
2436 (defun gnus-group-real-prefix (group)
2437 "Return the prefix of the current group name."
2438 (if (string-match "^[^:]+:" group)
2439 (substring group 0 (match-end 0))
2442 (defun gnus-group-method (group)
2443 "Return the server or method used for selecting GROUP.
2444 You should probably use `gnus-find-method-for-group' instead."
2445 (let ((prefix (gnus-group-real-prefix group)))
2446 (if (equal prefix "")
2448 (let ((servers gnus-opened-servers)
2450 backend possible found)
2451 (if (string-match "^[^\\+]+\\+" prefix)
2452 (setq backend (intern (substring prefix 0 (1- (match-end 0))))
2453 server (substring prefix (match-end 0) (1- (length prefix))))
2454 (setq backend (intern (substring prefix 0 (1- (length prefix))))))
2456 (when (eq (caaar servers) backend)
2457 (setq possible (caar servers))
2458 (when (equal (cadaar servers) server)
2459 (setq found (caar servers))))
2461 (or (car (rassoc found gnus-server-alist))
2463 (car (rassoc possible gnus-server-alist))
2465 (list backend server))))))
2467 (defsubst gnus-native-method-p (method)
2468 "Return whether METHOD is the native select method."
2469 (gnus-method-equal method gnus-select-method))
2471 (defsubst gnus-secondary-method-p (method)
2472 "Return whether METHOD is a secondary select method."
2473 (let ((methods gnus-secondary-select-methods)
2474 (gmethod (gnus-server-get-method nil method)))
2476 (not (gnus-method-equal
2477 (gnus-server-get-method nil (car methods))
2479 (setq methods (cdr methods)))
2482 (defun gnus-method-simplify (method)
2483 "Return the shortest uniquely identifying string or method for METHOD."
2484 (cond ((stringp method)
2486 ((gnus-native-method-p method)
2488 ((gnus-secondary-method-p method)
2489 (format "%s:%s" (nth 0 method) (nth 1 method)))
2493 (defun gnus-groups-from-server (server)
2494 "Return a list of all groups that are fetched from SERVER."
2495 (let ((alist (cdr gnus-newsrc-alist))
2497 (while (setq info (pop alist))
2498 (when (gnus-server-equal (gnus-info-method info) server)
2499 (push (gnus-info-group info) groups)))
2500 (sort groups 'string<)))
2502 (defun gnus-group-foreign-p (group)
2503 "Say whether a group is foreign or not."
2504 (and (not (gnus-group-native-p group))
2505 (not (gnus-group-secondary-p group))))
2507 (defun gnus-group-native-p (group)
2508 "Say whether the group is native or not."
2509 (not (string-match ":" group)))
2511 (defun gnus-group-secondary-p (group)
2512 "Say whether the group is secondary or not."
2513 (gnus-secondary-method-p (gnus-find-method-for-group group)))
2515 (defun gnus-group-find-parameter (group &optional symbol allow-list)
2516 "Return the group parameters for GROUP.
2517 If SYMBOL, return the value of that symbol in the group parameters."
2519 (set-buffer gnus-group-buffer)
2520 (let ((parameters (funcall gnus-group-get-parameter-function group)))
2522 (gnus-group-parameter-value parameters symbol allow-list)
2525 (defun gnus-group-get-parameter (group &optional symbol allow-list)
2526 "Return the group parameters for GROUP.
2527 If SYMBOL, return the value of that symbol in the group parameters.
2528 Most functions should use `gnus-group-find-parameter', which
2529 also examines the topic parameters."
2530 (let ((params (gnus-info-params (gnus-get-info group))))
2532 (gnus-group-parameter-value params symbol allow-list)
2535 (defun gnus-group-parameter-value (params symbol &optional allow-list)
2536 "Return the value of SYMBOL in group PARAMS."
2537 ;; We only wish to return group parameters (dotted lists) and
2538 ;; not local variables, which may have the same names.
2539 ;; But first we handle single elements...
2540 (or (car (memq symbol params))
2544 (while (setq elem (pop params))
2545 (when (and (consp elem)
2546 (eq (car elem) symbol)
2549 (throw 'found (cdr elem))))))))
2551 (defun gnus-group-add-parameter (group param)
2552 "Add parameter PARAM to GROUP."
2553 (let ((info (gnus-get-info group)))
2555 (gnus-group-remove-parameter group (if (consp param) (car param) param))
2556 ;; Cons the new param to the old one and update.
2557 (gnus-group-set-info (cons param (gnus-info-params info))
2560 (defun gnus-group-set-parameter (group name value)
2561 "Set parameter NAME to VALUE in GROUP."
2562 (let ((info (gnus-get-info group)))
2564 (gnus-group-remove-parameter group name)
2565 (let ((old-params (gnus-info-params info))
2566 (new-params (list (cons name value))))
2568 (when (or (not (listp (car old-params)))
2569 (not (eq (caar old-params) name)))
2570 (setq new-params (append new-params (list (car old-params)))))
2571 (setq old-params (cdr old-params)))
2572 (gnus-group-set-info new-params group 'params)))))
2574 (defun gnus-group-remove-parameter (group name)
2575 "Remove parameter NAME from GROUP."
2576 (let ((info (gnus-get-info group)))
2578 (let ((params (gnus-info-params info)))
2580 (setq params (delq name params))
2581 (while (assq name params)
2582 (gnus-pull name params))
2583 (gnus-info-set-params info params))))))
2585 (defun gnus-group-add-score (group &optional score)
2586 "Add SCORE to the GROUP score.
2587 If SCORE is nil, add 1 to the score of GROUP."
2588 (let ((info (gnus-get-info group)))
2590 (gnus-info-set-score info (+ (gnus-info-score info) (or score 1))))))
2592 (defun gnus-short-group-name (group &optional levels)
2593 "Collapse GROUP name LEVELS.
2594 Select methods are stripped and any remote host name is stripped down to
2595 just the host name."
2601 gnus-group-uncollapsed-levels
2603 (while (string-match "\\." group skip)
2604 (setq skip (match-end 0)
2607 ;; Separate foreign select method from group name and collapse.
2608 ;; If method contains a server, collapse to non-domain server name,
2609 ;; otherwise collapse to select method.
2610 (let* ((colon (string-match ":" group))
2611 (server (and colon (substring group 0 colon)))
2612 (plus (and server (string-match "+" server))))
2615 (setq foreign (substring server (+ 1 plus)
2616 (string-match "\\." server))
2617 group (substring group (+ 1 colon)))
2618 (setq foreign server
2619 group (substring group (+ 1 colon))))
2620 (setq foreign (concat foreign ":")))
2621 ;; Collapse group name leaving LEVELS uncollapsed elements
2622 (let* ((glist (split-string group "\\."))
2623 (glen (length glist))
2625 (setq levels (- glen levels))
2627 (push (if (>= (decf levels) 0)
2628 (if (zerop (length g))
2633 (concat foreign (mapconcat 'identity (nreverse res) "."))))))
2635 (defun gnus-narrow-to-body ()
2636 "Narrow to the body of an article."
2639 (goto-char (point-min))
2640 (or (search-forward "\n\n" nil t)
2646 ;;; Kill file handling.
2649 (defun gnus-apply-kill-file ()
2650 "Apply a kill file to the current newsgroup.
2651 Returns the number of articles marked as read."
2652 (if (or (file-exists-p (gnus-newsgroup-kill-file nil))
2653 (file-exists-p (gnus-newsgroup-kill-file gnus-newsgroup-name)))
2654 (gnus-apply-kill-file-internal)
2657 (defun gnus-kill-save-kill-buffer ()
2658 (let ((file (gnus-newsgroup-kill-file gnus-newsgroup-name)))
2659 (when (get-file-buffer file)
2661 (set-buffer (get-file-buffer file))
2662 (when (buffer-modified-p)
2664 (kill-buffer (current-buffer))))))
2666 (defcustom gnus-kill-file-name "KILL"
2667 "Suffix of the kill files."
2668 :group 'gnus-score-kill
2669 :group 'gnus-score-files
2672 (defun gnus-newsgroup-kill-file (newsgroup)
2673 "Return the name of a kill file name for NEWSGROUP.
2674 If NEWSGROUP is nil, return the global kill file name instead."
2676 ;; The global KILL file is placed at top of the directory.
2677 ((or (null newsgroup)
2678 (string-equal newsgroup ""))
2679 (expand-file-name gnus-kill-file-name
2680 gnus-kill-files-directory))
2681 ;; Append ".KILL" to newsgroup name.
2682 ((gnus-use-long-file-name 'not-kill)
2683 (expand-file-name (concat (gnus-newsgroup-savable-name newsgroup)
2684 "." gnus-kill-file-name)
2685 gnus-kill-files-directory))
2686 ;; Place "KILL" under the hierarchical directory.
2688 (expand-file-name (concat (gnus-newsgroup-directory-form newsgroup)
2689 "/" gnus-kill-file-name)
2690 gnus-kill-files-directory))))
2694 (defun gnus-member-of-valid (symbol group)
2695 "Find out if GROUP has SYMBOL as part of its \"valid\" spec."
2697 (symbol-name (car (gnus-find-method-for-group group)))
2698 gnus-valid-select-methods)))
2700 (defun gnus-method-option-p (method option)
2701 "Return non-nil if select METHOD has OPTION as a parameter."
2702 (when (stringp method)
2703 (setq method (gnus-server-to-method method)))
2704 (memq option (assoc (format "%s" (car method))
2705 gnus-valid-select-methods)))
2707 (defun gnus-similar-server-opened (method)
2708 (let ((opened gnus-opened-servers))
2709 (while (and method opened)
2710 (when (and (equal (cadr method) (cadaar opened))
2711 (equal (car method) (caaar opened))
2712 (not (equal method (caar opened))))
2717 (defun gnus-server-extend-method (group method)
2718 ;; This function "extends" a virtual server. If the server is
2719 ;; "hello", and the select method is ("hello" (my-var "something"))
2720 ;; in the group "alt.alt", this will result in a new virtual server
2721 ;; called "hello+alt.alt".
2722 (if (or (not (inline (gnus-similar-server-opened method)))
2723 (not (cddr method)))
2725 `(,(car method) ,(concat (cadr method) "+" group)
2726 (,(intern (format "%s-address" (car method))) ,(cadr method))
2729 (defun gnus-server-status (method)
2730 "Return the status of METHOD."
2731 (nth 1 (assoc method gnus-opened-servers)))
2733 (defun gnus-group-name-to-method (group)
2734 "Guess a select method based on GROUP."
2735 (if (string-match ":" group)
2736 (let ((server (substring group 0 (match-beginning 0))))
2737 (if (string-match "\\+" server)
2738 (list (intern (substring server 0 (match-beginning 0)))
2739 (substring server (match-end 0)))
2740 (list (intern server) "")))
2741 gnus-select-method))
2743 (defun gnus-find-method-for-group (group &optional info)
2744 "Find the select method that GROUP uses."
2745 (or gnus-override-method
2748 (and (not (gnus-group-entry group));; a new group
2749 (gnus-group-name-to-method group))
2750 (let ((info (or info (gnus-get-info group)))
2753 (not (setq method (gnus-info-method info)))
2754 (equal method "native"))
2757 (cond ((stringp method)
2758 (inline (gnus-server-to-method method)))
2759 ((stringp (cadr method))
2760 (inline (gnus-server-extend-method group method)))
2763 (cond ((equal (cadr method) "")
2765 ((null (cadr method))
2766 (list (car method) ""))
2768 (gnus-server-add-address method)))))))
2770 (defun gnus-methods-using (feature)
2771 "Find all methods that have FEATURE."
2772 (let ((valids gnus-valid-select-methods)
2775 (when (memq feature (car valids))
2776 (push (car valids) outs))
2777 (setq valids (cdr valids)))
2780 (defun gnus-read-group (prompt &optional default)
2781 "Prompt the user for a group name.
2782 Disallow invalid group names."
2788 (setq group (read-string (concat prefix prompt)
2789 (cons (or default "") 0)
2790 'gnus-group-history)))
2791 (setq prefix (format "Invalid group name: \"%s\". " group)
2795 (defun gnus-read-method (prompt)
2796 "Prompt the user for a method.
2797 Allow completion over sensible values."
2799 (append gnus-valid-select-methods
2800 (mapcar (lambda (i) (list (format "%s:%s" (caar i)
2802 gnus-opened-servers)
2803 gnus-predefined-server-alist
2808 nil t nil 'gnus-method-history)))
2811 (setq method gnus-select-method))
2812 ((assoc method gnus-valid-select-methods)
2813 (let ((address (if (memq 'prompt-address
2814 (assoc method gnus-valid-select-methods))
2815 (read-string "Address: ")
2817 (or (let ((opened gnus-opened-servers))
2819 (not (equal (format "%s:%s" method address)
2820 (format "%s:%s" (caaar opened)
2824 (list (intern method) address))))
2825 ((assoc method servers)
2828 (list (intern method) "")))))
2830 ;;; User-level commands.
2833 (defun gnus-slave-no-server (&optional arg)
2834 "Read network news as a slave, without connecting to local server."
2836 (gnus-no-server arg t))
2839 (defun gnus-no-server (&optional arg slave)
2841 If ARG is a positive number, Gnus will use that as the
2842 startup level. If ARG is nil, Gnus will be started at level 2.
2843 If ARG is non-nil and not a positive number, Gnus will
2844 prompt the user for the name of an NNTP server to use.
2845 As opposed to `gnus', this command will not connect to the local server."
2847 (gnus-no-server-1 arg slave))
2850 (defun gnus-slave (&optional arg)
2851 "Read news as a slave."
2853 (gnus arg nil 'slave))
2856 (defun gnus-other-frame (&optional arg)
2857 "Pop up a frame to read news."
2859 (let ((window (get-buffer-window gnus-group-buffer)))
2861 (select-frame (window-frame window)))
2863 (select-frame (make-frame)))))
2866 ;;(setq thing ? ; this is a comment
2870 (defun gnus (&optional arg dont-connect slave)
2872 If ARG is non-nil and a positive number, Gnus will use that as the
2873 startup level. If ARG is non-nil and not a positive number, Gnus will
2874 prompt the user for the name of an NNTP server to use."
2876 (gnus-1 arg dont-connect slave))
2878 ;; Allow redefinition of Gnus functions.
2884 ;;; gnus.el ends here