1 ;;; gnus.el --- a newsreader for GNU Emacs
2 ;; Copyright (C) 1987,88,89,90,93,94,95,96,97 Free Software Foundation, Inc.
4 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
5 ;; Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
6 ;; Keywords: news, mail
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
29 (eval '(run-hooks 'gnus-load-hook))
35 "The coffee-brewing, all singing, all dancing, kitchen sink newsreader."
39 (defgroup gnus-start nil
40 "Starting your favorite newsreader."
43 (defgroup gnus-start-server nil
44 "Server options at startup."
47 ;; These belong to gnus-group.el.
48 (defgroup gnus-group nil
50 :link '(custom-manual "(gnus)The Group Buffer")
53 (defgroup gnus-group-foreign nil
55 :link '(custom-manual "(gnus)Foreign Groups")
58 (defgroup gnus-group-new nil
59 "Automatic subscription of new groups."
62 (defgroup gnus-group-levels nil
64 :link '(custom-manual "(gnus)Group Levels")
67 (defgroup gnus-group-select nil
69 :link '(custom-manual "(gnus)Selecting a Group")
72 (defgroup gnus-group-listing nil
73 "Showing slices of the group list."
74 :link '(custom-manual "(gnus)Listing Groups")
77 (defgroup gnus-group-visual nil
78 "Sorting the group buffer."
79 :link '(custom-manual "(gnus)Group Buffer Format")
83 (defgroup gnus-group-various nil
84 "Various group options."
85 :link '(custom-manual "(gnus)Scanning New Messages")
88 ;; These belong to gnus-sum.el.
89 (defgroup gnus-summary nil
91 :link '(custom-manual "(gnus)The Summary Buffer")
94 (defgroup gnus-summary-exit nil
95 "Leaving summary buffers."
96 :link '(custom-manual "(gnus)Exiting the Summary Buffer")
99 (defgroup gnus-summary-marks nil
100 "Marks used in summary buffers."
101 :link '(custom-manual "(gnus)Marking Articles")
102 :group 'gnus-summary)
104 (defgroup gnus-thread nil
105 "Ordering articles according to replies."
106 :link '(custom-manual "(gnus)Threading")
107 :group 'gnus-summary)
109 (defgroup gnus-summary-format nil
110 "Formatting of the summary buffer."
111 :link '(custom-manual "(gnus)Summary Buffer Format")
112 :group 'gnus-summary)
114 (defgroup gnus-summary-choose nil
116 :link '(custom-manual "(gnus)Choosing Articles")
117 :group 'gnus-summary)
119 (defgroup gnus-summary-maneuvering nil
120 "Summary movement commands."
121 :link '(custom-manual "(gnus)Summary Maneuvering")
122 :group 'gnus-summary)
124 (defgroup gnus-summary-mail nil
125 "Mail group commands."
126 :link '(custom-manual "(gnus)Mail Group Commands")
127 :group 'gnus-summary)
129 (defgroup gnus-summary-sort nil
130 "Sorting the summary buffer."
131 :link '(custom-manual "(gnus)Sorting")
132 :group 'gnus-summary)
134 (defgroup gnus-summary-visual nil
135 "Highlighting and menus in the summary buffer."
136 :link '(custom-manual "(gnus)Summary Highlighting")
138 :group 'gnus-summary)
140 (defgroup gnus-summary-various nil
141 "Various summary buffer options."
142 :link '(custom-manual "(gnus)Various Summary Stuff")
143 :group 'gnus-summary)
145 ;; Belongs to gnus-uu.el
146 (defgroup gnus-extract-view nil
147 "Viewing extracted files."
148 :link '(custom-manual "(gnus)Viewing Files")
149 :group 'gnus-extract)
151 ;; Belongs to gnus-score.el
152 (defgroup gnus-score nil
153 "Score and kill file handling."
156 (defgroup gnus-score-kill nil
160 (defgroup gnus-score-adapt nil
161 "Adaptive score files."
164 (defgroup gnus-score-default nil
165 "Default values for score files."
168 (defgroup gnus-score-expire nil
169 "Expiring score rules."
172 (defgroup gnus-score-decay nil
173 "Decaying score rules."
176 (defgroup gnus-score-files nil
177 "Score and kill file names."
181 (defgroup gnus-score-various nil
182 "Various scoring and killing options."
186 (defgroup gnus-visual nil
187 "Options controling the visual fluff."
191 (defgroup gnus-files nil
192 "Files used by Gnus."
195 (defgroup gnus-dribble-file nil
197 :link '(custom-manual "(gnus)Auto Save")
200 (defgroup gnus-newsrc nil
201 "Storing Gnus state."
204 (defgroup gnus-server nil
205 "Options related to newsservers and other servers used by Gnus."
208 (defgroup gnus-message '((message custom-group))
209 "Composing replies and followups in Gnus."
212 (defgroup gnus-meta nil
213 "Meta variables controling major portions of Gnus.
214 In general, modifying these variables does not take affect until Gnus
215 is restarted, and sometimes reloaded."
218 (defgroup gnus-various nil
219 "Other Gnus options."
220 :link '(custom-manual "(gnus)Various Various")
223 (defgroup gnus-exit nil
225 :link '(custom-manual "(gnus)Exiting Gnus")
228 (defconst gnus-version-number "5.4.17"
229 "Version number for this version of Gnus.")
231 (defconst gnus-version (format "Gnus v%s" gnus-version-number)
232 "Version string for this version of Gnus.")
234 (defcustom gnus-inhibit-startup-message nil
235 "If non-nil, the startup message will not be displayed.
236 This variable is used before `.gnus.el' is loaded, so it should
237 be set in `.emacs' instead."
241 (defcustom gnus-play-startup-jingle nil
242 "If non-nil, play the Gnus jingle at startup."
246 ;;; Kludges to help the transition from the old `custom.el'.
248 (unless (featurep 'gnus-xmas)
249 (defalias 'gnus-make-overlay 'make-overlay)
250 (defalias 'gnus-overlay-put 'overlay-put)
251 (defalias 'gnus-move-overlay 'move-overlay)
252 (defalias 'gnus-overlay-end 'overlay-end)
253 (defalias 'gnus-extent-detached-p 'ignore)
254 (defalias 'gnus-extent-start-open 'ignore)
255 (defalias 'gnus-set-text-properties 'set-text-properties)
256 (defalias 'gnus-group-remove-excess-properties 'ignore)
257 (defalias 'gnus-topic-remove-excess-properties 'ignore)
258 (defalias 'gnus-appt-select-lowest-window 'appt-select-lowest-window)
259 (defalias 'gnus-mail-strip-quoted-names 'mail-strip-quoted-names)
260 (defalias 'gnus-add-hook 'add-hook)
261 (defalias 'gnus-character-to-event 'identity)
262 (defalias 'gnus-add-text-properties 'add-text-properties)
263 (defalias 'gnus-put-text-property 'put-text-property)
264 (defalias 'gnus-mode-line-buffer-identification 'identity)
265 (defalias 'gnus-characterp 'numberp)
266 (defalias 'gnus-key-press-event-p 'numberp))
268 ;; The XEmacs people think this is evil, so it must go.
269 (defun custom-face-lookup (&optional fg bg stipple bold italic underline)
270 "Lookup or create a face with specified attributes."
271 (let ((name (intern (format "custom-face-%s-%s-%s-%S-%S-%S"
274 (or stipple "default")
275 bold italic underline))))
276 (if (and (custom-facep name)
277 (fboundp 'make-face))
279 (copy-face 'default name)
281 (not (string-equal fg "default")))
283 (set-face-foreground name fg)))
285 (not (string-equal bg "default")))
287 (set-face-background name bg)))
289 (not (string-equal stipple "default"))
290 (not (eq stipple 'custom:asis))
291 (fboundp 'set-face-stipple))
292 (set-face-stipple name stipple))
294 (not (eq bold 'custom:asis)))
296 (make-face-bold name)))
298 (not (eq italic 'custom:asis)))
300 (make-face-italic name)))
302 (not (eq underline 'custom:asis)))
304 (set-face-underline-p name t))))
307 ;; We define these group faces here to avoid the display
308 ;; update forced when creating new faces.
310 (defface gnus-group-news-1-face
313 (:foreground "PaleTurquoise" :bold t))
316 (:foreground "ForestGreen" :bold t))
319 "Level 1 newsgroup face.")
321 (defface gnus-group-news-1-empty-face
324 (:foreground "PaleTurquoise"))
327 (:foreground "ForestGreen"))
330 "Level 1 empty newsgroup face.")
332 (defface gnus-group-news-2-face
335 (:foreground "turquoise" :bold t))
338 (:foreground "CadetBlue4" :bold t))
341 "Level 2 newsgroup face.")
343 (defface gnus-group-news-2-empty-face
346 (:foreground "turquoise"))
349 (:foreground "CadetBlue4"))
352 "Level 2 empty newsgroup face.")
354 (defface gnus-group-news-3-face
363 "Level 3 newsgroup face.")
365 (defface gnus-group-news-3-empty-face
374 "Level 3 empty newsgroup face.")
376 (defface gnus-group-news-low-face
379 (:foreground "DarkTurquoise" :bold t))
382 (:foreground "DarkGreen" :bold t))
385 "Low level newsgroup face.")
387 (defface gnus-group-news-low-empty-face
390 (:foreground "DarkTurquoise"))
393 (:foreground "DarkGreen"))
396 "Low level empty newsgroup face.")
398 (defface gnus-group-mail-1-face
401 (:foreground "aquamarine1" :bold t))
404 (:foreground "DeepPink3" :bold t))
407 "Level 1 mailgroup face.")
409 (defface gnus-group-mail-1-empty-face
412 (:foreground "aquamarine1"))
415 (:foreground "DeepPink3"))
417 (:italic t :bold t)))
418 "Level 1 empty mailgroup face.")
420 (defface gnus-group-mail-2-face
423 (:foreground "aquamarine2" :bold t))
426 (:foreground "HotPink3" :bold t))
429 "Level 2 mailgroup face.")
431 (defface gnus-group-mail-2-empty-face
434 (:foreground "aquamarine2"))
437 (:foreground "HotPink3"))
440 "Level 2 empty mailgroup face.")
442 (defface gnus-group-mail-3-face
445 (:foreground "aquamarine3" :bold t))
448 (:foreground "magenta4" :bold t))
451 "Level 3 mailgroup face.")
453 (defface gnus-group-mail-3-empty-face
456 (:foreground "aquamarine3"))
459 (:foreground "magenta4"))
462 "Level 3 empty mailgroup face.")
464 (defface gnus-group-mail-low-face
467 (:foreground "aquamarine4" :bold t))
470 (:foreground "DeepPink4" :bold t))
473 "Low level mailgroup face.")
475 (defface gnus-group-mail-low-empty-face
478 (:foreground "aquamarine4"))
481 (:foreground "DeepPink4"))
484 "Low level empty mailgroup face.")
486 ;; Summary mode faces.
488 (defface gnus-summary-selected-face '((t
490 "Face used for selected articles.")
492 (defface gnus-summary-cancelled-face
494 (:foreground "yellow" :background "black")))
495 "Face used for cancelled articles.")
497 (defface gnus-summary-high-ticked-face
500 (:foreground "pink" :bold t))
503 (:foreground "firebrick" :bold t))
506 "Face used for high interest ticked articles.")
508 (defface gnus-summary-low-ticked-face
511 (:foreground "pink" :italic t))
514 (:foreground "firebrick" :italic t))
517 "Face used for low interest ticked articles.")
519 (defface gnus-summary-normal-ticked-face
522 (:foreground "pink"))
525 (:foreground "firebrick"))
528 "Face used for normal interest ticked articles.")
530 (defface gnus-summary-high-ancient-face
533 (:foreground "SkyBlue" :bold t))
536 (:foreground "RoyalBlue" :bold t))
539 "Face used for high interest ancient articles.")
541 (defface gnus-summary-low-ancient-face
544 (:foreground "SkyBlue" :italic t))
547 (:foreground "RoyalBlue" :italic t))
550 "Face used for low interest ancient articles.")
552 (defface gnus-summary-normal-ancient-face
555 (:foreground "SkyBlue"))
558 (:foreground "RoyalBlue"))
561 "Face used for normal interest ancient articles.")
563 (defface gnus-summary-high-unread-face
566 "Face used for high interest unread articles.")
568 (defface gnus-summary-low-unread-face
571 "Face used for low interest unread articles.")
573 (defface gnus-summary-normal-unread-face
576 "Face used for normal interest unread articles.")
578 (defface gnus-summary-high-read-face
581 (:foreground "PaleGreen"
585 (:foreground "DarkGreen"
589 "Face used for high interest read articles.")
591 (defface gnus-summary-low-read-face
594 (:foreground "PaleGreen"
598 (:foreground "DarkGreen"
602 "Face used for low interest read articles.")
604 (defface gnus-summary-normal-read-face
607 (:foreground "PaleGreen"))
610 (:foreground "DarkGreen"))
613 "Face used for normal interest read articles.")
618 (defvar gnus-group-buffer "*Group*")
621 (autoload 'gnus-play-jingle "gnus-audio"))
623 (defface gnus-splash-face
632 "Level 1 newsgroup face.")
634 (defun gnus-splash ()
636 (switch-to-buffer gnus-group-buffer)
637 (let ((buffer-read-only nil))
639 (unless gnus-inhibit-startup-message
640 (gnus-group-startup-message)
642 (when gnus-play-startup-jingle
643 (gnus-play-jingle))))))
645 (defun gnus-indent-rigidly (start end arg)
646 "Indent rigidly using only spaces and no tabs."
649 (narrow-to-region start end)
650 (indent-rigidly start end arg)
651 ;; We translate tabs into spaces -- not everybody uses
652 ;; an 8-character tab.
653 (goto-char (point-min))
654 (while (search-forward "\t" nil t)
655 (replace-match " " t t)))))
657 (defvar gnus-simple-splash nil)
659 (defun gnus-group-startup-message (&optional x y)
660 "Insert startup message in current buffer."
661 ;; Insert the message.
666 _ ___ __ ___ __ _ ___
686 (gnus-indent-rigidly (point-min) (point-max)
687 (/ (max (- (window-width) (or x 46)) 0) 2))
688 (goto-char (point-min))
690 (let* ((pheight (count-lines (point-min) (point-max)))
691 (wheight (window-height))
692 (rest (- wheight pheight)))
693 (insert (make-string (max 0 (* 2 (/ rest 3))) ?\n)))
695 (put-text-property (point-min) (point-max) 'face 'gnus-splash-face)
696 (goto-char (point-min))
697 (setq mode-line-buffer-identification (concat " " gnus-version))
698 (setq gnus-simple-splash t)
699 (set-buffer-modified-p t))
702 (let ((command (format "%s" this-command)))
703 (when (and (string-match "gnus" command)
704 (not (string-match "gnus-other-frame" command)))
713 (defcustom gnus-directory (or (getenv "SAVEDIR") "~/News/")
714 "Directory variable from which all other Gnus file variables are derived."
718 (defcustom gnus-default-directory nil
719 "*Default directory for all Gnus buffers."
721 :type '(choice (const :tag "current" nil)
724 ;; Site dependent variables. These variables should be defined in
727 (defvar gnus-default-nntp-server nil
728 "Specify a default NNTP server.
729 This variable should be defined in paths.el, and should never be set
731 If you want to change servers, you should use `gnus-select-method'.
732 See the documentation to that variable.")
734 ;; Don't touch this variable.
735 (defvar gnus-nntp-service "nntp"
736 "NNTP service name (\"nntp\" or 119).
737 This is an obsolete variable, which is scarcely used. If you use an
738 nntp server for your newsgroup and want to change the port number
739 used to 899, you would say something along these lines:
741 (setq gnus-select-method '(nntp \"my.nntp.server\" (nntp-port-number 899)))")
743 (defcustom gnus-nntpserver-file "/etc/nntpserver"
744 "A file with only the name of the nntp server in it."
749 ;; This function is used to check both the environment variable
750 ;; NNTPSERVER and the /etc/nntpserver file to see whether one can find
751 ;; an nntp server name default.
752 (defun gnus-getenv-nntpserver ()
753 (or (getenv "NNTPSERVER")
754 (and (file-readable-p gnus-nntpserver-file)
756 (set-buffer (get-buffer-create " *gnus nntp*"))
757 (buffer-disable-undo (current-buffer))
758 (insert-file-contents gnus-nntpserver-file)
759 (let ((name (buffer-string)))
761 (if (string-match "^[ \t\n]*$" name)
764 (kill-buffer (current-buffer))))))))
766 (defcustom gnus-select-method
769 (list 'nntp (or (ignore-errors
770 (gnus-getenv-nntpserver))
771 (when (and gnus-default-nntp-server
772 (not (string= gnus-default-nntp-server "")))
773 gnus-default-nntp-server)
775 (if (or (null gnus-nntp-service)
776 (equal gnus-nntp-service "nntp"))
778 (list gnus-nntp-service))))
779 "Default method for selecting a newsgroup.
780 This variable should be a list, where the first element is how the
781 news is to be fetched, the second is the address.
783 For instance, if you want to get your news via NNTP from
784 \"flab.flab.edu\", you could say:
786 \(setq gnus-select-method '(nntp \"flab.flab.edu\"))
788 If you want to use your local spool, say:
790 \(setq gnus-select-method (list 'nnspool (system-name)))
792 If you use this variable, you must set `gnus-nntp-server' to nil.
794 There is a lot more to know about select methods and virtual servers -
795 see the manual for details."
797 :type 'gnus-select-method)
799 (defcustom gnus-message-archive-method
802 (nnfolder-directory ,(nnheader-concat message-directory "archive"))
803 (nnfolder-active-file
804 ,(nnheader-concat message-directory "archive/active"))
805 (nnfolder-get-new-mail nil)
806 (nnfolder-inhibit-expiry t))
807 "Method used for archiving messages you've sent.
808 This should be a mail method.
810 It's probably not a very effective to change this variable once you've
811 run Gnus once. After doing that, you must edit this server from the
815 :type 'gnus-select-method)
817 (defcustom gnus-message-archive-group nil
818 "*Name of the group in which to save the messages you've written.
819 This can either be a string, a list of strings; or an alist
820 of regexps/functions/forms to be evaluated to return a string (or a list
821 of strings). The functions are called with the name of the current
822 group (or nil) as a parameter.
824 If you want to save your mail in one group and the news articles you
825 write in another group, you could say something like:
827 \(setq gnus-message-archive-group
828 '((if (message-news-p)
832 Normally the group names returned by this variable should be
833 unprefixed -- which implicitly means \"store on the archive server\".
834 However, you may wish to store the message on some other server. In
835 that case, just return a fully prefixed name of the group --
836 \"nnml+private:mail.misc\", for instance."
838 :type '(choice (const :tag "none" nil)
841 (defcustom gnus-secondary-servers nil
842 "List of NNTP servers that the user can choose between interactively.
843 To make Gnus query you for a server, you have to give `gnus' a
844 non-numeric prefix - `C-u M-x gnus', in short."
846 :type '(repeat string))
848 (defcustom gnus-nntp-server nil
849 "*The name of the host running the NNTP server.
850 This variable is semi-obsolete. Use the `gnus-select-method'
853 :type '(choice (const :tag "disable" nil)
856 (defcustom gnus-secondary-select-methods nil
857 "A list of secondary methods that will be used for reading news.
858 This is a list where each element is a complete select method (see
859 `gnus-select-method').
861 If, for instance, you want to read your mail with the nnml backend,
862 you could set this variable:
864 \(setq gnus-secondary-select-methods '((nnml \"\")))"
866 :type '(repeat gnus-select-method))
868 (defvar gnus-backup-default-subscribed-newsgroups
869 '("news.announce.newusers" "news.groups.questions" "gnu.emacs.gnus")
870 "Default default new newsgroups the first time Gnus is run.
871 Should be set in paths.el, and shouldn't be touched by the user.")
873 (defcustom gnus-local-domain nil
874 "Local domain name without a host name.
875 The DOMAINNAME environment variable is used instead if it is defined.
876 If the `system-name' function returns the full Internet name, there is
877 no need to set this variable."
879 :type '(choice (const :tag "default" nil)
882 (defcustom gnus-local-organization nil
883 "String with a description of what organization (if any) the user belongs to.
884 The ORGANIZATION environment variable is used instead if it is defined.
885 If this variable contains a function, this function will be called
886 with the current newsgroup name as the argument. The function should
889 In any case, if the string (either in the variable, in the environment
890 variable, or returned by the function) is a file name, the contents of
891 this file will be used as the organization."
893 :type '(choice (const :tag "default" nil)
896 ;; Customization variables
898 (defcustom gnus-refer-article-method nil
899 "Preferred method for fetching an article by Message-ID.
900 If you are reading news from the local spool (with nnspool), fetching
901 articles by Message-ID is painfully slow. By setting this method to an
902 nntp method, you might get acceptable results.
904 The value of this variable must be a valid select method as discussed
905 in the documentation of `gnus-select-method'."
907 :type '(choice (const :tag "default" nil)
910 (defcustom gnus-group-faq-directory
911 '("/ftp@mirrors.aol.com:/pub/rtfm/usenet/"
912 "/ftp@sunsite.auc.dk:/pub/usenet/"
913 "/ftp@sunsite.doc.ic.ac.uk:/pub/usenet/news-faqs/"
914 "/ftp@src.doc.ic.ac.uk:/usenet/news-FAQS/"
915 "/ftp@ftp.seas.gwu.edu:/pub/rtfm/"
916 "/ftp@rtfm.mit.edu:/pub/usenet/"
917 "/ftp@ftp.uni-paderborn.de:/pub/FAQ/"
918 "/ftp@ftp.sunet.se:/pub/usenet/"
919 "/ftp@nctuccca.edu.tw:/USENET/FAQ/"
920 "/ftp@hwarang.postech.ac.kr:/pub/usenet/"
921 "/ftp@ftp.hk.super.net:/mirror/faqs/")
922 "Directory where the group FAQs are stored.
923 This will most commonly be on a remote machine, and the file will be
926 This variable can also be a list of directories. In that case, the
927 first element in the list will be used by default. The others can
928 be used when being prompted for a site.
930 Note that Gnus uses an aol machine as the default directory. If this
931 feels fundamentally unclean, just think of it as a way to finally get
932 something of value back from them.
934 If the default site is too slow, try one of these:
936 North America: mirrors.aol.com /pub/rtfm/usenet
937 ftp.seas.gwu.edu /pub/rtfm
938 rtfm.mit.edu /pub/usenet
939 Europe: ftp.uni-paderborn.de /pub/FAQ
940 src.doc.ic.ac.uk /usenet/news-FAQS
941 ftp.sunet.se /pub/usenet
942 sunsite.auc.dk /pub/usenet
943 Asia: nctuccca.edu.tw /USENET/FAQ
944 hwarang.postech.ac.kr /pub/usenet
945 ftp.hk.super.net /mirror/faqs"
946 :group 'gnus-group-various
947 :type '(choice directory
950 (defcustom gnus-use-cross-reference t
951 "*Non-nil means that cross referenced articles will be marked as read.
952 If nil, ignore cross references. If t, mark articles as read in
953 subscribed newsgroups. If neither t nor nil, mark as read in all
956 :type '(choice (const :tag "off" nil)
957 (const :tag "subscribed" t)
961 (defcustom gnus-process-mark ?#
963 :group 'gnus-group-visual
964 :group 'gnus-summary-marks
967 (defcustom gnus-asynchronous nil
968 "*If non-nil, Gnus will supply backends with data needed for async article fetching."
969 :group 'gnus-asynchronous
972 (defcustom gnus-large-newsgroup 200
973 "*The number of articles which indicates a large newsgroup.
974 If the number of articles in a newsgroup is greater than this value,
975 confirmation is required for selecting the newsgroup."
976 :group 'gnus-group-select
979 (defcustom gnus-use-long-file-name (not (memq system-type '(usg-unix-v xenix)))
980 "*Non-nil means that the default name of a file to save articles in is the group name.
981 If it's nil, the directory form of the group name is used instead.
983 If this variable is a list, and the list contains the element
984 `not-score', long file names will not be used for score files; if it
985 contains the element `not-save', long file names will not be used for
986 saving; and if it contains the element `not-kill', long file names
987 will not be used for kill files.
989 Note that the default for this variable varies according to what system
990 type you're using. On `usg-unix-v' and `xenix' this variable defaults
991 to nil while on all other systems it defaults to t."
995 (defcustom gnus-kill-files-directory gnus-directory
996 "*Name of the directory where kill files will be stored (default \"~/News\")."
997 :group 'gnus-score-files
998 :group 'gnus-score-kill
1001 (defcustom gnus-save-score nil
1002 "*If non-nil, save group scoring info."
1003 :group 'gnus-score-various
1007 (defcustom gnus-use-undo t
1008 "*If non-nil, allow undoing in Gnus group mode buffers."
1012 (defcustom gnus-use-adaptive-scoring nil
1013 "*If non-nil, use some adaptive scoring scheme.
1014 If a list, then the values `word' and `line' are meaningful. The
1015 former will perform adaption on individual words in the subject
1016 header while `line' will perform adaption on several headers."
1018 :group 'gnus-score-adapt
1019 :type '(set (const word) (const line)))
1021 (defcustom gnus-use-cache 'passive
1022 "*If nil, Gnus will ignore the article cache.
1023 If `passive', it will allow entering (and reading) articles
1024 explicitly entered into the cache. If anything else, use the
1025 cache to the full extent of the law."
1028 :type '(choice (const :tag "off" nil)
1029 (const :tag "passive" passive)
1030 (const :tag "active" t)))
1032 (defcustom gnus-use-trees nil
1033 "*If non-nil, display a thread tree buffer."
1037 (defcustom gnus-use-grouplens nil
1038 "*If non-nil, use GroupLens ratings."
1042 (defcustom gnus-keep-backlog nil
1043 "*If non-nil, Gnus will keep read articles for later re-retrieval.
1044 If it is a number N, then Gnus will only keep the last N articles
1045 read. If it is neither nil nor a number, Gnus will keep all read
1046 articles. This is not a good idea."
1048 :type '(choice (const :tag "off" nil)
1053 (defcustom gnus-use-nocem nil
1054 "*If non-nil, Gnus will read NoCeM cancel messages."
1058 (defcustom gnus-suppress-duplicates nil
1059 "*If non-nil, Gnus will mark duplicate copies of the same article as read."
1063 (defcustom gnus-use-demon nil
1064 "If non-nil, Gnus might use some demons."
1068 (defcustom gnus-use-scoring t
1069 "*If non-nil, enable scoring."
1073 (defcustom gnus-use-picons nil
1074 "*If non-nil, display picons."
1078 (defcustom gnus-summary-prepare-exit-hook
1079 '(gnus-summary-expire-articles)
1080 "A hook called when preparing to exit from the summary buffer.
1081 It calls `gnus-summary-expire-articles' by default."
1082 :group 'gnus-summary-exit
1085 (defcustom gnus-novice-user t
1086 "*Non-nil means that you are a usenet novice.
1087 If non-nil, verbose messages may be displayed and confirmations may be
1092 (defcustom gnus-expert-user nil
1093 "*Non-nil means that you will never be asked for confirmation about anything.
1094 And that means *anything*."
1098 (defcustom gnus-interactive-catchup t
1099 "*If non-nil, require your confirmation when catching up a group."
1100 :group 'gnus-group-select
1103 (defcustom gnus-interactive-exit t
1104 "*If non-nil, require your confirmation when exiting Gnus."
1108 (defcustom gnus-extract-address-components 'gnus-extract-address-components
1109 "*Function for extracting address components from a From header.
1110 Two pre-defined function exist: `gnus-extract-address-components',
1111 which is the default, quite fast, and too simplistic solution, and
1112 `mail-extract-address-components', which works much better, but is
1114 :group 'gnus-summary-format
1115 :type '(radio (function-item gnus-extract-address-components)
1116 (function-item mail-extract-address-components)
1117 (function :tag "Other")))
1119 (defcustom gnus-carpal nil
1120 "*If non-nil, display clickable icons."
1124 (defcustom gnus-shell-command-separator ";"
1125 "String used to separate to shell commands."
1129 (defcustom gnus-valid-select-methods
1130 '(("nntp" post address prompt-address physical-address)
1131 ("nnspool" post address)
1132 ("nnvirtual" post-mail virtual prompt-address)
1133 ("nnmbox" mail respool address)
1134 ("nnml" mail respool address)
1135 ("nnmh" mail respool address)
1136 ("nndir" post-mail prompt-address physical-address)
1137 ("nneething" none address prompt-address physical-address)
1138 ("nndoc" none address prompt-address)
1139 ("nnbabyl" mail address respool)
1140 ("nnkiboze" post virtual)
1141 ("nnsoup" post-mail address)
1142 ("nndraft" post-mail)
1143 ("nnfolder" mail respool address)
1144 ("nngateway" none address prompt-address physical-address)
1146 "An alist of valid select methods.
1147 The first element of each list lists should be a string with the name
1148 of the select method. The other elements may be the category of
1149 this method (i. e., `post', `mail', `none' or whatever) or other
1150 properties that this method has (like being respoolable).
1151 If you implement a new select method, all you should have to change is
1152 this variable. I think."
1154 :type '(repeat (group (string :tag "Name")
1155 (radio-button-choice (const :format "%v " post)
1156 (const :format "%v " mail)
1157 (const :format "%v " none)
1159 (checklist :inline t
1160 (const :format "%v " address)
1161 (const :format "%v " prompt-address)
1162 (const :format "%v " virtual)
1165 (define-widget 'gnus-select-method 'list
1166 "Widget for entering a select method."
1167 :args `((choice :tag "Method"
1168 ,@(mapcar (lambda (entry)
1169 (list 'const :format "%v\n"
1170 (intern (car entry))))
1171 gnus-valid-select-methods))
1172 (string :tag "Address")
1173 (editable-list :inline t
1176 (sexp :tag "Value")))))
1178 (defcustom gnus-updated-mode-lines '(group article summary tree)
1179 "List of buffers that should update their mode lines.
1180 The list may contain the symbols `group', `article', `tree' and
1181 `summary'. If the corresponding symbol is present, Gnus will keep
1182 that mode line updated with information that may be pertinent.
1183 If this variable is nil, screen refresh may be quicker."
1184 :group 'gnus-various
1185 :type '(set (const group)
1190 ;; Added by Keinonen Kari <kk85613@cs.tut.fi>.
1191 (defcustom gnus-mode-non-string-length nil
1192 "*Max length of mode-line non-string contents.
1193 If this is nil, Gnus will take space as is needed, leaving the rest
1194 of the modeline intact. Note that the default of nil is unlikely
1195 to be desirable; see the manual for further details."
1196 :group 'gnus-various
1197 :type '(choice (const nil)
1200 (defcustom gnus-auto-expirable-newsgroups nil
1201 "*Groups in which to automatically mark read articles as expirable.
1202 If non-nil, this should be a regexp that should match all groups in
1203 which to perform auto-expiry. This only makes sense for mail groups."
1204 :group 'nnmail-expire
1205 :type '(choice (const nil)
1208 (defcustom gnus-total-expirable-newsgroups nil
1209 "*Groups in which to perform expiry of all read articles.
1210 Use with extreme caution. All groups that match this regexp will be
1211 expiring - which means that all read articles will be deleted after
1212 \(say) one week. (This only goes for mail groups and the like, of
1214 :group 'nnmail-expire
1215 :type '(choice (const nil)
1218 (defcustom gnus-group-uncollapsed-levels 1
1219 "Number of group name elements to leave alone when making a short group name."
1220 :group 'gnus-group-visual
1223 (defcustom gnus-group-use-permanent-levels nil
1224 "*If non-nil, once you set a level, Gnus will use this level."
1225 :group 'gnus-group-levels
1230 (defcustom gnus-load-hook nil
1231 "A hook run while Gnus is loaded."
1235 (defcustom gnus-apply-kill-hook '(gnus-apply-kill-file)
1236 "A hook called to apply kill files to a group.
1237 This hook is intended to apply a kill file to the selected newsgroup.
1238 The function `gnus-apply-kill-file' is called by default.
1240 Since a general kill file is too heavy to use only for a few
1241 newsgroups, I recommend you to use a lighter hook function. For
1242 example, if you'd like to apply a kill file to articles which contains
1243 a string `rmgroup' in subject in newsgroup `control', you can use the
1246 (setq gnus-apply-kill-hook
1249 (cond ((string-match \"control\" gnus-newsgroup-name)
1250 (gnus-kill \"Subject\" \"rmgroup\")
1251 (gnus-expunge \"X\"))))))"
1252 :group 'gnus-score-kill
1253 :options '(gnus-apply-kill-file)
1256 (defcustom gnus-group-change-level-function nil
1257 "Function run when a group level is changed.
1258 It is called with three parameters -- GROUP, LEVEL and OLDLEVEL."
1259 :group 'gnus-group-level
1264 (defcustom gnus-visual
1265 '(summary-highlight group-highlight article-highlight
1267 summary-menu group-menu article-menu
1268 tree-highlight menu highlight
1269 browse-menu server-menu
1270 page-marker tree-menu binary-menu pick-menu
1272 "Enable visual features.
1273 If `visual' is disabled, there will be no menus and few faces. Most of
1274 the visual customization options below will be ignored. Gnus will use
1275 less space and be faster as a result.
1277 This variable can also be a list of visual elements to switch on. For
1278 instance, to switch off all visual things except menus, you can say:
1280 (setq gnus-visual '(menu))
1282 Valid elements include `summary-highlight', `group-highlight',
1283 `article-highlight', `mouse-face', `summary-menu', `group-menu',
1284 `article-menu', `tree-highlight', `menu', `highlight', `browse-menu',
1285 `server-menu', `page-marker', `tree-menu', `binary-menu', `pick-menu',
1286 and `grouplens-menu'."
1289 :type '(set (const summary-highlight)
1290 (const group-highlight)
1291 (const article-highlight)
1293 (const summary-menu)
1295 (const article-menu)
1296 (const tree-highlight)
1305 (const grouplens-menu)))
1307 (defcustom gnus-mouse-face
1309 (if (gnus-visual-p 'mouse-face 'highlight)
1310 (if (boundp 'gnus-mouse-face)
1311 (or gnus-mouse-face 'highlight)
1315 "Face used for group or summary buffer mouse highlighting.
1316 The line beneath the mouse pointer will be highlighted with this
1321 (defcustom gnus-article-display-hook
1322 (if (and (string-match "XEmacs" emacs-version)
1324 '(gnus-article-hide-headers-if-wanted
1325 gnus-article-hide-boring-headers
1326 gnus-article-treat-overstrike
1327 gnus-article-maybe-highlight
1328 gnus-article-display-x-face)
1329 '(gnus-article-hide-headers-if-wanted
1330 gnus-article-hide-boring-headers
1331 gnus-article-treat-overstrike
1332 gnus-article-maybe-highlight))
1333 "Controls how the article buffer will look.
1335 If you leave the list empty, the article will appear exactly as it is
1336 stored on the disk. The list entries will hide or highlight various
1337 parts of the article, making it easier to find the information you
1339 :group 'gnus-article-highlight
1342 :options '(gnus-article-add-buttons
1343 gnus-article-add-buttons-to-head
1344 gnus-article-emphasize
1345 gnus-article-fill-cited-article
1346 gnus-article-remove-cr
1347 gnus-article-de-quoted-unreadable
1348 gnus-article-display-x-face
1349 gnus-summary-stop-page-breaking
1350 ;; gnus-summary-caesar-message
1351 ;; gnus-summary-verbose-headers
1352 gnus-summary-toggle-mime
1354 gnus-article-hide-headers
1355 gnus-article-hide-boring-headers
1356 gnus-article-hide-signature
1357 gnus-article-hide-citation
1358 gnus-article-hide-pgp
1359 gnus-article-hide-pem
1360 gnus-article-highlight
1361 gnus-article-highlight-headers
1362 gnus-article-highlight-citation
1363 gnus-article-highlight-signature
1364 gnus-article-date-ut
1365 gnus-article-date-local
1366 gnus-article-date-lapsed
1367 gnus-article-date-original
1368 gnus-article-remove-trailing-blank-lines
1369 gnus-article-strip-leading-blank-lines
1370 gnus-article-strip-multiple-blank-lines
1371 gnus-article-strip-blank-lines
1372 gnus-article-treat-overstrike
1376 ;;; Internal variables
1378 (defvar gnus-group-get-parameter-function 'gnus-group-get-parameter)
1379 (defvar gnus-original-article-buffer " *Original Article*")
1380 (defvar gnus-newsgroup-name nil)
1382 (defvar gnus-current-select-method nil
1383 "The current method for selecting a newsgroup.")
1385 (defvar gnus-tree-buffer "*Tree*"
1386 "Buffer where Gnus thread trees are displayed.")
1389 (defvar gnus-use-generic-from nil)
1391 ;; Variable holding the user answers to all method prompts.
1392 (defvar gnus-method-history nil)
1393 (defvar gnus-group-history nil)
1395 ;; Variable holding the user answers to all mail method prompts.
1396 (defvar gnus-mail-method-history nil)
1398 ;; Variable holding the user answers to all group prompts.
1399 (defvar gnus-group-history nil)
1401 (defvar gnus-server-alist nil
1402 "List of available servers.")
1404 (defvar gnus-predefined-server-alist
1407 (nnspool-spool-directory "~/News/cache/")
1408 (nnspool-nov-directory "~/News/cache/")
1409 (nnspool-active-file "~/News/cache/active"))))
1410 "List of predefined (convenience) servers.")
1412 (defvar gnus-topic-indentation "") ;; Obsolete variable.
1414 (defconst gnus-article-mark-lists
1415 '((marked . tick) (replied . reply)
1416 (expirable . expire) (killed . killed)
1417 (bookmarks . bookmark) (dormant . dormant)
1418 (scored . score) (saved . save)
1421 (defvar gnus-headers-retrieved-by nil)
1422 (defvar gnus-article-reply nil)
1423 (defvar gnus-override-method nil)
1424 (defvar gnus-article-check-size nil)
1425 (defvar gnus-opened-servers nil)
1427 (defvar gnus-current-kill-article nil)
1429 (defvar gnus-have-read-active-file nil)
1431 (defconst gnus-maintainer
1432 "gnus-bug@ifi.uio.no (The Gnus Bugfixing Girls + Boys)"
1433 "The mail address of the Gnus maintainers.")
1435 (defvar gnus-info-nodes
1436 '((gnus-group-mode "(gnus)The Group Buffer")
1437 (gnus-summary-mode "(gnus)The Summary Buffer")
1438 (gnus-article-mode "(gnus)The Article Buffer")
1439 (mime/viewer-mode "(gnus)The Article Buffer")
1440 (gnus-server-mode "(gnus)The Server Buffer")
1441 (gnus-browse-mode "(gnus)Browse Foreign Server")
1442 (gnus-tree-mode "(gnus)Tree Display"))
1443 "Alist of major modes and related Info nodes.")
1445 (defvar gnus-group-buffer "*Group*")
1446 (defvar gnus-summary-buffer "*Summary*")
1447 (defvar gnus-article-buffer "*Article*")
1448 (defvar gnus-server-buffer "*Server*")
1450 (defvar gnus-buffer-list nil
1451 "Gnus buffers that should be killed on exit.")
1453 (defvar gnus-slave nil
1454 "Whether this Gnus is a slave or not.")
1456 (defvar gnus-batch-mode nil
1457 "Whether this Gnus is running in batch mode or not.")
1459 (defvar gnus-variable-list
1460 '(gnus-newsrc-options gnus-newsrc-options-n
1461 gnus-newsrc-last-checked-date
1462 gnus-newsrc-alist gnus-server-alist
1463 gnus-killed-list gnus-zombie-list
1464 gnus-topic-topology gnus-topic-alist
1466 "Gnus variables saved in the quick startup file.")
1468 (defvar gnus-newsrc-alist nil
1469 "Assoc list of read articles.
1470 gnus-newsrc-hashtb should be kept so that both hold the same information.")
1472 (defvar gnus-newsrc-hashtb nil
1473 "Hashtable of gnus-newsrc-alist.")
1475 (defvar gnus-killed-list nil
1476 "List of killed newsgroups.")
1478 (defvar gnus-killed-hashtb nil
1479 "Hash table equivalent of gnus-killed-list.")
1481 (defvar gnus-zombie-list nil
1482 "List of almost dead newsgroups.")
1484 (defvar gnus-description-hashtb nil
1485 "Descriptions of newsgroups.")
1487 (defvar gnus-list-of-killed-groups nil
1488 "List of newsgroups that have recently been killed by the user.")
1490 (defvar gnus-active-hashtb nil
1491 "Hashtable of active articles.")
1493 (defvar gnus-moderated-hashtb nil
1494 "Hashtable of moderated newsgroups.")
1496 ;; Save window configuration.
1497 (defvar gnus-prev-winconf nil)
1499 (defvar gnus-reffed-article-number nil)
1501 ;;; Let the byte-compiler know that we know about this variable.
1502 (defvar rmail-default-rmail-file)
1504 (defvar gnus-dead-summary nil)
1506 ;;; End of variables.
1508 ;; Define some autoload functions Gnus might use.
1511 ;; This little mapcar goes through the list below and marks the
1512 ;; symbols in question as autoloaded functions.
1515 (let ((interactive (nth 1 (memq ':interactive package))))
1519 (when (consp function)
1520 (setq keymap (car (memq 'keymap function)))
1521 (setq function (car function)))
1522 (autoload function (car package) nil interactive keymap)))
1523 (if (eq (nth 1 package) ':interactive)
1526 '(("metamail" metamail-buffer)
1527 ("info" Info-goto-node)
1528 ("hexl" hexl-hex-string-to-integer)
1529 ("pp" pp pp-to-string pp-eval-expression)
1530 ("ps-print" ps-print-preprint)
1531 ("mail-extr" mail-extract-address-components)
1532 ("message" :interactive t
1533 message-send-and-exit message-yank-original)
1534 ("nnmail" nnmail-split-fancy nnmail-article-group nnmail-date-to-time)
1535 ("nnvirtual" nnvirtual-catchup-group nnvirtual-convert-headers)
1536 ("timezone" timezone-make-date-arpa-standard timezone-fix-time
1537 timezone-make-sortable-date timezone-make-time-string)
1538 ("rmailout" rmail-output)
1539 ("rmail" rmail-insert-rmail-file-header rmail-count-new-messages
1541 ("gnus-audio" :interactive t gnus-audio-play)
1542 ("gnus-xmas" gnus-xmas-splash)
1543 ("gnus-soup" :interactive t
1544 gnus-group-brew-soup gnus-brew-soup gnus-soup-add-article
1545 gnus-soup-send-replies gnus-soup-save-areas gnus-soup-pack-packet)
1546 ("nnsoup" nnsoup-pack-replies)
1547 ("score-mode" :interactive t gnus-score-mode)
1548 ("gnus-mh" gnus-summary-save-article-folder
1549 gnus-Folder-save-name gnus-folder-save-name)
1550 ("gnus-mh" :interactive t gnus-summary-save-in-folder)
1551 ("gnus-demon" gnus-demon-add-nocem gnus-demon-add-scanmail
1552 gnus-demon-add-rescan gnus-demon-add-scan-timestamps
1553 gnus-demon-add-disconnection gnus-demon-add-handler
1554 gnus-demon-remove-handler)
1555 ("gnus-demon" :interactive t
1556 gnus-demon-init gnus-demon-cancel)
1557 ("gnus-salt" gnus-highlight-selected-tree gnus-possibly-generate-tree
1558 gnus-tree-open gnus-tree-close gnus-carpal-setup-buffer)
1559 ("gnus-nocem" gnus-nocem-scan-groups gnus-nocem-close
1560 gnus-nocem-unwanted-article-p)
1561 ("gnus-srvr" gnus-enter-server-buffer gnus-server-set-info)
1562 ("gnus-srvr" gnus-browse-foreign-server)
1563 ("gnus-cite" :interactive t
1564 gnus-article-highlight-citation gnus-article-hide-citation-maybe
1565 gnus-article-hide-citation gnus-article-fill-cited-article
1566 gnus-article-hide-citation-in-followups)
1567 ("gnus-kill" gnus-kill gnus-apply-kill-file-internal
1568 gnus-kill-file-edit-file gnus-kill-file-raise-followups-to-author
1569 gnus-execute gnus-expunge)
1570 ("gnus-cache" gnus-cache-possibly-enter-article gnus-cache-save-buffers
1571 gnus-cache-possibly-remove-articles gnus-cache-request-article
1572 gnus-cache-retrieve-headers gnus-cache-possibly-alter-active
1573 gnus-cache-enter-remove-article gnus-cached-article-p
1574 gnus-cache-open gnus-cache-close gnus-cache-update-article)
1575 ("gnus-cache" :interactive t gnus-jog-cache gnus-cache-enter-article
1576 gnus-cache-remove-article gnus-summary-insert-cached-articles)
1577 ("gnus-score" :interactive t
1578 gnus-summary-increase-score gnus-summary-set-score
1579 gnus-summary-raise-thread gnus-summary-raise-same-subject
1580 gnus-summary-raise-score gnus-summary-raise-same-subject-and-select
1581 gnus-summary-lower-thread gnus-summary-lower-same-subject
1582 gnus-summary-lower-score gnus-summary-lower-same-subject-and-select
1583 gnus-summary-current-score gnus-score-default
1584 gnus-score-flush-cache gnus-score-close
1585 gnus-possibly-score-headers gnus-score-followup-article
1586 gnus-score-followup-thread)
1588 (gnus-summary-score-map keymap) gnus-score-save gnus-score-headers
1589 gnus-current-score-file-nondirectory gnus-score-adaptive
1590 gnus-score-find-trace gnus-score-file-name)
1591 ("gnus-cus" :interactive t gnus-group-customize gnus-score-customize)
1592 ("gnus-topic" :interactive t gnus-topic-mode)
1593 ("gnus-topic" gnus-topic-remove-group gnus-topic-set-parameters)
1594 ("gnus-salt" :interactive t gnus-pick-mode gnus-binary-mode)
1595 ("gnus-uu" (gnus-uu-extract-map keymap) (gnus-uu-mark-map keymap))
1596 ("gnus-uu" :interactive t
1597 gnus-uu-digest-mail-forward gnus-uu-digest-post-forward
1598 gnus-uu-mark-series gnus-uu-mark-region gnus-uu-mark-buffer
1599 gnus-uu-mark-by-regexp gnus-uu-mark-all
1600 gnus-uu-mark-sparse gnus-uu-mark-thread gnus-uu-decode-uu
1601 gnus-uu-decode-uu-and-save gnus-uu-decode-unshar
1602 gnus-uu-decode-unshar-and-save gnus-uu-decode-save
1603 gnus-uu-decode-binhex gnus-uu-decode-uu-view
1604 gnus-uu-decode-uu-and-save-view gnus-uu-decode-unshar-view
1605 gnus-uu-decode-unshar-and-save-view gnus-uu-decode-save-view
1606 gnus-uu-decode-binhex-view)
1607 ("gnus-uu" gnus-uu-delete-work-dir gnus-quote-arg-for-sh-or-csh)
1608 ("gnus-msg" (gnus-summary-send-map keymap)
1609 gnus-article-mail gnus-copy-article-buffer gnus-extended-version)
1610 ("gnus-msg" :interactive t
1611 gnus-group-post-news gnus-group-mail gnus-summary-post-news
1612 gnus-summary-followup gnus-summary-followup-with-original
1613 gnus-summary-cancel-article gnus-summary-supersede-article
1614 gnus-post-news gnus-summary-reply gnus-summary-reply-with-original
1615 gnus-summary-mail-forward gnus-summary-mail-other-window
1616 gnus-summary-resend-message gnus-summary-resend-bounced-mail
1618 ("gnus-picon" :interactive t gnus-article-display-picons
1619 gnus-group-display-picons gnus-picons-article-display-x-face
1620 gnus-picons-display-x-face)
1621 ("gnus-gl" bbb-login bbb-logout bbb-grouplens-group-p
1622 gnus-grouplens-mode)
1623 ("smiley" :interactive t gnus-smiley-display)
1624 ("gnus-win" gnus-configure-windows gnus-add-configuration)
1625 ("gnus-sum" gnus-summary-insert-line gnus-summary-read-group
1626 gnus-list-of-unread-articles gnus-list-of-read-articles
1627 gnus-offer-save-summaries gnus-make-thread-indent-array
1628 gnus-summary-exit gnus-update-read-articles)
1629 ("gnus-group" gnus-group-insert-group-line gnus-group-quit
1630 gnus-group-list-groups gnus-group-first-unread-group
1631 gnus-group-set-mode-line gnus-group-set-info gnus-group-save-newsrc
1632 gnus-group-setup-buffer gnus-group-get-new-news
1633 gnus-group-make-help-group gnus-group-update-group)
1634 ("gnus-bcklg" gnus-backlog-request-article gnus-backlog-enter-article
1635 gnus-backlog-remove-article)
1636 ("gnus-art" gnus-article-read-summary-keys gnus-article-save
1637 gnus-article-prepare gnus-article-set-window-start
1638 gnus-article-next-page gnus-article-prev-page
1639 gnus-request-article-this-buffer gnus-article-mode
1640 gnus-article-setup-buffer gnus-narrow-to-page)
1641 ("gnus-art" :interactive t
1642 gnus-article-hide-headers gnus-article-hide-boring-headers
1643 gnus-article-treat-overstrike gnus-article-word-wrap
1644 gnus-article-remove-cr gnus-article-remove-trailing-blank-lines
1645 gnus-article-display-x-face gnus-article-de-quoted-unreadable
1646 gnus-article-mime-decode-quoted-printable gnus-article-hide-pgp
1647 gnus-article-hide-pem gnus-article-hide-signature
1648 gnus-article-strip-leading-blank-lines gnus-article-date-local
1649 gnus-article-date-original gnus-article-date-lapsed
1650 gnus-article-show-all-headers
1651 gnus-article-edit-mode gnus-article-edit-article
1652 gnus-article-edit-done gnus-decode-rfc1522 article-decode-rfc1522)
1653 ("gnus-int" gnus-request-type)
1654 ("gnus-start" gnus-newsrc-parse-options gnus-1 gnus-no-server-1
1656 ("gnus-dup" gnus-dup-suppress-articles gnus-dup-unsuppress-article
1657 gnus-dup-enter-articles)
1658 ("gnus-range" gnus-copy-sequence)
1659 ("gnus-eform" gnus-edit-form)
1660 ("gnus-move" :interactive t
1661 gnus-group-move-group-to-server gnus-change-server)
1662 ("gnus-logic" gnus-score-advanced)
1663 ("gnus-undo" gnus-undo-mode gnus-undo-register)
1664 ("gnus-async" gnus-async-request-fetched-article gnus-async-prefetch-next
1665 gnus-async-prefetch-article gnus-async-prefetch-remove-group
1666 gnus-async-halt-prefetch)
1667 ("gnus-vm" :interactive t gnus-summary-save-in-vm
1668 gnus-summary-save-article-vm))))
1670 ;;; gnus-sum.el thingies
1673 (defcustom gnus-summary-line-format "%U\%R\%z\%I\%(%[%4L: %-20,20n%]%) %s\n"
1674 "*The format specification of the lines in the summary buffer.
1676 It works along the same lines as a normal formatting string,
1677 with some simple extensions.
1679 %N Article number, left padded with spaces (string)
1681 %s Subject if it is at the root of a thread, and \"\" otherwise (string)
1682 %n Name of the poster (string)
1683 %a Extracted name of the poster (string)
1684 %A Extracted address of the poster (string)
1685 %F Contents of the From: header (string)
1686 %x Contents of the Xref: header (string)
1687 %D Date of the article (string)
1688 %d Date of the article (string) in DD-MMM format
1689 %M Message-id of the article (string)
1690 %r References of the article (string)
1691 %c Number of characters in the article (integer)
1692 %L Number of lines in the article (integer)
1693 %I Indentation based on thread level (a string of spaces)
1694 %T A string with two possible values: 80 spaces if the article
1695 is on thread level two or larger and 0 spaces on level one
1696 %R \"A\" if this article has been replied to, \" \" otherwise (character)
1697 %U Status of this article (character, \"R\", \"K\", \"-\" or \" \")
1698 %[ Opening bracket (character, \"[\" or \"<\")
1699 %] Closing bracket (character, \"]\" or \">\")
1700 %> Spaces of length thread-level (string)
1701 %< Spaces of length (- 20 thread-level) (string)
1702 %i Article score (number)
1703 %z Article zcore (character)
1704 %t Number of articles under the current thread (number).
1705 %e Whether the thread is empty or not (character).
1706 %l GroupLens score (string).
1707 %V Total thread score (number).
1708 %P The line number (number).
1709 %u User defined specifier. The next character in the format string should
1710 be a letter. Gnus will call the function gnus-user-format-function-X,
1711 where X is the letter following %u. The function will be passed the
1712 current header as argument. The function should return a string, which
1713 will be inserted into the summary just like information from any other
1716 Text between %( and %) will be highlighted with `gnus-mouse-face'
1717 when the mouse point is placed inside the area. There can only be one
1720 The %U (status), %R (replied) and %z (zcore) specs have to be handled
1721 with care. For reasons of efficiency, Gnus will compute what column
1722 these characters will end up in, and \"hard-code\" that. This means that
1723 it is illegal to have these specs after a variable-length spec. Well,
1724 you might not be arrested, but your summary buffer will look strange,
1725 which is bad enough.
1727 The smart choice is to have these specs as for to the left as
1730 This restriction may disappear in later versions of Gnus."
1732 :group 'gnus-summary-format)
1735 ;;; Skeleton keymaps
1738 (defun gnus-suppress-keymap (keymap)
1739 (suppress-keymap keymap)
1740 (let ((keys `([delete] "\177" "\M-u"))) ;gnus-mouse-2
1742 (define-key keymap (pop keys) 'undefined))))
1744 (defvar gnus-article-mode-map
1745 (let ((keymap (make-keymap)))
1746 (gnus-suppress-keymap keymap)
1748 (defvar gnus-summary-mode-map
1749 (let ((keymap (make-keymap)))
1750 (gnus-suppress-keymap keymap)
1752 (defvar gnus-group-mode-map
1753 (let ((keymap (make-keymap)))
1754 (gnus-suppress-keymap keymap)
1759 ;; Fix by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
1760 ;; If you want the cursor to go somewhere else, set these two
1761 ;; functions in some startup hook to whatever you want.
1762 (defalias 'gnus-summary-position-point 'gnus-goto-colon)
1763 (defalias 'gnus-group-position-point 'gnus-goto-colon)
1765 ;;; Various macros and substs.
1767 (defun gnus-header-from (header)
1768 (mail-header-from header))
1770 (defmacro gnus-gethash (string hashtable)
1771 "Get hash value of STRING in HASHTABLE."
1772 `(symbol-value (intern-soft ,string ,hashtable)))
1774 (defmacro gnus-sethash (string value hashtable)
1775 "Set hash value. Arguments are STRING, VALUE, and HASHTABLE."
1776 `(set (intern ,string ,hashtable) ,value))
1777 (put 'gnus-sethash 'edebug-form-spec '(form form form))
1779 (defmacro gnus-group-unread (group)
1780 "Get the currently computed number of unread articles in GROUP."
1781 `(car (gnus-gethash ,group gnus-newsrc-hashtb)))
1783 (defmacro gnus-group-entry (group)
1784 "Get the newsrc entry for GROUP."
1785 `(gnus-gethash ,group gnus-newsrc-hashtb))
1787 (defmacro gnus-active (group)
1788 "Get active info on GROUP."
1789 `(gnus-gethash ,group gnus-active-hashtb))
1791 (defmacro gnus-set-active (group active)
1792 "Set GROUP's active info."
1793 `(gnus-sethash ,group ,active gnus-active-hashtb))
1795 (defun gnus-alive-p ()
1796 "Say whether Gnus is running or not."
1797 (and gnus-group-buffer
1798 (get-buffer gnus-group-buffer)
1800 (set-buffer gnus-group-buffer)
1801 (eq major-mode 'gnus-group-mode))))
1803 ;; Info access macros.
1805 (defmacro gnus-info-group (info)
1807 (defmacro gnus-info-rank (info)
1809 (defmacro gnus-info-read (info)
1811 (defmacro gnus-info-marks (info)
1813 (defmacro gnus-info-method (info)
1815 (defmacro gnus-info-params (info)
1818 (defmacro gnus-info-level (info)
1819 `(let ((rank (gnus-info-rank ,info)))
1823 (defmacro gnus-info-score (info)
1824 `(let ((rank (gnus-info-rank ,info)))
1825 (or (and (consp rank) (cdr rank)) 0)))
1827 (defmacro gnus-info-set-group (info group)
1828 `(setcar ,info ,group))
1829 (defmacro gnus-info-set-rank (info rank)
1830 `(setcar (nthcdr 1 ,info) ,rank))
1831 (defmacro gnus-info-set-read (info read)
1832 `(setcar (nthcdr 2 ,info) ,read))
1833 (defmacro gnus-info-set-marks (info marks &optional extend)
1835 `(gnus-info-set-entry ,info ,marks 3)
1836 `(setcar (nthcdr 3 ,info) ,marks)))
1837 (defmacro gnus-info-set-method (info method &optional extend)
1839 `(gnus-info-set-entry ,info ,method 4)
1840 `(setcar (nthcdr 4 ,info) ,method)))
1841 (defmacro gnus-info-set-params (info params &optional extend)
1843 `(gnus-info-set-entry ,info ,params 5)
1844 `(setcar (nthcdr 5 ,info) ,params)))
1846 (defun gnus-info-set-entry (info entry number)
1847 ;; Extend the info until we have enough elements.
1848 (while (<= (length info) number)
1849 (nconc info (list nil)))
1851 (setcar (nthcdr number info) entry))
1853 (defmacro gnus-info-set-level (info level)
1854 `(let ((rank (cdr ,info)))
1855 (if (consp (car rank))
1856 (setcar (car rank) ,level)
1857 (setcar rank ,level))))
1858 (defmacro gnus-info-set-score (info score)
1859 `(let ((rank (cdr ,info)))
1860 (if (consp (car rank))
1861 (setcdr (car rank) ,score)
1862 (setcar rank (cons (car rank) ,score)))))
1864 (defmacro gnus-get-info (group)
1865 `(nth 2 (gnus-gethash ,group gnus-newsrc-hashtb)))
1867 ;; Byte-compiler warning.
1868 (defvar gnus-visual)
1869 ;; Find out whether the gnus-visual TYPE is wanted.
1870 (defun gnus-visual-p (&optional type class)
1871 (and gnus-visual ; Has to be non-nil, at least.
1872 (if (not type) ; We don't care about type.
1874 (if (listp gnus-visual) ; It's a list, so we check it.
1875 (or (memq type gnus-visual)
1876 (memq class gnus-visual))
1879 ;;; Load the compatability functions.
1888 (defvar gnus-shutdown-alist nil)
1890 (defun gnus-add-shutdown (function &rest symbols)
1891 "Run FUNCTION whenever one of SYMBOLS is shut down."
1892 (push (cons function symbols) gnus-shutdown-alist))
1894 (defun gnus-shutdown (symbol)
1895 "Shut down everything that waits for SYMBOL."
1896 (let ((alist gnus-shutdown-alist)
1898 (while (setq entry (pop alist))
1899 (when (memq symbol (cdr entry))
1900 (funcall (car entry))))))
1904 ;;; Gnus Utility Functions
1907 ;; Add the current buffer to the list of buffers to be killed on exit.
1908 (defun gnus-add-current-to-buffer-list ()
1909 (or (memq (current-buffer) gnus-buffer-list)
1910 (push (current-buffer) gnus-buffer-list)))
1912 (defun gnus-version (&optional arg)
1913 "Version number of this version of Gnus.
1914 If ARG, insert string at point."
1916 (let ((methods gnus-valid-select-methods)
1919 ;; Go through all the legal select methods and add their version
1920 ;; numbers to the total version string. Only the backends that are
1921 ;; currently in use will have their message numbers taken into
1924 (setq meth (intern (concat (caar methods) "-version")))
1926 (stringp (symbol-value meth))
1927 (setq mess (concat mess "; " (symbol-value meth))))
1928 (setq methods (cdr methods)))
1930 (insert (message mess))
1933 (defun gnus-continuum-version (version)
1934 "Return VERSION as a floating point number."
1935 (when (or (string-match "^\\([^ ]+\\)? ?Gnus v?\\([0-9.]+\\)$" version)
1936 (string-match "^\\(.?\\)gnus-\\([0-9.]+\\)$" version))
1937 (let* ((alpha (and (match-beginning 1) (match-string 1 version)))
1938 (number (match-string 2 version))
1940 (string-match "\\([0-9]\\)\\.\\([0-9]+\\)\\.?\\([0-9]+\\)?" number)
1941 (setq major (string-to-number (match-string 1 number)))
1942 (setq minor (string-to-number (match-string 2 number)))
1943 (setq least (if (match-beginning 3)
1944 (string-to-number (match-string 3 number))
1948 (format "%s00%02d%02d"
1950 ((member alpha '("(ding)" "d")) "4.99")
1951 ((member alpha '("September" "s")) "5.01")
1952 ((member alpha '("Red" "r")) "5.03"))
1954 (format "%d.%02d%02d" major minor least))))))
1956 (defun gnus-info-find-node ()
1957 "Find Info documentation of Gnus."
1959 ;; Enlarge info window if needed.
1960 (let (gnus-info-buffer)
1961 (Info-goto-node (cadr (assq major-mode gnus-info-nodes)))
1962 (setq gnus-info-buffer (current-buffer))
1963 (gnus-configure-windows 'info)))
1965 ;;; More various functions.
1967 (defun gnus-group-read-only-p (&optional group)
1968 "Check whether GROUP supports editing or not.
1969 If GROUP is nil, `gnus-newsgroup-name' will be checked instead. Note
1970 that that variable is buffer-local to the summary buffers."
1971 (let ((group (or group gnus-newsgroup-name)))
1972 (not (gnus-check-backend-function 'request-replace-article group))))
1974 (defun gnus-group-total-expirable-p (group)
1975 "Check whether GROUP is total-expirable or not."
1976 (let ((params (gnus-group-find-parameter group))
1979 ((memq 'total-expire params)
1981 ((setq val (assq 'total-expire params)) ; (auto-expire . t)
1983 (gnus-total-expirable-newsgroups ; Check var.
1984 (string-match gnus-total-expirable-newsgroups group)))))
1986 (defun gnus-group-auto-expirable-p (group)
1987 "Check whether GROUP is total-expirable or not."
1988 (let ((params (gnus-group-find-parameter group))
1991 ((memq 'auto-expire params)
1993 ((setq val (assq 'auto-expire params)) ; (auto-expire . t)
1995 (gnus-auto-expirable-newsgroups ; Check var.
1996 (string-match gnus-auto-expirable-newsgroups group)))))
1998 (defun gnus-virtual-group-p (group)
1999 "Say whether GROUP is virtual or not."
2000 (memq 'virtual (assoc (symbol-name (car (gnus-find-method-for-group group)))
2001 gnus-valid-select-methods)))
2003 (defun gnus-news-group-p (group &optional article)
2004 "Return non-nil if GROUP (and ARTICLE) come from a news server."
2005 (or (gnus-member-of-valid 'post group) ; Ordinary news group.
2006 (and (gnus-member-of-valid 'post-mail group) ; Combined group.
2007 (eq (gnus-request-type group article) 'news))))
2009 ;; Returns a list of writable groups.
2010 (defun gnus-writable-groups ()
2011 (let ((alist gnus-newsrc-alist)
2013 (while (setq group (car (pop alist)))
2014 (unless (gnus-group-read-only-p group)
2015 (push group groups)))
2018 ;; Check whether to use long file names.
2019 (defun gnus-use-long-file-name (symbol)
2020 ;; The variable has to be set...
2021 (and gnus-use-long-file-name
2022 ;; If it isn't a list, then we return t.
2023 (or (not (listp gnus-use-long-file-name))
2024 ;; If it is a list, and the list contains `symbol', we
2026 (not (memq symbol gnus-use-long-file-name)))))
2028 ;; Generate a unique new group name.
2029 (defun gnus-generate-new-group-name (leaf)
2032 (while (gnus-gethash name gnus-newsrc-hashtb)
2033 (setq name (concat leaf "<" (int-to-string (setq num (1+ num))) ">")))
2036 (defun gnus-ephemeral-group-p (group)
2037 "Say whether GROUP is ephemeral or not."
2038 (gnus-group-get-parameter group 'quit-config))
2040 (defun gnus-group-quit-config (group)
2041 "Return the quit-config of GROUP."
2042 (gnus-group-get-parameter group 'quit-config))
2044 (defun gnus-kill-ephemeral-group (group)
2045 "Remove ephemeral GROUP from relevant structures."
2046 (gnus-sethash group nil gnus-newsrc-hashtb))
2048 (defun gnus-simplify-mode-line ()
2049 "Make mode lines a bit simpler."
2050 (setq mode-line-modified "-- ")
2051 (when (listp mode-line-format)
2052 (make-local-variable 'mode-line-format)
2053 (setq mode-line-format (copy-sequence mode-line-format))
2054 (when (equal (nth 3 mode-line-format) " ")
2055 (setcar (nthcdr 3 mode-line-format) " "))))
2057 ;;; Servers and groups.
2059 (defsubst gnus-server-add-address (method)
2060 (let ((method-name (symbol-name (car method))))
2061 (if (and (memq 'address (assoc method-name gnus-valid-select-methods))
2062 (not (assq (intern (concat method-name "-address")) method))
2063 (memq 'physical-address (assq (car method)
2064 gnus-valid-select-methods)))
2065 (append method (list (list (intern (concat method-name "-address"))
2069 (defsubst gnus-server-get-method (group method)
2070 ;; Input either a server name, and extended server name, or a
2071 ;; select method, and return a select method.
2072 (cond ((stringp method)
2073 (gnus-server-to-method method))
2074 ((equal method gnus-select-method)
2076 ((and (stringp (car method)) group)
2077 (gnus-server-extend-method group method))
2078 ((and method (not group)
2079 (equal (cadr method) ""))
2082 (gnus-server-add-address method))))
2084 (defun gnus-server-to-method (server)
2085 "Map virtual server names to select methods."
2087 ;; Is this a method, perhaps?
2088 (and server (listp server) server)
2089 ;; Perhaps this is the native server?
2090 (and (equal server "native") gnus-select-method)
2091 ;; It should be in the server alist.
2092 (cdr (assoc server gnus-server-alist))
2093 ;; It could be in the predefined server alist.
2094 (cdr (assoc server gnus-predefined-server-alist))
2095 ;; If not, we look through all the opened server
2096 ;; to see whether we can find it there.
2097 (let ((opened gnus-opened-servers))
2099 (not (equal server (format "%s:%s" (caaar opened)
2104 (defmacro gnus-method-equal (ss1 ss2)
2105 "Say whether two servers are equal."
2109 (and (= (length s1) (length s2))
2111 (while (and s1 (member (car s1) s2))
2115 (defun gnus-server-equal (m1 m2)
2116 "Say whether two methods are equal."
2117 (let ((m1 (cond ((null m1) gnus-select-method)
2118 ((stringp m1) (gnus-server-to-method m1))
2120 (m2 (cond ((null m2) gnus-select-method)
2121 ((stringp m2) (gnus-server-to-method m2))
2123 (gnus-method-equal m1 m2)))
2125 (defun gnus-servers-using-backend (backend)
2126 "Return a list of known servers using BACKEND."
2127 (let ((opened gnus-opened-servers)
2130 (when (eq backend (caaar opened))
2131 (push (caar opened) out))
2135 (defun gnus-archive-server-wanted-p ()
2136 "Say whether the user wants to use the archive server."
2138 ((or (not gnus-message-archive-method)
2139 (not gnus-message-archive-group))
2141 ((and gnus-message-archive-method gnus-message-archive-group)
2144 (let ((active (cadr (assq 'nnfolder-active-file
2145 gnus-message-archive-method))))
2147 (file-exists-p active))))))
2149 (defun gnus-group-prefixed-name (group method)
2150 "Return the whole name from GROUP and METHOD."
2151 (and (stringp method) (setq method (gnus-server-to-method method)))
2154 (concat (format "%s" (car method))
2156 (or (assoc (format "%s" (car method))
2157 (gnus-methods-using 'address))
2158 (gnus-server-equal method gnus-message-archive-method))
2160 (not (string= (nth 1 method) "")))
2161 (concat "+" (nth 1 method)))
2164 (defun gnus-group-real-prefix (group)
2165 "Return the prefix of the current group name."
2166 (if (string-match "^[^:]+:" group)
2167 (substring group 0 (match-end 0))
2170 (defun gnus-group-method (group)
2171 "Return the server or method used for selecting GROUP.
2172 You should probably use `gnus-find-method-for-group' instead."
2173 (let ((prefix (gnus-group-real-prefix group)))
2174 (if (equal prefix "")
2176 (let ((servers gnus-opened-servers)
2178 backend possible found)
2179 (if (string-match "^[^\\+]+\\+" prefix)
2180 (setq backend (intern (substring prefix 0 (1- (match-end 0))))
2181 server (substring prefix (match-end 0) (1- (length prefix))))
2182 (setq backend (intern (substring prefix 0 (1- (length prefix))))))
2184 (when (eq (caaar servers) backend)
2185 (setq possible (caar servers))
2186 (when (equal (cadaar servers) server)
2187 (setq found (caar servers))))
2189 (or (car (rassoc found gnus-server-alist))
2191 (car (rassoc possible gnus-server-alist))
2193 (list backend server))))))
2195 (defsubst gnus-secondary-method-p (method)
2196 "Return whether METHOD is a secondary select method."
2197 (let ((methods gnus-secondary-select-methods)
2198 (gmethod (gnus-server-get-method nil method)))
2200 (not (equal (gnus-server-get-method nil (car methods))
2202 (setq methods (cdr methods)))
2205 (defun gnus-group-foreign-p (group)
2206 "Say whether a group is foreign or not."
2207 (and (not (gnus-group-native-p group))
2208 (not (gnus-group-secondary-p group))))
2210 (defun gnus-group-native-p (group)
2211 "Say whether the group is native or not."
2212 (not (string-match ":" group)))
2214 (defun gnus-group-secondary-p (group)
2215 "Say whether the group is secondary or not."
2216 (gnus-secondary-method-p (gnus-find-method-for-group group)))
2218 (defun gnus-group-find-parameter (group &optional symbol)
2219 "Return the group parameters for GROUP.
2220 If SYMBOL, return the value of that symbol in the group parameters."
2222 (set-buffer gnus-group-buffer)
2223 (let ((parameters (funcall gnus-group-get-parameter-function group)))
2225 (gnus-group-parameter-value parameters symbol)
2228 (defun gnus-group-get-parameter (group &optional symbol)
2229 "Return the group parameters for GROUP.
2230 If SYMBOL, return the value of that symbol in the group parameters."
2231 (let ((params (gnus-info-params (gnus-get-info group))))
2233 (gnus-group-parameter-value params symbol)
2236 (defun gnus-group-parameter-value (params symbol)
2237 "Return the value of SYMBOL in group PARAMS."
2238 (or (car (memq symbol params)) ; It's either a simple symbol
2239 (cdr (assq symbol params)))) ; or a cons.
2241 (defun gnus-group-add-parameter (group param)
2242 "Add parameter PARAM to GROUP."
2243 (let ((info (gnus-get-info group)))
2245 () ; This is a dead group. We just ignore it.
2246 ;; Cons the new param to the old one and update.
2247 (gnus-group-set-info (cons param (gnus-info-params info))
2250 (defun gnus-group-set-parameter (group name value)
2251 "Set parameter NAME to VALUE in GROUP."
2252 (let ((info (gnus-get-info group)))
2254 () ; This is a dead group. We just ignore it.
2255 (let ((old-params (gnus-info-params info))
2256 (new-params (list (cons name value))))
2258 (when (or (not (listp (car old-params)))
2259 (not (eq (caar old-params) name)))
2260 (setq new-params (append new-params (list (car old-params)))))
2261 (setq old-params (cdr old-params)))
2262 (gnus-group-set-info new-params group 'params)))))
2264 (defun gnus-group-add-score (group &optional score)
2265 "Add SCORE to the GROUP score.
2266 If SCORE is nil, add 1 to the score of GROUP."
2267 (let ((info (gnus-get-info group)))
2269 (gnus-info-set-score info (+ (gnus-info-score info) (or score 1))))))
2271 ;; Function written by Stainless Steel Rat <ratinox@peorth.gweep.net>
2272 (defun gnus-short-group-name (group &optional levels)
2273 "Collapse GROUP name LEVELS.
2274 Select methods are stripped and any remote host name is stripped down to
2275 just the host name."
2276 (let* ((name "") (foreign "") (depth -1) (skip 1)
2279 (while (string-match "\\." group skip)
2280 (setq skip (match-end 0)
2283 ;; separate foreign select method from group name and collapse.
2284 ;; if method contains a server, collapse to non-domain server name,
2285 ;; otherwise collapse to select method
2286 (when (string-match ":" group)
2287 (cond ((string-match "+" group)
2288 (let* ((plus (string-match "+" group))
2289 (colon (string-match ":" group (or plus 0)))
2290 (dot (string-match "\\." group)))
2291 (setq foreign (concat
2292 (substring group (+ 1 plus)
2293 (cond ((null dot) colon)
2294 ((< colon dot) colon)
2295 ((< dot colon) dot)))
2297 group (substring group (+ 1 colon)))))
2299 (let* ((colon (string-match ":" group)))
2300 (setq foreign (concat (substring group 0 (+ 1 colon)))
2301 group (substring group (+ 1 colon)))))))
2302 ;; collapse group name leaving LEVELS uncollapsed elements
2304 (if (and (string-match "\\." group) (> levels 0))
2305 (setq name (concat name (substring group 0 1))
2306 group (substring group (match-end 0))
2308 name (concat name "."))
2309 (setq name (concat foreign name group)
2313 (defun gnus-narrow-to-body ()
2314 "Narrow to the body of an article."
2317 (goto-char (point-min))
2318 (or (search-forward "\n\n" nil t)
2324 ;;; Kill file handling.
2327 (defun gnus-apply-kill-file ()
2328 "Apply a kill file to the current newsgroup.
2329 Returns the number of articles marked as read."
2330 (if (or (file-exists-p (gnus-newsgroup-kill-file nil))
2331 (file-exists-p (gnus-newsgroup-kill-file gnus-newsgroup-name)))
2332 (gnus-apply-kill-file-internal)
2335 (defun gnus-kill-save-kill-buffer ()
2336 (let ((file (gnus-newsgroup-kill-file gnus-newsgroup-name)))
2337 (when (get-file-buffer file)
2339 (set-buffer (get-file-buffer file))
2340 (when (buffer-modified-p)
2342 (kill-buffer (current-buffer))))))
2344 (defcustom gnus-kill-file-name "KILL"
2345 "Suffix of the kill files."
2346 :group 'gnus-score-kill
2347 :group 'gnus-score-files
2350 (defun gnus-newsgroup-kill-file (newsgroup)
2351 "Return the name of a kill file name for NEWSGROUP.
2352 If NEWSGROUP is nil, return the global kill file name instead."
2354 ;; The global KILL file is placed at top of the directory.
2355 ((or (null newsgroup)
2356 (string-equal newsgroup ""))
2357 (expand-file-name gnus-kill-file-name
2358 gnus-kill-files-directory))
2359 ;; Append ".KILL" to newsgroup name.
2360 ((gnus-use-long-file-name 'not-kill)
2361 (expand-file-name (concat (gnus-newsgroup-savable-name newsgroup)
2362 "." gnus-kill-file-name)
2363 gnus-kill-files-directory))
2364 ;; Place "KILL" under the hierarchical directory.
2366 (expand-file-name (concat (gnus-newsgroup-directory-form newsgroup)
2367 "/" gnus-kill-file-name)
2368 gnus-kill-files-directory))))
2372 (defun gnus-member-of-valid (symbol group)
2373 "Find out if GROUP has SYMBOL as part of its \"valid\" spec."
2375 (symbol-name (car (gnus-find-method-for-group group)))
2376 gnus-valid-select-methods)))
2378 (defun gnus-method-option-p (method option)
2379 "Return non-nil if select METHOD has OPTION as a parameter."
2380 (when (stringp method)
2381 (setq method (gnus-server-to-method method)))
2382 (memq option (assoc (format "%s" (car method))
2383 gnus-valid-select-methods)))
2385 (defun gnus-server-extend-method (group method)
2386 ;; This function "extends" a virtual server. If the server is
2387 ;; "hello", and the select method is ("hello" (my-var "something"))
2388 ;; in the group "alt.alt", this will result in a new virtual server
2389 ;; called "hello+alt.alt".
2390 (if (or (not (gnus-similar-server-opened method))
2391 (not (cddr method)))
2393 `(,(car method) ,(concat (cadr method) "+" group)
2394 (,(intern (format "%s-address" (car method))) ,(cadr method))
2397 (defun gnus-similar-server-opened (method)
2398 (let ((opened gnus-opened-servers))
2399 (while (and method opened)
2400 (when (and (equal (cadr method) (cadaar opened))
2401 (not (equal method (caar opened))))
2406 (defun gnus-server-status (method)
2407 "Return the status of METHOD."
2408 (nth 1 (assoc method gnus-opened-servers)))
2410 (defun gnus-group-name-to-method (group)
2411 "Guess a select method based on GROUP."
2412 (if (string-match ":" group)
2413 (let ((server (substring group 0 (match-beginning 0))))
2414 (if (string-match "\\+" server)
2415 (list (intern (substring server 0 (match-beginning 0)))
2416 (substring server (match-end 0)))
2417 (list (intern server) "")))
2418 gnus-select-method))
2420 (defun gnus-find-method-for-group (group &optional info)
2421 "Find the select method that GROUP uses."
2422 (or gnus-override-method
2425 (let ((info (or info (gnus-get-info group)))
2428 (not (setq method (gnus-info-method info)))
2429 (equal method "native"))
2432 (cond ((stringp method)
2433 (gnus-server-to-method method))
2434 ((stringp (cadr method))
2435 (gnus-server-extend-method group method))
2438 (cond ((equal (cadr method) "")
2440 ((null (cadr method))
2441 (list (car method) ""))
2443 (gnus-server-add-address method)))))))
2445 (defun gnus-check-backend-function (func group)
2446 "Check whether GROUP supports function FUNC.
2447 GROUP can either be a string (a group name) or a select method."
2449 (let ((method (if (stringp group)
2450 (car (gnus-find-method-for-group group))
2452 (unless (featurep method)
2454 (fboundp (intern (format "%s-%s" method func))))))
2456 (defun gnus-methods-using (feature)
2457 "Find all methods that have FEATURE."
2458 (let ((valids gnus-valid-select-methods)
2461 (when (memq feature (car valids))
2462 (push (car valids) outs))
2463 (setq valids (cdr valids)))
2466 (defun gnus-read-group (prompt &optional default)
2467 "Prompt the user for a group name.
2468 Disallow illegal group names."
2474 (setq group (read-string (concat prefix prompt)
2475 (cons (or default "") 0)
2476 'gnus-group-history)))
2477 (setq prefix (format "Illegal group name: \"%s\". " group)
2481 (defun gnus-read-method (prompt)
2482 "Prompt the user for a method.
2483 Allow completion over sensible values."
2486 prompt (append gnus-valid-select-methods gnus-predefined-server-alist
2488 nil t nil 'gnus-method-history)))
2491 (setq method gnus-select-method))
2492 ((assoc method gnus-valid-select-methods)
2493 (list (intern method)
2494 (if (memq 'prompt-address
2495 (assoc method gnus-valid-select-methods))
2496 (read-string "Address: ")
2498 ((assoc method gnus-server-alist)
2501 (list (intern method) "")))))
2503 ;;; User-level commands.
2506 (defun gnus-slave-no-server (&optional arg)
2507 "Read network news as a slave, without connecting to local server"
2509 (gnus-no-server arg t))
2512 (defun gnus-no-server (&optional arg slave)
2514 If ARG is a positive number, Gnus will use that as the
2515 startup level. If ARG is nil, Gnus will be started at level 2.
2516 If ARG is non-nil and not a positive number, Gnus will
2517 prompt the user for the name of an NNTP server to use.
2518 As opposed to `gnus', this command will not connect to the local server."
2520 (gnus-no-server-1 arg slave))
2523 (defun gnus-slave (&optional arg)
2524 "Read news as a slave."
2526 (gnus arg nil 'slave))
2529 (defun gnus-other-frame (&optional arg)
2530 "Pop up a frame to read news."
2532 (let ((window (get-buffer-window gnus-group-buffer)))
2534 (select-frame (window-frame window)))
2535 ((= (length (frame-list)) 1)
2536 (select-frame (make-frame)))
2542 (defun gnus (&optional arg dont-connect slave)
2544 If ARG is non-nil and a positive number, Gnus will use that as the
2545 startup level. If ARG is non-nil and not a positive number, Gnus will
2546 prompt the user for the name of an NNTP server to use."
2548 (gnus-1 arg dont-connect slave))
2550 ;; Allow redefinition of Gnus functions.
2556 ;;; gnus.el ends here