Remove byte-compilation of Gnus format specs.
[gnus] / lisp / gnus-util.el
index 71ed505..072e7b5 100644 (file)
@@ -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 <larsi@gnus.org>
 ;; 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,15 +1990,9 @@ definitions to shadow the loaded ones for use in file byte-compilation."
              (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)