Undo the last change.
[riece] / lisp / riece-compat.el
index ef41c10..5e4c2a0 100644 (file)
     (end-of-line)
     (point)))
 
-(defvar riece-read-passwd nil)
+(autoload 'read-passwd "passwd")
+(defvar riece-read-passwd #'read-passwd)
 (defun riece-read-passwd (prompt)
-  (if (not riece-read-passwd)
-      (if (functionp 'read-passwd)
-         (setq riece-read-passwd 'read-passwd)
-       (if (load "passwd" t)
-           (setq riece-read-passwd 'read-passwd)
-         (autoload 'ange-ftp-read-passwd "ange-ftp")
-         (setq riece-read-passwd 'ange-ftp-read-passwd))))
   (funcall riece-read-passwd prompt))
 
+(if (string-match "0\\{0\\}" "")
+    (defun riece-make-interval-regexp (regexp min &optional max)
+      (if max
+         (format "%s\\{%d,%d\\}" regexp min max)
+       (format "%s\\{%d\\}" regexp min)))
+  ;; Emacs 20.7 doesn't support \{...\} in regexps.
+  (defun riece-make-interval-regexp (regexp min &optional max)
+    (mapconcat #'identity
+              (nconc (make-list min regexp)
+                     (if max
+                         (make-list (- max min) (concat regexp "?"))))
+              "")))
+
 (provide 'riece-compat)
 
 ;;; riece-compat.el ends here