summaryrefslogtreecommitdiff
path: root/lisp/minibuffer.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2011-04-28 12:32:28 -0300
committerStefan Monnier <monnier@iro.umontreal.ca>2011-04-28 12:32:28 -0300
commitd1bb66232235211a8383356ef2851f68ac864a3f (patch)
treeca3ca65e7daa640854d7c00ffbe83f691e9b5e9a /lisp/minibuffer.el
parentd178f871644d97853be0f89d05a8fc5649e5d620 (diff)
downloademacs-d1bb66232235211a8383356ef2851f68ac864a3f.tar.gz
Make MH-E use completion-at-point
* lisp/mh-e/mh-letter.el (mh-letter-completion-at-point): New function, extracted from mh-letter-complete (mh-letter-mode, mh-letter-complete, mh-letter-complete-or-space): Use it. (mh-complete-word): Only use the common-substring arg when it works. (mh-folder-expand-at-point): * lisp/mh-e/mh-alias.el (mh-alias-letter-expand-alias): Return data suitable for completion-at-point-functions. * lisp/mh-e/mh-utils.el (mh-folder-completion-function): Make it work like file-name completion, so partial-completion can do its job. * lisp/minibuffer.el (completion-at-point, completion-help-at-point): Don't presume that a given completion-at-point-function will always use the same calling convention.
Diffstat (limited to 'lisp/minibuffer.el')
-rw-r--r--lisp/minibuffer.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 4bf06a45238..7bd256afc79 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1377,6 +1377,10 @@ Currently supported properties are:
"List of well-behaved functions found on `completion-at-point-functions'.")
(defun completion--capf-wrapper (fun which)
+ ;; FIXME: The safe/misbehave handling assumes that a given function will
+ ;; always return the same kind of data, but this breaks down with functions
+ ;; like comint-completion-at-point or mh-letter-completion-at-point, which
+ ;; could be sometimes safe and sometimes misbehaving (and sometimes neither).
(if (case which
(all t)
(safe (member fun completion--capf-safe-funs))
@@ -1408,7 +1412,7 @@ The completion method is determined by `completion-at-point-functions'."
(completion-in-region-mode-predicate
(lambda ()
;; We're still in the same completion field.
- (eq (car (funcall hookfun)) start))))
+ (eq (car-safe (funcall hookfun)) start))))
(completion-in-region start end collection
(plist-get plist :predicate))))
;; Maybe completion already happened and the function returned t.
@@ -1433,7 +1437,7 @@ The completion method is determined by `completion-at-point-functions'."
(completion-in-region-mode-predicate
(lambda ()
;; We're still in the same completion field.
- (eq (car (funcall hookfun)) start)))
+ (eq (car-safe (funcall hookfun)) start)))
(ol (make-overlay start end nil nil t)))
;; FIXME: We should somehow (ab)use completion-in-region-function or
;; introduce a corresponding hook (plus another for word-completion,