From: shuhei Date: Sun, 18 Mar 2001 12:24:28 +0000 (+0000) Subject: Support for built-in `md5' of Emacs 21. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=d19ec5ec5892168ca93eecefc8a96f1da4b569da;p=elisp%2Fflim.git Support for built-in `md5' of Emacs 21. Removed hack for compiler. (md5-dl-module): Moved to md5.el. (md5-dl-handle): Do `dynamic-link' unconditionally. (md5-region): Not interactive. (md5): Removed autoload cookie. --- diff --git a/md5-dl.el b/md5-dl.el index 8473ee2..bcbf897 100644 --- a/md5-dl.el +++ b/md5-dl.el @@ -26,34 +26,19 @@ ;;; Code: -(eval-when-compile - (defun-maybe md5-string (a)) - (defun-maybe dynamic-link (a)) - (defun-maybe dynamic-call (a b))) +(provide 'md5-dl) ; beware of circular dependency. +(eval-when-compile (require 'md5)) ; md5-dl-module. -(defvar md5-dl-module - (if (and (fboundp 'md5-string) - (subrp (symbol-function 'md5-string))) - nil - (if (fboundp 'dynamic-link) - (let ((path (expand-file-name "md5.so" exec-directory))) - (and (file-exists-p path) - path))))) - -(defvar md5-dl-handle - (and (stringp md5-dl-module) - (file-exists-p md5-dl-module) - (dynamic-link md5-dl-module))) +;;; This file is loaded (from "md5.el") only when md5-dl-module is exists. +(defvar md5-dl-handle (dynamic-link md5-dl-module)) ;;; md5-dl-module provides `md5-string'. (dynamic-call "emacs_md5_init" md5-dl-handle) (defun md5-region (beg end) - (interactive "r") (md5-string (buffer-substring-no-properties beg end))) -;;; Note that XEmacs built-in version takes two more args: CODING and NOERROR. -;;;###autoload +;;; Note that v21 `md5' takes two more args: CODING and NOERROR. (defun md5 (object &optional beg end) "Return the MD5 (a secure message digest algorithm) of an object. OBJECT is either a string or a buffer.