X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fgnus.el;h=bc4db721a33fee46c4a114b40bc210fc49e3d997;hb=f79c1bc5deebf8d629ac039e94c6fad5f149529c;hp=4d5fe91d65872b0ade03463dea66cdfaf6c620a6;hpb=cbf75b1e3f7f3265f0a9da3db7cf721a31ffda94;p=elisp%2Fgnus.git- diff --git a/lisp/gnus.el b/lisp/gnus.el index 4d5fe91..bc4db72 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -1130,21 +1130,17 @@ used to 899, you would say something along these lines: :group 'gnus-server :type 'file) -;; This function is used to check both the environment variable -;; NNTPSERVER and the /etc/nntpserver file to see whether one can find -;; an nntp server name default. (defun gnus-getenv-nntpserver () + "Find default nntp server. +Check the NNTPSERVER environment variable and the +`gnus-nntpserver-file' file." (or (getenv "NNTPSERVER") (and (file-readable-p gnus-nntpserver-file) - (save-excursion - (set-buffer (gnus-get-buffer-create " *gnus nntp*")) + (with-temp-buffer (insert-file-contents gnus-nntpserver-file) (let ((name (buffer-string))) - (prog1 - (if (string-match "\\'[ \t\n]*$" name) - nil - name) - (kill-buffer (current-buffer)))))))) + (unless (string-match "\\`[ \t\n]*$" name) + name)))))) (defcustom gnus-select-method (condition-case nil