From 51ef56c47fc0b02b20f44b673f8b60350c03b4e1 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 7 Dec 2009 20:06:26 +0000 Subject: * minibuffer.el (completion-at-point-functions): New var. (completion-at-point): New command. * indent.el (indent-for-tab-command): Handle the new `complete' behavior. * progmodes/python.el (python-mode-map): Use completion-at-point. (python-completion-at-point): Rename from python-partial-symbol and adjust for use in completion-at-point-functions. (python-mode): Setup completion-at-point for Python completion. * emacs-lisp/lisp.el (lisp-completion-at-point): New function extracted from lisp-complete-symbol. (lisp-complete-symbol): Use it. * emacs-lisp/lisp-mode.el (emacs-lisp-mode): Use define-derived-mode, setup completion-at-point for Elisp completion. (emacs-lisp-mode-map, lisp-interaction-mode-map): Use completion-at-point. * ielm.el (ielm-map): Use completion-at-point. (inferior-emacs-lisp-mode): Setup completion-at-point for Elisp completion. * progmodes/sym-comp.el: Move to... * obsolete/sym-comp.el: Move from progmodes. --- lisp/emacs-lisp/lisp.el | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'lisp/emacs-lisp/lisp.el') diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 0edd6556dbf..d364f2cb602 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -622,6 +622,15 @@ symbols with function definitions are considered. Otherwise, all symbols with function definitions, values or properties are considered." (interactive) + (let* ((data (lisp-completion-at-point predicate)) + (plist (nthcdr 3 data))) + (let ((completion-annotate-function (plist-get plist :annotate-function))) + (completion-in-region (nth 0 data) (nth 1 data) (nth 2 data) + (plist-get plist :predicate))))) + + +(defun lisp-completion-at-point (&optional predicate) + ;; FIXME: the `end' could be after point? (let* ((end (point)) (beg (with-syntax-table emacs-lisp-mode-syntax-table (save-excursion @@ -648,10 +657,11 @@ considered." nil ;; Else, we assume that a function name is expected. 'fboundp)))))) - (let ((completion-annotate-function - (unless (eq predicate 'fboundp) - (lambda (str) (if (fboundp (intern-soft str)) " "))))) - (completion-in-region beg end obarray predicate)))) + (list beg end obarray + :predicate predicate + :annotate-function + (unless (eq predicate 'fboundp) + (lambda (str) (if (fboundp (intern-soft str)) " ")))))) ;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e ;;; lisp.el ends here -- cgit v1.2.3