;;; gnus-util.el --- utility functions for Gnus
-;; Copyright (C) 1996-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2012 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news
image)))
image)))
+(defun gnus-recursive-directory-files (dir)
+ "Return all regular files below DIR."
+ (let (files)
+ (dolist (file (directory-files dir t))
+ (when (and (not (member (file-name-nondirectory file) '("." "..")))
+ (file-readable-p file))
+ (cond
+ ((file-regular-p file)
+ (push file files))
+ ((file-directory-p file)
+ (setq files (append (gnus-recursive-directory-files file) files))))))
+ files))
+
(defun gnus-list-memq-of-list (elements list)
"Return non-nil if any of the members of ELEMENTS are in LIST."
(let ((found nil))
(gnus-macroexpand-all expanded environment)))
form))))
-(eval-when-compile
- ;; This is unnecessary in the compiled version as it is a macro.
- (if (fboundp 'bound-and-true-p)
- (defalias 'gnus-bound-and-true-p 'bound-and-true-p)
- (defmacro gnus-bound-and-true-p (var)
- "Return the value of symbol VAR if it is bound, else nil."
- `(and (boundp (quote ,var)) ,var))))
-
-(defun gnus-bound-and-true-dumber-p (sym)
+;; Simple check: can be a macro but this way, although slow, it's really clear.
+;; We don't use `bound-and-true-p' because it's not in XEmacs.
+(defun gnus-bound-and-true-p (sym)
(and (boundp sym) (symbol-value sym)))
(provide 'gnus-util)