From 0fb9d117ae2dc182e0ddd1049f60d1e5f10317e4 Mon Sep 17 00:00:00 2001 From: shuhei Date: Sun, 18 Mar 2001 12:24:33 +0000 Subject: [PATCH] Support for built-in `md5' of Emacs 21. (md5-dl-module): Moved from md5-dl.el. Use it for test whether to require 'md5-dl. --- md5.el | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/md5.el b/md5.el index 168236e..8c4d7c0 100644 --- a/md5.el +++ b/md5.el @@ -49,15 +49,27 @@ ;;; Code: +(defvar md5-dl-module + (cond + ((and (fboundp 'md5) + (subrp (symbol-function 'md5))) + nil) + ((fboundp 'dynamic-link) + ;; Should we take care of `dynamic-link-path'? + (let ((path (expand-file-name "md5.so" exec-directory))) + (if (file-exists-p path) + path + nil))) + (t + nil))) + (cond ((and (fboundp 'md5) (subrp (symbol-function 'md5))) - ;; recent XEmacs has `md5' as a built-in function. - ;; (and 'md5 is already provided.) + ;; do nothing. ) - ((and (fboundp 'dynamic-link) - (file-exists-p (expand-file-name "md5.so" exec-directory))) - ;; Emacs with DL patch. + ((and (stringp md5-dl-module) + (file-exists-p md5-dl-module)) (require 'md5-dl)) (t (require 'md5-el))) -- 1.7.10.4