X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=lisp%2Fgnus-util.el;h=072e7b5822aa9a53ae6636533fd3e9798936a84a;hp=e9d6ba423fd67492735b11466a476a1673d6b9b4;hb=59403f318f769dc0ff91a59405c4d8d122a10ab6;hpb=e49b49ad79623e7ef7817b91644593b850a1e40c diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index e9d6ba423..072e7b582 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -1,6 +1,6 @@ ;;; 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 ;; Keywords: news @@ -169,15 +169,6 @@ This is a compatibility function for different Emacsen." `(delete-region (point-at-bol) (progn (forward-line ,(or n 1)) (point)))) -(defun gnus-byte-code (func) - "Return a form that can be `eval'ed based on FUNC." - (let ((fval (indirect-function func))) - (if (byte-code-function-p fval) - (let ((flist (append fval nil))) - (setcar flist 'byte-code) - flist) - (cons 'progn (cddr fval))))) - (defun gnus-extract-address-components (from) "Extract address components from a From header. Given an RFC-822 address FROM, extract full name and canonical address. @@ -1927,6 +1918,19 @@ Sizes are in pixels." 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)) @@ -1986,6 +1990,11 @@ definitions to shadow the loaded ones for use in file byte-compilation." (gnus-macroexpand-all expanded environment))) form)))) +;; 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) ;;; gnus-util.el ends here