[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BibTeX completion via completion-in-region

From: Stefan Monnier
Subject: Re: BibTeX completion via completion-in-region
Date: Sat, 05 Dec 2009 13:44:25 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

> The old BibTeX code achieved this goal in two steps, by hooking into
> choose-completion-string-functions plus using the return value of
> bibtex-complete-internal. (Unfortunately, I cannot recall all
> details anymore under which circumstances one or the other step was
> needed.) Now bibtex-complete-internal does not return the completion
> anymore (because of completion-in-region) so that this step doesn't
> work anymore in the old way. Is this step really not needed anymore
> (and should be removed from the code)? Is it sufficient now that the
> post-completion procesing is done inside choose-completion-string-functions?

Check bibtex-complete-internal again, it ends with:

    (when (completion-in-region beg end completions)
      (buffer-substring beg (point)))))

it's not perfect, but should work for now.
Bibtex-mode's completion (as well as a few others) show the need for
some kind of "completion-hook" that gets run when a completion is
performed (e.g. via TAB or via choosing something in the *Completions*
buffer), so this should/will be added at some point in the future.
Currently, I'm mostly going through all the packages and making them use
completion-in-region to try and see what needs to be added (like this


reply via email to

[Prev in Thread] Current Thread [Next in Thread]