aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2006-05-22 18:09:40 +0000
committerStefan Monnier <[email protected]>2006-05-22 18:09:40 +0000
commit35731e3bcd8268b6fa669aa35608a241dc19c26d (patch)
treeaf0873342f9e2a55e0aae8568dcb3f9568f7ddae
parente6d33cab400ae30fb06081baab55aec6a2a97530 (diff)
(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 9282681116..a763c61124 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,14 @@
+2006-05-22 Stefan Monnier <[email protected]>
+
+ * complete.el (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.
+
2006-05-22 Reiner Steib <[email protected]>
- * textmodes/bibtex.el (bibtex-maintain-sorted-entries): Quote
- safe-local-variable predicate.
+ * textmodes/bibtex.el (bibtex-maintain-sorted-entries):
+ Quote safe-local-variable predicate.
2006-05-22 Thien-Thi Nguyen <[email protected]>
@@ -9,15 +16,13 @@
2006-05-21 Roland Winkler <[email protected]>
- * textmodes/bibtex.el (bibtex-maintain-sorted-entries): Mark as
- safe.
+ * textmodes/bibtex.el (bibtex-maintain-sorted-entries): Mark as safe.
* progmodes/make-mode.el (makefile-special-targets-list)
(makefile-macro-table, makefile-target-table): Mark as risky.
(makefile-query-one-target-method): Make this the alias for the
following variable.
- (makefile-query-one-target-method-function): Make this the real
- name.
+ (makefile-query-one-target-method-function): Make this the real name.
* textmodes/artist.el (artist-text-renderer): Make this the alias
for the following variable.
diff --git a/lisp/complete.el b/lisp/complete.el
index 6620db860c..d0e3fbe8dd 100644
--- a/lisp/complete.el
+++ b/lisp/complete.el
@@ -369,7 +369,7 @@ of `minibuffer-completion-table' and the minibuffer contents.")
(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 @@ of `minibuffer-completion-table' and the minibuffer contents.")
(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 @@ of `minibuffer-completion-table' and the minibuffer contents.")
(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 @@ absolute rather than relative to some directory on the SEARCH-PATH."
(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