X-Git-Url: http://git.chise.org/gitweb/?p=elisp%2Fflim.git;a=blobdiff_plain;f=md5.el;fp=md5.el;h=8c4d7c05762976c90eb9aa54be8b9b5102c8ed88;hp=168236ede1ad3ef0cb8ef633581e60e355757d5a;hb=dfc2a77b02e2010e37ad46f4e6d6bbadd27ae8fd;hpb=85bf0cd47a81947bf45ca834d071e902632109f3 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)))