Add 5.0.0 changes.
[riece] / lisp / riece-compat.el
index ef41c10..3e54caf 100644 (file)
@@ -19,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Code:
 
     (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