aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/complete.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/complete.el')
-rw-r--r--lisp/complete.el18
1 files changed, 13 insertions, 5 deletions
diff --git a/lisp/complete.el b/lisp/complete.el
index 6620db860c3..d0e3fbe8ddf 100644
--- a/lisp/complete.el
+++ b/lisp/complete.el
@@ -369,7 +369,7 @@ of `minibuffer-completion-table' and the minibuffer contents.")
369 (str (buffer-substring beg end)) 369 (str (buffer-substring beg end))
370 (incname (and filename (string-match "<\\([^\"<>]*\\)>?$" str))) 370 (incname (and filename (string-match "<\\([^\"<>]*\\)>?$" str)))
371 (ambig nil) 371 (ambig nil)
372 basestr 372 basestr origstr
373 env-on 373 env-on
374 regex 374 regex
375 p offset 375 p offset
@@ -415,7 +415,7 @@ of `minibuffer-completion-table' and the minibuffer contents.")
415 (file-name-nondirectory dir)) 415 (file-name-nondirectory dir))
416 "*/" file)) 416 "*/" file))
417 (setq dir (file-name-directory dir))) 417 (setq dir (file-name-directory dir)))
418 (setq str (concat dir file)))) 418 (setq origstr str str (concat dir file))))
419 419
420 ;; Look for wildcard expansions in directory name 420 ;; Look for wildcard expansions in directory name
421 (and filename 421 (and filename
@@ -443,7 +443,14 @@ of `minibuffer-completion-table' and the minibuffer contents.")
443 (setq str (concat dir (file-name-nondirectory str))) 443 (setq str (concat dir (file-name-nondirectory str)))
444 (insert str) 444 (insert str)
445 (setq end (+ beg (length str))))) 445 (setq end (+ beg (length str)))))
446 (setq filename nil table nil pred nil)))) 446 (if origstr
447 ;; If the wildcards were introduced by us, it's possible
448 ;; that read-file-name-internal (especially our
449 ;; PC-include-file advice) can still find matches for the
450 ;; original string even if we couldn't, so remove the
451 ;; added wildcards.
452 (setq str origstr)
453 (setq filename nil table nil pred nil)))))
447 454
448 ;; Strip directory name if appropriate 455 ;; Strip directory name if appropriate
449 (if filename 456 (if filename
@@ -943,10 +950,11 @@ absolute rather than relative to some directory on the SEARCH-PATH."
943 (if (string-match "<\\([^\"<>]*\\)>?\\'" (ad-get-arg 0)) 950 (if (string-match "<\\([^\"<>]*\\)>?\\'" (ad-get-arg 0))
944 (let* ((string (ad-get-arg 0)) 951 (let* ((string (ad-get-arg 0))
945 (action (ad-get-arg 2)) 952 (action (ad-get-arg 2))
946 (name (substring string (match-beginning 1) (match-end 1))) 953 (name (match-string 1 string))
947 (str2 (substring string (match-beginning 0))) 954 (str2 (substring string (match-beginning 0)))
948 (completion-table 955 (completion-table
949 (mapcar (lambda (x) (format "<%s>" x)) 956 (mapcar (lambda (x)
957 (format (if (string-match "/\\'" x) "<%s" "<%s>") x))
950 (PC-include-file-all-completions 958 (PC-include-file-all-completions
951 name (PC-include-file-path))))) 959 name (PC-include-file-path)))))
952 (setq ad-return-value 960 (setq ad-return-value