Dealing with Emacs 19.34.
[elisp/liece.git] / lisp / liece-compat.el
index 3a01cf0..04771ac 100644 (file)
@@ -109,6 +109,17 @@ Otherwise, this function always returns false.
       (sit-for 2)
       (delete-region savemax (point-max)))))
 
+(defvar liece-read-passwd nil)
+(defun liece-read-passwd (prompt)
+  (if (not liece-read-passwd)
+      (if (functionp 'read-passwd)
+         (setq liece-read-passwd 'read-passwd)
+       (if (load "passwd" t)
+           (setq liece-read-passwd 'read-passwd)
+         (autoload 'ange-ftp-read-passwd "ange-ftp")
+         (setq liece-read-passwd 'ange-ftp-read-passwd))))
+  (funcall liece-read-passwd prompt))
+
 ;; from XEmacs's subr.el
 (defun-maybe replace-in-string (str regexp newtext &optional literal)
   "Replace all matches in STR for REGEXP with NEWTEXT string,