/[emacs]/emacs/lisp/complete.el
ViewVC logotype

Diff of /emacs/lisp/complete.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.37 by monnier, Fri Nov 8 23:39:29 2002 UTC revision 1.38 by friedman, Mon Dec 2 08:49:45 2002 UTC
# Line 383  of `minibuffer-completion-table' and the Line 383  of `minibuffer-completion-table' and the
383               (delete-region beg end)               (delete-region beg end)
384               (insert str)               (insert str)
385               (setq end (+ beg (length str)))))               (setq end (+ beg (length str)))))
386          
387        ;; Prepare various delimiter strings        ;; Prepare various delimiter strings
388        (or (equal PC-word-delimiters PC-delims)        (or (equal PC-word-delimiters PC-delims)
389            (setq PC-delims PC-word-delimiters            (setq PC-delims PC-word-delimiters
# Line 392  of `minibuffer-completion-table' and the Line 392  of `minibuffer-completion-table' and the
392                  PC-delims-list (append PC-delims nil)))                  PC-delims-list (append PC-delims nil)))
393    
394        ;; Add wildcards if necessary        ;; Add wildcards if necessary
395        (let ((dir (file-name-directory str))        (and filename
396              (file (file-name-nondirectory str)))             (let ((dir (file-name-directory str))
397          (while (and (stringp dir) (not (file-directory-p dir)))                   (file (file-name-nondirectory str)))
398            (setq dir (directory-file-name dir))               (while (and (stringp dir) (not (file-directory-p dir)))
399            (setq file (concat (replace-regexp-in-string                 (setq dir (directory-file-name dir))
400                                PC-delim-regex "*\\&"                 (setq file (concat (replace-regexp-in-string
401                                (file-name-nondirectory dir))                                     PC-delim-regex "*\\&"
402                               "*/" file))                                     (file-name-nondirectory dir))
403            (setq dir (file-name-directory dir)))                                    "*/" file))
404          (setq str (concat dir file)))                 (setq dir (file-name-directory dir)))
405                       (setq str (concat dir file))))
406    
407        ;; Look for wildcard expansions in directory name        ;; Look for wildcard expansions in directory name
408        (and filename        (and filename
409             (string-match "\\*.*/" str)             (string-match "\\*.*/" str)
# Line 890  or properties are considered." Line 891  or properties are considered."
891  ;;; This is adapted from lib-complete.el, by Mike Williams.  ;;; This is adapted from lib-complete.el, by Mike Williams.
892  (defun PC-include-file-all-completions (file search-path &optional full)  (defun PC-include-file-all-completions (file search-path &optional full)
893    "Return all completions for FILE in any directory on SEARCH-PATH.    "Return all completions for FILE in any directory on SEARCH-PATH.
894  If optional third argument FULL is non-nil, returned pathnames should be  If optional third argument FULL is non-nil, returned pathnames should be
895  absolute rather than relative to some directory on the SEARCH-PATH."  absolute rather than relative to some directory on the SEARCH-PATH."
896    (setq search-path    (setq search-path
897          (mapcar (lambda (dir)          (mapcar (lambda (dir)
# Line 900  absolute rather than relative to some di Line 901  absolute rather than relative to some di
901        ;; It's an absolute file name, so don't need search-path        ;; It's an absolute file name, so don't need search-path
902        (progn        (progn
903          (setq file (expand-file-name file))          (setq file (expand-file-name file))
904          (file-name-all-completions          (file-name-all-completions
905           (file-name-nondirectory file) (file-name-directory file)))           (file-name-nondirectory file) (file-name-directory file)))
906      (let ((subdir (file-name-directory file))      (let ((subdir (file-name-directory file))
907            (ndfile (file-name-nondirectory file))            (ndfile (file-name-nondirectory file))
# Line 918  absolute rather than relative to some di Line 919  absolute rather than relative to some di
919            (if (file-directory-p dir)            (if (file-directory-p dir)
920                (progn                (progn
921                  (setq file-lists                  (setq file-lists
922                        (cons                        (cons
923                         (mapcar (lambda (file) (concat subdir file))                         (mapcar (lambda (file) (concat subdir file))
924                                 (file-name-all-completions ndfile                                 (file-name-all-completions ndfile
925                                                            (car search-path)))                                                            (car search-path)))
926                         file-lists))))                         file-lists))))
927            (setq search-path (cdr search-path))))            (setq search-path (cdr search-path))))

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26