From: ueno Date: Thu, 9 Dec 1999 14:55:04 +0000 (+0000) Subject: * smime.el: Require `static' when compiling. X-Git-Tag: emiko-1_13_8~1 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=87e039f84f6a85315f80cfe07dfe30795d04c1a0;p=elisp%2Fsemi.git * smime.el: Require `static' when compiling. (smime-directory-files): New macro. (smime-find-certificate): Use it. --- diff --git a/smime.el b/smime.el index 07a839d..7746f87 100644 --- a/smime.el +++ b/smime.el @@ -39,6 +39,7 @@ ;;; Code: (require 'path-util) +(eval-when-compile (require 'static)) (defgroup smime () "S/MIME interface" @@ -169,10 +170,30 @@ (smime-parse-attribute (buffer-substring (point)(progn (end-of-line)(point)))))))) +(static-condition-case nil + (directory-files nil nil nil nil nil) + (wrong-number-of-arguments + (defmacro smime-directory-files + (directory &optional full match nosort files-only) + (if files-only + `(delq nil (mapcar + (lambda (file) + ,(if (eq files-only t) + `(if (file-directory-p file) nil file) + `(if (file-directory-p file) file nil))) + (directory-files ,directory ,full ,match ,nosort))) + `(directory-files ,directory ,full ,match ,nosort)))) + (wrong-type-argument + (defalias 'smime-directory-files 'directory-files))) + (defsubst smime-find-certificate (attr) (let ((files (if (file-directory-p smime-certificate-directory) - (directory-files smime-certificate-directory - 'full nil nil t) + (delq nil (mapcar (lambda (file) + (if (file-directory-p file) nil + file)) + (directory-files + smime-certificate-directory + 'full))) nil))) (catch 'found (while files