Article View: gnu.emacs.gnus
Article #777changed gnus-inews-organization
From: Roland McGrath
Date: Mon, 20 Mar 1989 03:19
Date: Mon, 20 Mar 1989 03:19
51 lines
2467 bytes
2467 bytes
This replaces gnus-inews-organization in gnus.el to be a little better.
If you didn't get my mods to add this in the first place,
you also need to make gnus-inews-insert-headers use it by making the let set
organization to (gnus-inews-organization). I also suggest that you define
gnus-your-organization to nil so that this function will actually be used.
(defun gnus-inews-organization ()
"Return the user's organization. If gnus-your-domain is defined,
its value is used; if not, and the environment variable ORGANIZATION is
defined, that is used. If one of these is defined, and the value begins
with a slash, it is taken as the name of a file whose contents are read
for the value. If neither of these is defined, and a file `.organization'
or `.organization-DISTRIBUTION' exists in the directory containing
gnus-startup-file, the contents of that file are used."
(let ((value (or gnus-your-organization (getenv "ORGANIZATION")))
distribution)
(or value
(progn
(setq value
(expand-file-name
(concat (file-name-directory gnus-startup-file)
".organization")))
(setq distribution (mail-fetch-field "Distribution"))
(and distribution
(file-exists-p (concat value "-" distribution))
(setq value (concat value "-" distribution)))
(or (file-exists-p value)
(setq value "/usr/lib/news/.organization"))
))
(and value
(and (eq (elt value 0) ?/)
(setq value (expand-file-name value))
(if (file-exists-p value)
(save-excursion
(let ((buf (generate-new-buffer " *GNUS Organization*")))
(set-buffer buf)
(insert-file-contents value)
(setq value (buffer-string))
(and (eq (elt value (1- (length value))) ?\n)
(setq value
(substring value 0 (1- (length value)))))
(kill-buffer buf)
))
(setq value "")
)))
value
))
--
Roland McGrath
Free Software Foundation, Inc.
roland@wheaties.ai.mit.edu, mit-eddie!wheaties.ai.mit.edu!roland
Technical Details
Message-ID:
<MCGRATH.89Mar19191909@paris.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!ucbvax!agate!paris.Berkeley.EDU!mcgrathShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!ucbvax!agate!paris.Berkeley.EDU!mcgrath From: mcgrath@paris.Berkeley.EDU (Roland McGrath) Newsgroups: gnu.emacs.gnus Subject: changed gnus-inews-organization Message-ID: <MCGRATH.89Mar19191909@paris.Berkeley.EDU> Date: 20 Mar 89 03:19:09 GMT Sender: usenet@agate.BERKELEY.EDU Organization: Hackers Anonymous International, Ltd., Inc. (Applications welcome) Lines: 51