Mercurial > emacs
diff lisp/complete.el @ 83527:c44562301a11
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-289
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-290
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-291
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-292
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-293
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-567
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Wed, 24 May 2006 09:13:31 +0000 |
parents | b599bb78c1fc |
children | d51a5dc58935 a8190f7e546e |
line wrap: on
line diff
--- a/lisp/complete.el Sat May 20 17:30:48 2006 +0000 +++ b/lisp/complete.el Wed May 24 09:13:31 2006 +0000 @@ -369,7 +369,7 @@ (str (buffer-substring beg end)) (incname (and filename (string-match "<\\([^\"<>]*\\)>?$" str))) (ambig nil) - basestr + basestr origstr env-on regex p offset @@ -415,7 +415,7 @@ (file-name-nondirectory dir)) "*/" file)) (setq dir (file-name-directory dir))) - (setq str (concat dir file)))) + (setq origstr str str (concat dir file)))) ;; Look for wildcard expansions in directory name (and filename @@ -443,7 +443,14 @@ (setq str (concat dir (file-name-nondirectory str))) (insert str) (setq end (+ beg (length str))))) - (setq filename nil table nil pred nil)))) + (if origstr + ;; If the wildcards were introduced by us, it's possible + ;; that read-file-name-internal (especially our + ;; PC-include-file advice) can still find matches for the + ;; original string even if we couldn't, so remove the + ;; added wildcards. + (setq str origstr) + (setq filename nil table nil pred nil))))) ;; Strip directory name if appropriate (if filename @@ -943,10 +950,11 @@ (if (string-match "<\\([^\"<>]*\\)>?\\'" (ad-get-arg 0)) (let* ((string (ad-get-arg 0)) (action (ad-get-arg 2)) - (name (substring string (match-beginning 1) (match-end 1))) + (name (match-string 1 string)) (str2 (substring string (match-beginning 0))) (completion-table - (mapcar (lambda (x) (format "<%s>" x)) + (mapcar (lambda (x) + (format (if (string-match "/\\'" x) "<%s" "<%s>") x)) (PC-include-file-all-completions name (PC-include-file-path))))) (setq ad-return-value