Go to the previous, next chapter.
Appendix A describes the variables and hooks for simple customization and the variables for localization.
gnus-nntp-server
NNTPSERVER
environment variable. If the
server name is preceded by a colon such as `:Mail', the user's
private directory `~/Mail' is used as a news spool. See section Telling GNUS Where To Find the News, for more information.
gnus-nntp-service
"nntp"
. In a
few instances, it must be the number 119
. To use a local news
spool of your machine rather than NNTP, set the variable to nil
.
See section Telling GNUS Where To Find the News, for more information.
gnus-local-domain
DOMAINNAME
is used instead if defined. If the function
system-name
returns the full Internet name, there is no need to
define the domain.
gnus-local-organization
ORGANIZATION
is used instead if defined. If the value begins
with a slash, it is taken as the name of a file whose contents are read
for the value.
gnus-local-timezone
Specifies the local time zone you belong to. The value can be either a
time zone name such as `"JST"' or a difference in hour from GMT
such as `+0900'. If the variable is non-nil
, a general time
zone handling package `timezone.el' is used to generate a valid
date for `Date:' field in terms of RFC822. Otherwise, if it is
nil, GNUS generate a date ignoring the local time zone. If you are
using Bnews, it is okay since `inews' will rewrite the invalid
date. However, if you are using Cnews or INN, you must set the variable
to the correct time zone or remove Date
from the variable
gnus-required-headers
since their `inews' do not rewrite the
wrong `Date:' field.
If you want to display the time of articles in your local time zone,
call the function gnus-gmt-to-local
from the hook
gnus-article-prepare-hook
.
gnus-local-distributions
gnus-use-generic-from
nil
means the local host name of your machine will not appear
in the `From:' field of article headers. If the variable is a
string, it is used as your domain instead of the definition by the
variable gnus-local-domain
or the environment variable
DOMAINNAME
.
gnus-use-generic-path
nil
means the NNTP server name will not appear in the
`Path:' field of article headers. If the variable is a string, it
is used in the `Path:' field as the NNTP server name instead of the
definition by the variable gnus-nntp-server
.
gnus-ignored-newsgroups
Specify a regular expression used to ignore uninterested newsgroups in the active file. Any lines in the active file matching this regular expression are removed from the newsgroup list before anything else is done to it, thus making them effectively invisible. There is no way to know what newsgroups there are if they are ignored.
gnus-ignored-headers
Specifies header fields which should be ignored in an article.
gnus-required-headers
Specifies header fields which should be included in an article you will post. RFC977 and RFC1036 require From, Date, Newsgroups, Subject, Message-ID and Path fields. Organization, Distribution and Lines are optional. If you want GNUS not to generate some fields, remove them from the variable. If news system is Cnews, you may have to remove Date and to add Lines.
gnus-startup-file
gnus-signature-file
gnus-inews-insert-signature
called from the hook
gnus-prepare-article-hook
by default. If there is a file named
`.signature-distribution', it is used instead when the
distribution of the article is distribution. Set the variable to
nil
to prevent appending the signature file automatically.
gnus-use-cross-reference
nil
, cross references are ignored. If it is t
,
articles in subscribed newsgroups are only marked as read. Otherwise,
if it is not nil
nor t
, articles in all newsgroups are
marked as read.
gnus-use-followup-to
nil
, its value is ignored. If it is non-nil
, its value is
used as followup newsgroups. Especially, if it is t
and you are
going to followup to an article in which poster
is specified,
your confirmation is required.
gnus-use-full-window
nil
means to take up the entire screen of Emacs. If the
variable is nil
, the windows used by GNUS will be restricted to
the bounds of the original window. This is very useful if you want to
read articles while you do other work in other windows.
gnus-window-configuration
The variable must be a list of `(action' (g s
a)), where action is an action being performed, and
g, s, and a are the relative heights of the Group Mode
window, the Summary Mode window, and the Article Mode window,
respectively. action is summary
, newsgroups
, or
article
.
The following example is the default window configuration:
(setq gnus-window-configuration '((summary (0 1 0)) (newsgroups (1 0 0)) (article (0 3 10))))
The following is an example of yet another two windows mode. Article buffer is always displayed on a screen. This is useful on a slow terminal.
(setq gnus-window-configuration '((summary (0 1 0)) (newsgroups (1 0 3)) (article (0 1 3))))
The following is an example of three windows mode. Three buffers are always displayed on a screen. This is also useful on a slow terminal.
(setq gnus-window-configuration '((summary (1 4 0)) (newsgroups (1 1 3)) (article (1 1 3))))
gnus-large-newsgroup
gnus-author-copy
AUTHORCOPY
environment variable. The specified file name is
inserted in `FCC:' field, so you have a chance to change the file
name or disable saving a copy by editing this field.
The `FCC:' field is processed by the function
gnus-inews-do-fcc
called from the hook
gnus-inews-article-hook
by default. Unless the first character
of the field is `|'
, the article is saved to the specified file
using the function specified by the variable
gnus-author-copy-saver
. The default function rmail-output
saves in Unix mailbox format. Instead, if the first character is
`|'
, the contents of the article is send to a program specified
by the rest of the value. For example, articles can be saved in an MH
folder by the following:
(setq gnus-author-copy "|/usr/local/lib/mh/rcvstore +Article")
gnus-author-copy-saver
rmail-output
saves in Unix mailbox format.
gnus-use-long-file-name
nil
means that a newsgroup name is used as a default file
name to save articles to. If it is nil
, the directory form of a
newsgroup name is used instead. It is set to nil by default if the
variable system-type
is either `usg-unix-v' or
`xenix'.
gnus-mail-save-name
gnus-rmail-save-name
gnus-folder-save-name
gnus-file-save-name
nntp-header-field
and
gnus-header-field
, respectively. The following functions
are provided as file name generators by default:
gnus-numeric-save-name
gnus-use-long-file-name
.
gnus-Numeric-save-name
gnus-use-long-file-name
.
gnus-plain-save-name
gnus-use-long-file-name
.
gnus-Plain-save-name
gnus-use-long-file-name
.
gnus-folder-save-name
gnus-use-long-file-name
.
gnus-Folder-save-name
gnus-use-long-file-name
.
gnus-summary-save-article
. The function must be
interactively funcallable. In other words, it must be an Emacs command.
The functions currently provided are as follows:
gnus-summary-save-in-mail
, gnus-summary-save-in-rmail
, and
gnus-summary-save-in-file
. The variable is initialized from the
SAVEDIR
environment variable. Its default value is
`~/News'.
nil
means you are a novice to USENET. If it is
non-nil
, verbose messages may be displayed or your confirmations
may be required.
Non-nil
means that your confirmation is required when catching up
a newsgroup in Group mode.
nil
means that newsgroup, subject, and distribution are asked
for interactively when composing a new article.
Non-nil
means that your confirmation is required when exiting
GNUS.
USER
and LOGNAME
environment variables and the function
user-login-name
, if undefined.
NAME
environment variable and the function user-full-name
, if
undefined.
nil
means all headers of an article are shown.
nil
means all headers of an article are saved in a file.
nil
means process a MIME message. The message is processed
by the function specified by the variable gnus-show-mime-method
.
nil
means conversation threads are displayed in a tree
structured form according to references in Summary Mode.
nil
means subjects of lower level threads are hidden if the
thread-based reading is turned on.
nil
means thread subtrees are hidden initially. If thread
subtrees are hidden, you have to run the command
gnus-summary-show-thread
by hand or by using
gnus-select-article-hook
to show them.
nil
means killed thread subtrees are hidden
automatically.
nil
means subject differences are ignored but only references
are taken into account in constructing threads trees. If it is
non-nil
and thread subtrees are hidden, some commands that work
with subjects may not work properly.
nil
means visible articles are automatically extended to
forward and backward if possible when the commands N and P
(gnus-summary-next-article
and gnus-summary-prev-article
)
are executed in Summary Mode.
nil
means the first unread article is selected automatically
when a newsgroup is selected. If you'd like to prevent automatic
selection of the first unread article in some newsgroups, set the
variable to nil
in the hook gnus-select-group-hook
or
gnus-apply-kill-hook
(see section Function Hooks).
nil
means the next newsgroup is selected automatically at the
end of the newsgroup. If the value is t
and the next newsgroup is
empty (no unread articles), GNUS will exit Summary Mode and go back to
Group Mode. If the value is neither nil
nor t
, GNUS won't
exit Summary Mode but will select the following unread newsgroup. If
the value is `quietly', the next unread newsgroup will be selected
without any confirmations.
nil
means an article with the same subject as the current
article is selected automatically like `rn -S'.
nil
means that the cursor is always kept centered in the
Summary Mode window.
nil
means that inserts `To:' field which is filled with
the author of the article when followuping. Mail is sent using the
function specified by the variable gnus-mail-send-method
.
nil
means an article is broken into pages at page delimiters.
The page delimiter is specified by the variable
gnus-page-delimiter
. This may not work with some versions of GNU
Emacs earlier than version 18.50.
"^\^L"
.
nil
means that a summary of digest messages is shown when
reading a digest article using the command
gnus-summary-rmail-digest
.
gnus-summary-next-digest
and gnus-summary-prev-digest
, but
not the command gnus-summary-rmail-digest
.
nntp-header-field
and gnus-header-field
,
respectively.
GNUS provides two functions as follows:
gnus-optional-lines-and-from
gnus-optional-lines
See section Function Hooks, to change optional headers according to selected newsgroups.
Specifies a function to process a MIME message in current buffer. The
function metamail-buffer
which process the buffer through
`metamail' is called by default.
Specifies a function to begin composing reply mail messages. The
function will be called with an optional argument which means yank
original article automatically if non-nil
. To use Mail Mode, set
the variable to gnus-mail-reply-using-mail
. To use mh-e letter
Mode, set the variable to gnus-mail-reply-using-mhe
.
Specifies a function to forward the current message to another user. To
use Mail Mode, set the variable to gnus-mail-forward-using-mail
.
To use mh-e letter Mode, set the variable to
gnus-mail-forward-using-mhe
.
gnus-mail-other-window-using-mail
. To use mh-e letter Mode, set
the variable to gnus-mail-other-window-using-mhe
.
send-mail-function
is the default function
which uses sendmail mail program.
gnus-subscribe-randomly
gnus-subscribe-alphabetically
gnus-subscribe-hierarchically
gnus-subscribe-interactively
The following two definitions illustrate how to write your favorite subscribing method. The following definition (is the definition of the function gnus-subscribe-randomly) adds new newsgroup at the beginning of newsgroups:
(setq gnus-subscribe-newsgroup-method '(lambda (newsgroup) (gnus-subscribe-newsgroup newsgroup (car (car gnus-newsrc-assoc)))))
Instead, if you want to add new newsgroup at the end of newsgroups, use the following:
(setq gnus-subscribe-newsgroup-method '(lambda (newsgroup) (gnus-subscribe-newsgroup newsgroup nil)))
If you want to prevent adding new newsgroups automatically and want to
subscribe them later using the command U
(gnus-group-unsubscribe-group
) in the Newsgroup buffer, use the
following:
(setq gnus-subscribe-newsgroup-method '(lambda (newsgroup) nil)) ;Do nothing.
The following final example must be the most useful for you who want not to add new newsgroups automatically. This definition subscribes a new newsgroup first, and then kills it. The killed newsgroups can be added to the subscription list interactively using Browse-Killed Mode (see section Maintaining Subscriptions).
(setq gnus-subscribe-newsgroup-method '(lambda (newsgroup) (gnus-subscribe-newsgroup newsgroup) (gnus-kill-newsgroup newsgroup)))
nntp-buggy-select
nil
means the select routine of your operating system is
buggy. GNUS may hang up while waiting for NNTP server responses. The
problem may be solved by setting the variable to t
.
nntp-maximum-request
nntp-large-newsgroup
nntp-debug-read
nil
means display dots "..." every 10000 bytes of a message
being received. If it is a number, dots are displayed per the number.
Set the variable to nil
if you are annoyed about verbose messages
while reading news from slow terminal.tcp-program-name
"tcp"
. (the program tcp
comes with GNU Emacs.) This
variable is relevant only if you load the library `tcp.el', which
you should do only if your Emacs does not have the function
open-network-stream
.
nnspool-inews-program
news-inews-program
which is default to `inews'.
nnspool-inews-switches
nnspool-request-post
to pass
to the command `inews' for posting news. Its default value is
("-h")
.
nnspool-spool-directory
news-path
which is default to `/usr/spool/news'.
nnspool-active-file
nnspool-newsgroups-file
nnspool-distributions-file
nnspool-history-file
mhspool-list-folders-method
mhspool-list-folders-using-ls
and
mhspool-list-folders-using-sh
are provided now.mhspool-list-directory-switches
mhspool-list-folders-using-ls
to pass to the command `ls' for getting file listings in a private
directory. There should be one entry for each line. Its default value
is ("-R")
. Some machines may require the ("-R1")
switch.
gnus-group-mode-hook
nil
. This hook is intended to customize Group Mode only
once. It is possible to define or change the NNTP server as you like in
this hook since the hook is called before GNUS is connected to an NNTP
server.
gnus-summary-mode-hook
nil
. This hook is intended to customize Summary Mode only
once. All sorts of searches in Summary Mode normally ignore the case of
the text they are searching through. If you do not want to ignore the
case, set the variable case-fold-search
to nil
in this
hook.
The following example shows how to assign the functions
gnus-summary-next-group
and gnus-summary-prev-group
to
keys in Summary Mode.
(setq gnus-summary-mode-hook '(lambda () (local-set-key "\C-cn" 'gnus-summary-next-group) (local-set-key "\C-cp" 'gnus-summary-prev-group)))
gnus-article-mode-hook
nil
. This hook is intended to customize Article Mode only
once.
gnus-kill-file-mode-hook
nil
.
gnus-browse-killed-mode-hook
nil
.
gnus-open-server-hook
nil
.
gnus-startup-hook
nil
. It is possible to change the behavior
of GNUS according to the server.
gnus-group-prepare-hook
gnus-summary-prepare-hook
gnus-article-prepare-hook
gnus-select-group-hook
The following is an example of sorting the headers listed in the Summary buffer by date and then by subject. Preceding `Re:' of subjects is ignored while comparing subjects.
(setq gnus-select-group-hook '(lambda () ;; First of all, sort by date. (gnus-keysort-headers (function string-lessp) (function (lambda (a) (gnus-sortable-date (gnus-header-date a))))) ;; Then sort by subject ignoring `Re:'. (gnus-keysort-headers (function string-lessp) (function (lambda (a) (if case-fold-search (downcase (gnus-simplify-subject (gnus-header-subject a) t)) (gnus-simplify-subject (gnus-header-subject a) t))))) ))
The following is an example of simplifying subjects like the
gnus-summary-next-same-subject
command does:
(setq gnus-select-group-hook '(lambda () (mapcar (function (lambda (header) (nntp-set-header-subject header (gnus-simplify-subject (gnus-header-subject header) 're-only)))) gnus-newsgroup-headers)))
In some newsgroups, author names are meaningless. It is possible to prevent listing author names in the Summary buffer as follows:
(setq gnus-select-group-hook '(lambda () (cond ((string-equal "comp.sources.unix" gnus-newsgroup-name) (setq gnus-optional-headers (function gnus-optional-lines))) (t (setq gnus-optional-headers (function gnus-optional-lines-and-from))))))
gnus-select-article-hook
nil
.
The default hook definition shows conversation thread subtrees of the selected article automatically as follows:
(setq gnus-select-article-hook '(lambda () (gnus-summary-show-thread)))
It is possible to run Rmail on a digest article automatically as follows:
(setq gnus-select-article-hook '(lambda () (gnus-summary-show-thread) (cond ((string-equal "comp.sys.sun" gnus-newsgroup-name) (gnus-summary-rmail-digest)) ((and (string-equal "comp.text" gnus-newsgroup-name) (string-match "^TeXhax Digest" (gnus-header-subject gnus-current-headers))) (gnus-summary-rmail-digest) ))))
gnus-select-digest-hook
nil
. This hook is intended to modify an article so
that Rmail can work with it. See section Reading Digest Articles, for more
information on digest articles.
The following example is the default hook definition to modify incomplete digest articles:
(setq gnus-select-digest-hook '(lambda () ;; Reply-To: is required by ;; `undigestify-rmail-message'. (or (mail-position-on-field "Reply-to" t) (progn (mail-position-on-field "Reply-to") (insert (gnus-fetch-field "From"))))))
gnus-rmail-digest-hook
nil
. This hook is intended to customize Rmail Mode
for reading digest articles.
gnus-apply-kill-hook
nil
. This hook is intended
to apply kill files to the selected newsgroup. It is set to the
function gnus-apply-kill-file
by default.
Since a general kill file is too heavy to use only for a few newsgroups, a lighter hook function is recommended. For example, if you'd like to apply kills to articles which contain the string `rmgroup' in subject in newsgroup `control', you can use the following hook:
(setq gnus-apply-kill-hook '(lambda () (cond ((string-match "control" gnus-newsgroup-name) (gnus-kill "Subject" "rmgroup") (gnus-expunge "X")))))
See section Kill File, for more information on kill files.
gnus-mark-article-hook
nil
. The hook is intended to mark an article
as read (or saved) automatically when it is selected.
The following example is the default definition of the hook:
(setq gnus-mark-article-hook '(lambda () ;; Mark the selected article as read. (or (memq gnus-current-article gnus-newsgroup-marked) (gnus-summary-mark-as-read gnus-current-article)) ;; Put "+" on the current subject. (gnus-summary-set-current-mark "+") ))
It is possible to mark as saved (`-') instead when an article is selected as follows:
(setq gnus-mark-article-hook '(lambda () ;; Mark the selected article as saved. (gnus-summary-mark-as-unread gnus-current-article) ;; Put "+" on the current subject. (gnus-summary-set-current-mark "+") ))
gnus-prepare-article-hook
nil
. Text changes made by this hook does not affect on the
editing text. The default hook inserts a signature file by calling the
function gnus-inews-insert-signature
.gnus-inews-article-hook
nil
. This hook is called just before sending an article to
the NNTP server or calling the `inews' program. Text changes made
by this hook does not affect on the editing text. It is no recommended
to alter the number of lines of the article since `Lines:' field
may be already there. The default hook does FCC (save an article to the
specified file) by calling the function gnus-inews-do-fcc
.gnus-exit-group-hook
nil
. If your machine is so slow that exiting from Summary
Mode takes a long time, you can inhibit marking articles as read by
using cross-reference information in the `Xref:' field by setting
the variable gnus-newsgroup-headers
to nil
in this
hook.
gnus-exit-gnus-hook
nil
. If you want to clear out Emacs buffers which were
created by GNUS and remain afterwards, you can use this hook.
The following example shows how to kill a buffer which was used for posting news.
(setq gnus-exit-gnus-hook '(lambda () ;; Kill a buffer used for posting news. (and (get-buffer "*post-news*") (kill-buffer "*post-news*"))))
gnus-suspend-gnus-hook
nil
. The purpose is the same as the hook
gnus-exit-gnus-hook
.
gnus-save-newsrc-hook
nil
. This hook is intended to change the way
of backing up the startup file.
Go to the previous, next chapter.