aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2011-04-27 21:18:12 -0300
committerStefan Monnier2011-04-27 21:18:12 -0300
commit8fff8daa8993c8d91e5cfbe1eb84ebf3f3dfca4c (patch)
treecc180d4ae1e503862645e79f2ee95493c0ab2acd
parent4cf0fdcb1513f92f4ea7c35109fd28dc0e061113 (diff)
downloademacs-8fff8daa8993c8d91e5cfbe1eb84ebf3f3dfca4c.tar.gz
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.
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/pcomplete.el50
2 files changed, 37 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 94e0ecafc3d..fee3f07ccca 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12011-04-28 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * pcomplete.el (pcomplete-completions-at-point):
4 Obey pcomplete-ignore-case. Don't call pcomplete-norm-func unless
5 pcomplete-seen is non-nil.
6 (pcomplete-comint-setup): Also recognize the new comint/shell
7 completion functions.
8 (pcomplete-do-complete): Don't call pcomplete-norm-func unless
9 pcomplete-seen is non-nil.
10
12011-04-27 Niels Giesen <niels.giesen@gmail.com> 112011-04-27 Niels Giesen <niels.giesen@gmail.com>
2 12
3 * calendar/icalendar.el (diary-lib): Add require statement. 13 * calendar/icalendar.el (diary-lib): Add require statement.
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."
522 (directory-file-name f))) 522 (directory-file-name f)))
523 pcomplete-seen)) 523 pcomplete-seen))
524 (lambda (f) 524 (lambda (f)
525 (not (member 525 (not (when pcomplete-seen
526 (funcall pcomplete-norm-func 526 (member
527 (directory-file-name f)) 527 (funcall pcomplete-norm-func
528 pcomplete-seen)))))) 528 (directory-file-name f))
529 529 pcomplete-seen)))))))
530 (list 530 (unless (zerop (length pcomplete-termination-string))
531 beg (point) 531 ;; Add a space at the end of completion. Use a terminator-regexp
532 ;; Add a space at the end of completion. Use a terminator-regexp 532 ;; that never matches since the terminator cannot appear
533 ;; that never matches since the terminator cannot appear 533 ;; within the completion field anyway.
534 ;; within the completion field anyway. 534 (setq table
535 (if (zerop (length pcomplete-termination-string)) 535 (apply-partially #'completion-table-with-terminator
536 table 536 (cons pcomplete-termination-string
537 (apply-partially 'completion-table-with-terminator 537 "\\`a\\`")
538 (cons pcomplete-termination-string 538 table)))
539 "\\`a\\`") 539 (when pcomplete-ignore-case
540 table)) 540 (setq table
541 :predicate pred)))) 541 (apply-partially #'completion-table-case-fold table)))
542 (list beg (point) table :predicate pred))))
542 543
543 ;; I don't think such commands are usable before first setting up buffer-local 544 ;; I don't think such commands are usable before first setting up buffer-local
544 ;; variables to parse args, so there's no point autoloading it. 545 ;; variables to parse args, so there's no point autoloading it.
@@ -781,7 +782,9 @@ this is `comint-dynamic-complete-functions'."
781 (set (make-local-variable completef-sym) 782 (set (make-local-variable completef-sym)
782 (copy-sequence (symbol-value completef-sym))) 783 (copy-sequence (symbol-value completef-sym)))
783 (let* ((funs (symbol-value completef-sym)) 784 (let* ((funs (symbol-value completef-sym))
784 (elem (or (memq 'shell-dynamic-complete-filename funs) 785 (elem (or (memq 'comint-filename-completion funs)
786 (memq 'shell-filename-completion funs)
787 (memq 'shell-dynamic-complete-filename funs)
785 (memq 'comint-dynamic-complete-filename funs)))) 788 (memq 'comint-dynamic-complete-filename funs))))
786 (if elem 789 (if elem
787 (setcar elem 'pcomplete) 790 (setcar elem 'pcomplete)
@@ -1248,11 +1251,12 @@ extra checking, and munging of the COMPLETIONS list."
1248 (setq completions 1251 (setq completions
1249 (apply-partially 'completion-table-with-predicate 1252 (apply-partially 'completion-table-with-predicate
1250 completions 1253 completions
1251 (lambda (f) 1254 (when pcomplete-seen
1252 (not (member 1255 (lambda (f)
1253 (funcall pcomplete-norm-func 1256 (not (member
1254 (directory-file-name f)) 1257 (funcall pcomplete-norm-func
1255 pcomplete-seen))) 1258 (directory-file-name f))
1259 pcomplete-seen))))
1256 'strict))) 1260 'strict)))
1257 ;; OK, we've got a list of completions. 1261 ;; OK, we've got a list of completions.
1258 (if pcomplete-show-list 1262 (if pcomplete-show-list