aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2007-10-22 09:46:08 +0000
committerJuanma Barranquero2007-10-22 09:46:08 +0000
commitda3e76dc206b444850242dcd3788864fd7f3b4c5 (patch)
treed1a68255cd1a86b1c0c3c27b659f0bf7bbde1485
parente8308ca76096fb8a7da02425ade339d32a2f4496 (diff)
downloademacs-da3e76dc206b444850242dcd3788864fd7f3b4c5.tar.gz
emacs-da3e76dc206b444850242dcd3788864fd7f3b4c5.zip
(PC-expand-many-files): Remove.
(PC-do-completion): Call file-expand-wildcards instead of PC-expand-many-files.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/complete.el59
2 files changed, 11 insertions, 57 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6279ddd871d..368b6f4da16 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12007-10-20 Sean O'Rourke <sorourke@cs.ucsd.edu>
2
3 * complete.el (PC-expand-many-files): Remove.
4 (PC-do-completion): Call file-expand-wildcards instead of
5 PC-expand-many-files.
6
7 * net/tramp.el (tramp-handle-expand-many-files): Remove.
8 (PC-expand-many-files): Remove advice.
9
12007-10-22 Glenn Morris <rgm@gnu.org> 102007-10-22 Glenn Morris <rgm@gnu.org>
2 11
3 * progmodes/f90.el: Remove leading "*" from defcustom doc-strings. 12 * progmodes/f90.el: Remove leading "*" from defcustom doc-strings.
diff --git a/lisp/complete.el b/lisp/complete.el
index bc581052508..e1d0ef07df4 100644
--- a/lisp/complete.el
+++ b/lisp/complete.el
@@ -515,7 +515,7 @@ GOTO-END is non-nil, however, it instead replaces up to END."
515 "*" 515 "*"
516 (substring pat p)) 516 (substring pat p))
517 p (+ p 2))) 517 p (+ p 2)))
518 (setq files (PC-expand-many-files (concat pat "*"))) 518 (setq files (file-expand-wildcards (concat pat "*")))
519 (if files 519 (if files
520 (let ((dir (file-name-directory (car files))) 520 (let ((dir (file-name-directory (car files)))
521 (p files)) 521 (p files))
@@ -609,7 +609,7 @@ GOTO-END is non-nil, however, it instead replaces up to END."
609 (setq 609 (setq
610 basestr "" 610 basestr ""
611 p nil 611 p nil
612 poss (PC-expand-many-files 612 poss (file-expand-wildcards
613 (concat "/" 613 (concat "/"
614 (mapconcat #'list (match-string 1 str) "*/") 614 (mapconcat #'list (match-string 1 str) "*/")
615 "*")) 615 "*"))
@@ -969,61 +969,6 @@ or properties are considered."
969 (goto-char end) 969 (goto-char end)
970 (PC-do-completion nil beg end))) 970 (PC-do-completion nil beg end)))
971 971
972;; Use the shell to do globbing.
973;; This could now use file-expand-wildcards instead.
974
975(defun PC-expand-many-files (name)
976 (with-current-buffer (generate-new-buffer " *Glob Output*")
977 (erase-buffer)
978 (when (and (file-name-absolute-p name)
979 (not (file-directory-p default-directory)))
980 ;; If the current working directory doesn't exist `shell-command'
981 ;; signals an error. So if the file names we're looking for don't
982 ;; depend on the working directory, switch to a valid directory first.
983 (setq default-directory "/"))
984 (shell-command (concat "echo " name) t)
985 (goto-char (point-min))
986 ;; CSH-style shells were known to output "No match", whereas
987 ;; SH-style shells tend to simply output `name' when no match is found.
988 (if (looking-at (concat ".*No match\\|\\(^\\| \\)\\("
989 (regexp-quote name)
990 "\\|"
991 (regexp-quote (expand-file-name name))
992 "\\)\\( \\|$\\)"))
993 nil
994 (insert "(\"")
995 (while (search-forward " " nil t)
996 (delete-backward-char 1)
997 (insert "\" \""))
998 (goto-char (point-max))
999 (delete-backward-char 1)
1000 (insert "\")")
1001 (goto-char (point-min))
1002 (let ((files (read (current-buffer))) (p nil))
1003 (kill-buffer (current-buffer))
1004 (or (equal completion-ignored-extensions PC-ignored-extensions)
1005 (setq PC-ignored-regexp
1006 (concat "\\("
1007 (mapconcat
1008 'regexp-quote
1009 (setq PC-ignored-extensions
1010 completion-ignored-extensions)
1011 "\\|")
1012 "\\)\\'")))
1013 (setq p nil)
1014 (while files
1015 ;; This whole process of going through to shell, to echo, and
1016 ;; finally parsing the output is a hack. It breaks as soon as
1017 ;; there are spaces in the file names or when the no-match
1018 ;; message changes. To make up for it, we check that what we read
1019 ;; indeed exists, so we may miss some files, but we at least won't
1020 ;; list non-existent ones.
1021 (or (not (file-exists-p (car files)))
1022 (string-match PC-ignored-regexp (car files))
1023 (setq p (cons (car files) p)))
1024 (setq files (cdr files)))
1025 p))))
1026
1027;; Facilities for loading C header files. This is independent from the 972;; Facilities for loading C header files. This is independent from the
1028;; main completion code. See also the variable `PC-include-file-path' 973;; main completion code. See also the variable `PC-include-file-path'
1029;; at top of this file. 974;; at top of this file.