]> code.delx.au - gnu-emacs/blobdiff - lisp/filecache.el
(Marking Objects): `M-h' accepts prefix arg.
[gnu-emacs] / lisp / filecache.el
index c21b93ba7110187d5bebfa6ac0f3685f5e6c37a6..b27aceae1ea787ad35d11164e948a0076f52122e 100644 (file)
@@ -3,9 +3,9 @@
 ;; Author:  Peter Breton <pbreton@cs.umb.edu>
 ;; Created: Sun Nov 10 1996
 ;; Keywords: convenience
-;; Time-stamp: <2000-08-31 19:44:13 pbreton>
+;; Time-stamp: <2001-11-26 12:03:18 pavel>
 ;;
-;; Copyright (C) 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2000 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -446,7 +446,7 @@ or the optional REGEXP argument."
       (error "No directory found for key %s" file))
      ;; Multiple elements
      (t
-      (let* ((minibuffer-dir (file-name-directory (buffer-string)))
+      (let* ((minibuffer-dir (file-name-directory (minibuffer-contents)))
             (dir-list       (member minibuffer-dir directory-list))
             )
        (setq directory
@@ -503,7 +503,7 @@ the name is considered already unique; only the second substitution
       (
        (completion-ignore-case file-cache-completion-ignore-case)
        (case-fold-search       file-cache-case-fold-search)
-       (string                 (file-name-nondirectory (buffer-string)))
+       (string                 (file-name-nondirectory (minibuffer-contents)))
        (completion-string      (try-completion string file-cache-alist))
        (completion-list)
        (len)
@@ -513,10 +513,10 @@ the name is considered already unique; only the second substitution
      ;; If it's the only match, replace the original contents
      ((or arg (eq completion-string t))
       (setq file-cache-string (file-cache-file-name string))
-      (if (string= file-cache-string (buffer-string))
+      (if (string= file-cache-string (minibuffer-contents))
          (file-cache-temp-minibuffer-message file-cache-sole-match-message)
-       (erase-buffer)
-       (insert-string file-cache-string)
+       (delete-minibuffer-contents)
+       (insert file-cache-string)
        (if file-cache-multiple-directory-message
            (file-cache-temp-minibuffer-message
             file-cache-multiple-directory-message))
@@ -531,8 +531,8 @@ the name is considered already unique; only the second substitution
          (if (and (eq last-command this-command)
                   (string= file-cache-last-completion completion-string))
              (progn
-               (erase-buffer)
-               (insert-string (file-cache-file-name completion-string))
+               (delete-minibuffer-contents)
+               (insert (file-cache-file-name completion-string))
                (setq file-cache-last-completion nil)
                )
            (file-cache-temp-minibuffer-message file-cache-non-unique-message)
@@ -544,7 +544,7 @@ the name is considered already unique; only the second substitution
        (if (> len 1)
            (progn
              (goto-char (point-max))
-             (insert-string
+             (insert
               (substring completion-string (length string)))
              ;; Add our own setup function to the Completions Buffer
              (let ((completion-setup-hook
@@ -557,11 +557,11 @@ the name is considered already unique; only the second substitution
                )
              )
          (setq file-cache-string (file-cache-file-name completion-string))
-         (if (string= file-cache-string (buffer-string))
+         (if (string= file-cache-string (minibuffer-contents))
              (file-cache-temp-minibuffer-message
               file-cache-sole-match-message)
-           (erase-buffer)
-           (insert-string file-cache-string)
+           (delete-minibuffer-contents)
+           (insert file-cache-string)
            (if file-cache-multiple-directory-message
                (file-cache-temp-minibuffer-message
                 file-cache-multiple-directory-message)))