all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* choose-completion-string-functions
@ 2004-09-12 16:08 Roland Winkler
  2004-09-12 18:52 ` choose-completion-string-functions Kim F. Storm
  0 siblings, 1 reply; 2+ messages in thread
From: Roland Winkler @ 2004-09-12 16:08 UTC (permalink / raw)
  Cc: Stefan, emacs-devel

Hi Kim

As far as I can tell, you introduced the new emacs variable
choose-completion-string-functions in order to use it for ido.el.
I thought this variable comes handy for bibtex.el, however there's
a problem with it:

bibtex.el uses choose-completion-string-functions as a buffer-local
variable in BibTeX mode. (The idea in bibtex.el is to set its value
depending on the particular situation when completion is requested.)
Of course, this requires that the bibtex buffer is active when
evaluating choose-completion-string-functions.

- I always tested bibtex.el by mouse-clicking the completions in the
  completion buffer (both buffers in the same frame). Then there is
  no problem because the BibTeX buffers remains the active buffer.

- However, when the completion buffer is the active buffer, it is
  deleted before choose-completion-string-functions is evaluated. So
  the active buffer is just the next buffer in the buffer list,
  whatever buffer this is. Of course, the value of
  choose-completion-string-functions in that buffer is usually nil.
  (Stefan Monnier helped me to figure this out.)

Wouldn't it make sense to reverse the order of the following two
statements in choose-completion-string?

      (unless (run-hook-with-args-until-success
	       'choose-completion-string-functions
	       choice buffer mini-p base-size)
	;; Insert the completion into the buffer where it was requested.
	(set-buffer buffer)

Then it is possible to use a local value of
choose-completion-string-functions in completion-reference-buffer.
I hope this does not break any other code. But right now it can
anyway be unpredictable what happens when
choose-completion-string-functions is used.

Roland

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

* Re: choose-completion-string-functions
  2004-09-12 16:08 choose-completion-string-functions Roland Winkler
@ 2004-09-12 18:52 ` Kim F. Storm
  0 siblings, 0 replies; 2+ messages in thread
From: Kim F. Storm @ 2004-09-12 18:52 UTC (permalink / raw)
  Cc: Stefan, emacs-devel

Roland Winkler <roland.winkler@physik.uni-erlangen.de> writes:

> Wouldn't it make sense to reverse the order of the following two
> statements in choose-completion-string?
>
>       (unless (run-hook-with-args-until-success
> 	       'choose-completion-string-functions
> 	       choice buffer mini-p base-size)
> 	;; Insert the completion into the buffer where it was requested.
> 	(set-buffer buffer)
>
> Then it is possible to use a local value of
> choose-completion-string-functions in completion-reference-buffer.
> I hope this does not break any other code. But right now it can
> anyway be unpredictable what happens when
> choose-completion-string-functions is used.


It makes a lot of sense.  I just installed that change.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

end of thread, other threads:[~2004-09-12 18:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-12 16:08 choose-completion-string-functions Roland Winkler
2004-09-12 18:52 ` choose-completion-string-functions Kim F. Storm

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.