X-Git-Url: https://cgit.sxemacs.org/?p=riece;a=blobdiff_plain;f=lisp%2Friece-compat.el;h=2bc6469bd3425dc5c82e1f2cd678eceef6cd73aa;hp=ef41c107392f4c93d74d746147cc6397aacda2f3;hb=8219491a71b09f19b75e3c569c98ef20300d1269;hpb=005a2a7642c9f43d699922799801124a77d56f5d diff --git a/lisp/riece-compat.el b/lisp/riece-compat.el index ef41c10..2bc6469 100644 --- a/lisp/riece-compat.el +++ b/lisp/riece-compat.el @@ -59,6 +59,19 @@ (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