* test/Makefile.am (EXTRA_DIST): Add test-riece.el.
[riece] / lisp / riece-compat.el
index ef41c10..2bc6469 100644 (file)
          (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