aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2006-05-22 18:09:40 +0000
committerStefan Monnier2006-05-22 18:09:40 +0000
commit35731e3bcd8268b6fa669aa35608a241dc19c26d (patch)
treeaf0873342f9e2a55e0aae8568dcb3f9568f7ddae
parente6d33cab400ae30fb06081baab55aec6a2a97530 (diff)
downloademacs-35731e3bcd8268b6fa669aa35608a241dc19c26d.tar.gz
emacs-35731e3bcd8268b6fa669aa35608a241dc19c26d.zip
(PC-do-completion): Undo the addition of implicit
wildcards if they did not lead to finding any match. (read-file-name-internal): Don't add the final > if the completion is not finished.
-rw-r--r--lisp/ChangeLog17
-rw-r--r--lisp/complete.el18
2 files changed, 24 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 92826811167..a763c61124a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,14 @@
12006-05-22 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * complete.el (PC-do-completion): Undo the addition of implicit
4 wildcards if they did not lead to finding any match.
5 (read-file-name-internal): Don't add the final > if the completion is
6 not finished.
7
12006-05-22 Reiner Steib <Reiner.Steib@gmx.de> 82006-05-22 Reiner Steib <Reiner.Steib@gmx.de>
2 9
3 * textmodes/bibtex.el (bibtex-maintain-sorted-entries): Quote 10 * textmodes/bibtex.el (bibtex-maintain-sorted-entries):
4 safe-local-variable predicate. 11 Quote safe-local-variable predicate.
5 12
62006-05-22 Thien-Thi Nguyen <ttn@gnu.org> 132006-05-22 Thien-Thi Nguyen <ttn@gnu.org>
7 14
@@ -9,15 +16,13 @@
9 16
102006-05-21 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> 172006-05-21 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
11 18
12 * textmodes/bibtex.el (bibtex-maintain-sorted-entries): Mark as 19 * textmodes/bibtex.el (bibtex-maintain-sorted-entries): Mark as safe.
13 safe.
14 20
15 * progmodes/make-mode.el (makefile-special-targets-list) 21 * progmodes/make-mode.el (makefile-special-targets-list)
16 (makefile-macro-table, makefile-target-table): Mark as risky. 22 (makefile-macro-table, makefile-target-table): Mark as risky.
17 (makefile-query-one-target-method): Make this the alias for the 23 (makefile-query-one-target-method): Make this the alias for the
18 following variable. 24 following variable.
19 (makefile-query-one-target-method-function): Make this the real 25 (makefile-query-one-target-method-function): Make this the real name.
20 name.
21 26
22 * textmodes/artist.el (artist-text-renderer): Make this the alias 27 * textmodes/artist.el (artist-text-renderer): Make this the alias
23 for the following variable. 28 for the following variable.
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