diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-04-27 21:18:12 -0300 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-04-27 21:18:12 -0300 |
commit | 8fff8daa8993c8d91e5cfbe1eb84ebf3f3dfca4c (patch) | |
tree | cc180d4ae1e503862645e79f2ee95493c0ab2acd /lisp/pcomplete.el | |
parent | 4cf0fdcb1513f92f4ea7c35109fd28dc0e061113 (diff) | |
download | emacs-8fff8daa8993c8d91e5cfbe1eb84ebf3f3dfca4c.tar.gz emacs-8fff8daa8993c8d91e5cfbe1eb84ebf3f3dfca4c.tar.bz2 emacs-8fff8daa8993c8d91e5cfbe1eb84ebf3f3dfca4c.zip |
* 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.
Diffstat (limited to 'lisp/pcomplete.el')
-rw-r--r-- | lisp/pcomplete.el | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index a1cb7b237e9..82f809d00ce 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -522,23 +522,24 @@ Same as `pcomplete' but using the standard completion UI." (directory-file-name f))) pcomplete-seen)) (lambda (f) - (not (member - (funcall pcomplete-norm-func - (directory-file-name f)) - pcomplete-seen)))))) - - (list - beg (point) - ;; Add a space at the end of completion. Use a terminator-regexp - ;; that never matches since the terminator cannot appear - ;; within the completion field anyway. - (if (zerop (length pcomplete-termination-string)) - table - (apply-partially 'completion-table-with-terminator - (cons pcomplete-termination-string - "\\`a\\`") - table)) - :predicate pred)))) + (not (when pcomplete-seen + (member + (funcall pcomplete-norm-func + (directory-file-name f)) + pcomplete-seen))))))) + (unless (zerop (length pcomplete-termination-string)) + ;; Add a space at the end of completion. Use a terminator-regexp + ;; that never matches since the terminator cannot appear + ;; within the completion field anyway. + (setq table + (apply-partially #'completion-table-with-terminator + (cons pcomplete-termination-string + "\\`a\\`") + table))) + (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 ;; variables to parse args, so there's no point autoloading it. @@ -781,7 +782,9 @@ this is `comint-dynamic-complete-functions'." (set (make-local-variable completef-sym) (copy-sequence (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)))) (if elem (setcar elem 'pcomplete) @@ -1248,11 +1251,12 @@ extra checking, and munging of the COMPLETIONS list." (setq completions (apply-partially 'completion-table-with-predicate completions - (lambda (f) - (not (member - (funcall pcomplete-norm-func - (directory-file-name f)) - pcomplete-seen))) + (when pcomplete-seen + (lambda (f) + (not (member + (funcall pcomplete-norm-func + (directory-file-name f)) + pcomplete-seen)))) 'strict))) ;; OK, we've got a list of completions. (if pcomplete-show-list |