Commit 4a63ceb8 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(PC-do-completion): Strip out completion-ignored-extensions

before checking whether there are multiple completions.
Don't use `list' unnecessarily when building completion tables.
parent 65c986aa
2006-08-07 Stefan Monnier <monnier@iro.umontreal.ca>
* complete.el (PC-do-completion): Strip out completion-ignored-extensions
before checking whether there are multiple completions.
Don't use `list' unnecessarily when building completion tables.
2006-08-06 Richard Stallman <rms@gnu.org>
 
* help.el (describe-mode): Make minor mode list more concise.
......@@ -672,8 +678,8 @@
 
2006-07-10 Chong Yidong <cyd@stupidchicken.com>
 
* progmodes/cc-awk.el (defconst): Use eval-and-compile to avoid
compilation error.
* progmodes/cc-awk.el (c-awk-escaped-nls*): Use eval-and-compile to
avoid compilation error.
 
* subr.el (sit-for): New function.
 
......
......@@ -553,28 +553,6 @@ of `minibuffer-completion-table' and the minibuffer contents.")
(setq poss (cons (car p) poss))))
(setq p (cdr p)))))
;; Now we have a list of possible completions
(cond
;; No valid completions found
((null poss)
(if (and (eq mode 'word)
(not PC-word-failed-flag))
(let ((PC-word-failed-flag t))
(delete-backward-char 1)
(PC-do-completion 'word))
(beep)
(PC-temp-minibuffer-message (if ambig
" [Ambiguous dir name]"
(if (eq mode 'help)
" [No completions]"
" [No match]")))
nil))
;; More than one valid completion found
((or (cdr (setq helpposs poss))
(memq mode '(help word)))
;; Handle completion-ignored-extensions
(and filename
(not (eq mode 'help))
......@@ -603,6 +581,28 @@ of `minibuffer-completion-table' and the minibuffer contents.")
;; If there are "good" names, use them
(and p (setq poss p))))
;; Now we have a list of possible completions
(cond
;; No valid completions found
((null poss)
(if (and (eq mode 'word)
(not PC-word-failed-flag))
(let ((PC-word-failed-flag t))
(delete-backward-char 1)
(PC-do-completion 'word))
(beep)
(PC-temp-minibuffer-message (if ambig
" [Ambiguous dir name]"
(if (eq mode 'help)
" [No completions]"
" [No match]")))
nil))
;; More than one valid completion found
((or (cdr (setq helpposs poss))
(memq mode '(help word)))
;; Is the actual string one of the possible completions?
(setq p (and (not (eq mode 'help)) poss))
(while (and p
......@@ -623,7 +623,8 @@ of `minibuffer-completion-table' and the minibuffer contents.")
;; Check if next few letters are the same in all cases
(if (and (not (eq mode 'help))
(setq prefix (try-completion (PC-chunk-after basestr skip) (mapcar 'list poss))))
(setq prefix (try-completion (PC-chunk-after basestr skip)
poss)))
(let ((first t) i)
;; Retain capitalization of user input even if
;; completion-ignore-case is set.
......@@ -669,13 +670,9 @@ of `minibuffer-completion-table' and the minibuffer contents.")
(+ beg (length dirname)) end)
skip)
(mapcar
(function
(lambda (x)
(list
(and (string-match skip x)
(substring
x
(match-end 0))))))
(when (string-match skip x)
(substring x (match-end 0))))
poss)))
(or (> i 0) (> (length prefix) 0))
(or (not (eq mode 'word))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment