]> git.eshelyaron.com Git - emacs.git/commitdiff
(PC-expand-many-files): Remove.
authorJuanma Barranquero <lekktu@gmail.com>
Mon, 22 Oct 2007 09:46:08 +0000 (09:46 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Mon, 22 Oct 2007 09:46:08 +0000 (09:46 +0000)
(PC-do-completion): Call file-expand-wildcards instead of PC-expand-many-files.

lisp/ChangeLog
lisp/complete.el

index 6279ddd871dfd968c7a59ae04bf4dae885f7c11e..368b6f4da169f2eed75385fd37473f34b519444a 100644 (file)
@@ -1,3 +1,12 @@
+2007-10-20  Sean O'Rourke  <sorourke@cs.ucsd.edu>
+
+       * complete.el (PC-expand-many-files): Remove.
+       (PC-do-completion): Call file-expand-wildcards instead of
+       PC-expand-many-files.
+
+       * net/tramp.el (tramp-handle-expand-many-files): Remove.
+       (PC-expand-many-files): Remove advice.
+
 2007-10-22  Glenn Morris  <rgm@gnu.org>
 
        * progmodes/f90.el: Remove leading "*" from defcustom doc-strings.
index bc581052508e196c0b9c1699f5412e5e5f2f7398..e1d0ef07df4127810812625675e6a022ba8adef9 100644 (file)
@@ -515,7 +515,7 @@ GOTO-END is non-nil, however, it instead replaces up to END."
                                 "*"
                                 (substring pat p))
                     p (+ p 2)))
-            (setq files (PC-expand-many-files (concat pat "*")))
+            (setq files (file-expand-wildcards (concat pat "*")))
             (if files
                 (let ((dir (file-name-directory (car files)))
                       (p files))
@@ -609,7 +609,7 @@ GOTO-END is non-nil, however, it instead replaces up to END."
                    (setq
                     basestr ""
                     p nil
-                    poss (PC-expand-many-files
+                   poss (file-expand-wildcards
                           (concat "/"
                                   (mapconcat #'list (match-string 1 str) "*/")
                                   "*"))
@@ -969,61 +969,6 @@ or properties are considered."
      (goto-char end)
      (PC-do-completion nil beg end)))
 
-;; Use the shell to do globbing.
-;; This could now use file-expand-wildcards instead.
-
-(defun PC-expand-many-files (name)
-  (with-current-buffer (generate-new-buffer " *Glob Output*")
-    (erase-buffer)
-    (when (and (file-name-absolute-p name)
-               (not (file-directory-p default-directory)))
-      ;; If the current working directory doesn't exist `shell-command'
-      ;; signals an error.  So if the file names we're looking for don't
-      ;; depend on the working directory, switch to a valid directory first.
-      (setq default-directory "/"))
-    (shell-command (concat "echo " name) t)
-    (goto-char (point-min))
-    ;; CSH-style shells were known to output "No match", whereas
-    ;; SH-style shells tend to simply output `name' when no match is found.
-    (if (looking-at (concat ".*No match\\|\\(^\\| \\)\\("
-                           (regexp-quote name)
-                           "\\|"
-                           (regexp-quote (expand-file-name name))
-                           "\\)\\( \\|$\\)"))
-       nil
-      (insert "(\"")
-      (while (search-forward " " nil t)
-       (delete-backward-char 1)
-       (insert "\" \""))
-      (goto-char (point-max))
-      (delete-backward-char 1)
-      (insert "\")")
-      (goto-char (point-min))
-      (let ((files (read (current-buffer))) (p nil))
-       (kill-buffer (current-buffer))
-       (or (equal completion-ignored-extensions PC-ignored-extensions)
-           (setq PC-ignored-regexp
-                 (concat "\\("
-                         (mapconcat
-                          'regexp-quote
-                          (setq PC-ignored-extensions
-                                completion-ignored-extensions)
-                          "\\|")
-                         "\\)\\'")))
-       (setq p nil)
-       (while files
-          ;; This whole process of going through to shell, to echo, and
-          ;; finally parsing the output is a hack.  It breaks as soon as
-          ;; there are spaces in the file names or when the no-match
-          ;; message changes.  To make up for it, we check that what we read
-          ;; indeed exists, so we may miss some files, but we at least won't
-          ;; list non-existent ones.
-         (or (not (file-exists-p (car files)))
-             (string-match PC-ignored-regexp (car files))
-             (setq p (cons (car files) p)))
-         (setq files (cdr files)))
-       p))))
-
 ;; Facilities for loading C header files.  This is independent from the
 ;; main completion code.  See also the variable `PC-include-file-path'
 ;; at top of this file.