Commit 8fff8daa authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/pcomplete.el (pcomplete-completions-at-point):

Obey pcomplete-ignore-case.  Don't call pcomplete-norm-func unless
pcomplete-seen is non-nil.
(pcomplete-comint-setup): Also recognize the new comint/shell
completion functions.
(pcomplete-do-complete): Don't call pcomplete-norm-func unless
pcomplete-seen is non-nil.
parent 4cf0fdcb
2011-04-28 Stefan Monnier <monnier@iro.umontreal.ca>
* pcomplete.el (pcomplete-completions-at-point):
Obey pcomplete-ignore-case. Don't call pcomplete-norm-func unless
pcomplete-seen is non-nil.
(pcomplete-comint-setup): Also recognize the new comint/shell
completion functions.
(pcomplete-do-complete): Don't call pcomplete-norm-func unless
pcomplete-seen is non-nil.
2011-04-27 Niels Giesen <niels.giesen@gmail.com> 2011-04-27 Niels Giesen <niels.giesen@gmail.com>
* calendar/icalendar.el (diary-lib): Add require statement. * calendar/icalendar.el (diary-lib): Add require statement.
......
...@@ -522,23 +522,24 @@ Same as `pcomplete' but using the standard completion UI." ...@@ -522,23 +522,24 @@ Same as `pcomplete' but using the standard completion UI."
(directory-file-name f))) (directory-file-name f)))
pcomplete-seen)) pcomplete-seen))
(lambda (f) (lambda (f)
(not (member (not (when pcomplete-seen
(member
(funcall pcomplete-norm-func (funcall pcomplete-norm-func
(directory-file-name f)) (directory-file-name f))
pcomplete-seen)))))) pcomplete-seen)))))))
(unless (zerop (length pcomplete-termination-string))
(list
beg (point)
;; Add a space at the end of completion. Use a terminator-regexp ;; Add a space at the end of completion. Use a terminator-regexp
;; that never matches since the terminator cannot appear ;; that never matches since the terminator cannot appear
;; within the completion field anyway. ;; within the completion field anyway.
(if (zerop (length pcomplete-termination-string)) (setq table
table (apply-partially #'completion-table-with-terminator
(apply-partially 'completion-table-with-terminator
(cons pcomplete-termination-string (cons pcomplete-termination-string
"\\`a\\`") "\\`a\\`")
table)) table)))
:predicate pred)))) (when pcomplete-ignore-case
(setq table
(apply-partially #'completion-table-case-fold table)))
(list beg (point) table :predicate pred))))
;; I don't think such commands are usable before first setting up buffer-local ;; I don't think such commands are usable before first setting up buffer-local
;; variables to parse args, so there's no point autoloading it. ;; variables to parse args, so there's no point autoloading it.
...@@ -781,7 +782,9 @@ this is `comint-dynamic-complete-functions'." ...@@ -781,7 +782,9 @@ this is `comint-dynamic-complete-functions'."
(set (make-local-variable completef-sym) (set (make-local-variable completef-sym)
(copy-sequence (symbol-value completef-sym))) (copy-sequence (symbol-value completef-sym)))
(let* ((funs (symbol-value completef-sym)) (let* ((funs (symbol-value completef-sym))
(elem (or (memq 'shell-dynamic-complete-filename funs) (elem (or (memq 'comint-filename-completion funs)
(memq 'shell-filename-completion funs)
(memq 'shell-dynamic-complete-filename funs)
(memq 'comint-dynamic-complete-filename funs)))) (memq 'comint-dynamic-complete-filename funs))))
(if elem (if elem
(setcar elem 'pcomplete) (setcar elem 'pcomplete)
...@@ -1248,11 +1251,12 @@ extra checking, and munging of the COMPLETIONS list." ...@@ -1248,11 +1251,12 @@ extra checking, and munging of the COMPLETIONS list."
(setq completions (setq completions
(apply-partially 'completion-table-with-predicate (apply-partially 'completion-table-with-predicate
completions completions
(when pcomplete-seen
(lambda (f) (lambda (f)
(not (member (not (member
(funcall pcomplete-norm-func (funcall pcomplete-norm-func
(directory-file-name f)) (directory-file-name f))
pcomplete-seen))) pcomplete-seen))))
'strict))) 'strict)))
;; OK, we've got a list of completions. ;; OK, we've got a list of completions.
(if pcomplete-show-list (if pcomplete-show-list
......
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