aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1997-08-25 04:57:07 +0000
committerRichard M. Stallman1997-08-25 04:57:07 +0000
commita36c8d02b016c161b1fd505c3c148883faf998e9 (patch)
treeb07a597658f2cf157ceaa11d38f352c92b5e16d1 /lisp
parentf26c6ccdcba4529ec3e078aa3be4dec532b5ab78 (diff)
downloademacs-a36c8d02b016c161b1fd505c3c148883faf998e9.tar.gz
emacs-a36c8d02b016c161b1fd505c3c148883faf998e9.zip
Require cl at compile time.
(gnus-select-method): Use condition-case, not ignore-errors. (gnus-check-backend-function): Definition moved up.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/gnus.el29
1 files changed, 16 insertions, 13 deletions
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 41cd7172558..e73b3f4438a 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -28,6 +28,8 @@
28 28
29(eval '(run-hooks 'gnus-load-hook)) 29(eval '(run-hooks 'gnus-load-hook))
30 30
31(eval-when-compile (require 'cl))
32
31(require 'custom) 33(require 'custom)
32(require 'gnus-load) 34(require 'gnus-load)
33(require 'message) 35(require 'message)
@@ -771,7 +773,7 @@ used to 899, you would say something along these lines:
771 (kill-buffer (current-buffer)))))))) 773 (kill-buffer (current-buffer))))))))
772 774
773(defcustom gnus-select-method 775(defcustom gnus-select-method
774 (ignore-errors 776 (condition-case nil
775 (nconc 777 (nconc
776 (list 'nntp (or (ignore-errors 778 (list 'nntp (or (ignore-errors
777 (gnus-getenv-nntpserver)) 779 (gnus-getenv-nntpserver))
@@ -782,7 +784,8 @@ used to 899, you would say something along these lines:
782 (if (or (null gnus-nntp-service) 784 (if (or (null gnus-nntp-service)
783 (equal gnus-nntp-service "nntp")) 785 (equal gnus-nntp-service "nntp"))
784 nil 786 nil
785 (list gnus-nntp-service)))) 787 (list gnus-nntp-service)))
788 (error nil))
786 "Default method for selecting a newsgroup. 789 "Default method for selecting a newsgroup.
787This variable should be a list, where the first element is how the 790This variable should be a list, where the first element is how the
788news is to be fetched, the second is the address. 791news is to be fetched, the second is the address.
@@ -1966,6 +1969,17 @@ If ARG, insert string at point."
1966 1969
1967;;; More various functions. 1970;;; More various functions.
1968 1971
1972(defsubst gnus-check-backend-function (func group)
1973 "Check whether GROUP supports function FUNC.
1974GROUP can either be a string (a group name) or a select method."
1975 (ignore-errors
1976 (let ((method (if (stringp group)
1977 (car (gnus-find-method-for-group group))
1978 group)))
1979 (unless (featurep method)
1980 (require method))
1981 (fboundp (intern (format "%s-%s" method func))))))
1982
1969(defun gnus-group-read-only-p (&optional group) 1983(defun gnus-group-read-only-p (&optional group)
1970 "Check whether GROUP supports editing or not. 1984 "Check whether GROUP supports editing or not.
1971If GROUP is nil, `gnus-newsgroup-name' will be checked instead. Note 1985If GROUP is nil, `gnus-newsgroup-name' will be checked instead. Note
@@ -2455,17 +2469,6 @@ If NEWSGROUP is nil, return the global kill file name instead."
2455 (t 2469 (t
2456 (gnus-server-add-address method))))))) 2470 (gnus-server-add-address method)))))))
2457 2471
2458(defsubst gnus-check-backend-function (func group)
2459 "Check whether GROUP supports function FUNC.
2460GROUP can either be a string (a group name) or a select method."
2461 (ignore-errors
2462 (let ((method (if (stringp group)
2463 (car (gnus-find-method-for-group group))
2464 group)))
2465 (unless (featurep method)
2466 (require method))
2467 (fboundp (intern (format "%s-%s" method func))))))
2468
2469(defun gnus-methods-using (feature) 2472(defun gnus-methods-using (feature)
2470 "Find all methods that have FEATURE." 2473 "Find all methods that have FEATURE."
2471 (let ((valids gnus-valid-select-methods) 2474 (let ((valids gnus-valid-select-methods)