aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2010-05-14 23:50:26 -0400
committerStefan Monnier2010-05-14 23:50:26 -0400
commitc26ea4b2a3136ad1870770c39969eda447e11e00 (patch)
tree256ddb3b62f258866ac481fda845fcc01eda427b
parent4b6f0cae87bea9af0314ab15ba58a1cb8728dc6d (diff)
downloademacs-c26ea4b2a3136ad1870770c39969eda447e11e00.tar.gz
emacs-c26ea4b2a3136ad1870770c39969eda447e11e00.zip
* pcomplete.el (pcomplete-completions-at-point): New function,
extracted from pcomplete-std-complete. (pcomplete-std-complete): Use it.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/pcomplete.el17
2 files changed, 19 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e8a7245ab69..83e4012424b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12010-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * pcomplete.el (pcomplete-completions-at-point): New function,
4 extracted from pcomplete-std-complete.
5 (pcomplete-std-complete): Use it.
6
12010-05-15 Glenn Morris <rgm@gnu.org> 72010-05-15 Glenn Morris <rgm@gnu.org>
2 8
3 * Makefile.in (setwins, setwins_almost, setwins_for_subdirs): 9 * Makefile.in (setwins, setwins_almost, setwins_for_subdirs):
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index 65c05ae7487..cf199e69a33 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -444,12 +444,14 @@ in the same way as TABLE completes strings of the form (concat S2 S)."
444;; I don't think such commands are usable before first setting up buffer-local 444;; I don't think such commands are usable before first setting up buffer-local
445;; variables to parse args, so there's no point autoloading it. 445;; variables to parse args, so there's no point autoloading it.
446;; ;;;###autoload 446;; ;;;###autoload
447(defun pcomplete-std-complete () 447(defun pcomplete-completions-at-point ()
448 "Provide standard completion using pcomplete's completion tables. 448 "Provide standard completion using pcomplete's completion tables.
449Same as `pcomplete' but using the standard completion UI." 449Same as `pcomplete' but using the standard completion UI."
450 (interactive)
451 ;; FIXME: it only completes the text before point, whereas the 450 ;; FIXME: it only completes the text before point, whereas the
452 ;; standard UI may also consider text after point. 451 ;; standard UI may also consider text after point.
452 ;; FIXME: the `pcomplete' UI may be used internally during
453 ;; pcomplete-completions and then throw to `pcompleted', thus
454 ;; imposing the pcomplete UI over the standard UI.
453 (catch 'pcompleted 455 (catch 'pcompleted
454 (let* ((pcomplete-stub) 456 (let* ((pcomplete-stub)
455 pcomplete-seen pcomplete-norm-func 457 pcomplete-seen pcomplete-norm-func
@@ -516,7 +518,7 @@ Same as `pcomplete' but using the standard completion UI."
516 (directory-file-name f)) 518 (directory-file-name f))
517 pcomplete-seen)))))) 519 pcomplete-seen))))))
518 520
519 (completion-in-region 521 (list
520 beg (point) 522 beg (point)
521 ;; Add a space at the end of completion. Use a terminator-regexp 523 ;; Add a space at the end of completion. Use a terminator-regexp
522 ;; that never matches since the terminator cannot appear 524 ;; that never matches since the terminator cannot appear
@@ -527,7 +529,14 @@ Same as `pcomplete' but using the standard completion UI."
527 (cons pcomplete-termination-string 529 (cons pcomplete-termination-string
528 "\\`a\\`") 530 "\\`a\\`")
529 table)) 531 table))
530 pred)))) 532 :predicate pred))))
533
534 ;; I don't think such commands are usable before first setting up buffer-local
535 ;; variables to parse args, so there's no point autoloading it.
536 ;; ;;;###autoload
537(defun pcomplete-std-complete ()
538 (let ((completion-at-point-functions '(pcomplete-completions-at-point)))
539 (completion-at-point)))
531 540
532;;; Pcomplete's native UI. 541;;; Pcomplete's native UI.
533 542