unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Completion with (:exclusive 'no) is called twice, and doesn't pass over on sole completion.
@ 2012-03-16 11:05 Vitalie Spinu
  2012-03-16 12:18 ` Vitalie Spinu
  2012-03-16 17:20 ` Stefan Monnier
  0 siblings, 2 replies; 14+ messages in thread
From: Vitalie Spinu @ 2012-03-16 11:05 UTC (permalink / raw)
  To: emacs-devel


Hi, 

The completion in emacs 24 is called twice. For example

(defun foo-completion ()
  (when (save-excursion (re-search-backward "\\<\\w*" (point-at-bol) t))
    (let ((token (match-string-no-properties 0))
	  (beg (match-beginning 0))
	  (end (match-end 0)))
      (message "%s:" token)
      (when (= end (point))
	(list beg end (list "aaaa" "aaaaaaa" "bbbb" "truncat") :exclusive 'no)))))

(add-to-list 'completion-at-point-functions 'foo-completion) 
;; it is now (foo-completion lisp-completion-at-point t)

Place your point at the end of 'aaaa and you try to complete. I am
getting 

aaa:
aaaa:

in my message buffer. Which means the completion is called twice. I hope
this is not an intended behavior, as it might seriously interfere with
custom completion. For example I might want to have a different behavior
on the second consequent invocation of the completion (give a message,
modify the candidates etc).

Second problem is that if the completion is sole, the handling is not
passed over. For example after 'truncat I am getting a message "Sole
completion" and the lisp-completion-at-point is not reached at all. I
believe it's not how it should work.

In all the rest, new completion system is virtually perfect, thanks.

Vitalie.




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-03-19 12:49 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-16 11:05 Completion with (:exclusive 'no) is called twice, and doesn't pass over on sole completion Vitalie Spinu
2012-03-16 12:18 ` Vitalie Spinu
2012-03-16 17:20 ` Stefan Monnier
2012-03-16 19:33   ` Vitalie Spinu
2012-03-17 22:34     ` Stefan Monnier
2012-03-17 22:43       ` Lennart Borgman
2012-03-17 23:33       ` Vitalie Spinu
2012-03-18  2:03         ` Stefan Monnier
2012-03-18  9:35           ` Vitalie Spinu
2012-03-18 15:42             ` Stefan Monnier
2012-03-18 19:18               ` Vitalie Spinu
2012-03-19  0:53                 ` Stefan Monnier
2012-03-19  8:35                   ` Vitalie Spinu
2012-03-19 12:49                     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).