all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Roland Winkler" <winkler@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 13609-done@debbugs.gnu.org
Subject: bug#13609: 24.2.92; completion-list-insert-choice-function
Date: Sun, 3 Feb 2013 09:46:49 -0600	[thread overview]
Message-ID: <20750.34409.832682.449021@gargle.gargle.HOWL> (raw)
In-Reply-To: <jwvsj5dmrru.fsf-monnier+emacs@gnu.org>

On Sun Feb 3 2013 Stefan Monnier wrote:
> > So I suggest to rename completion--replace to completion-replace
> > to make it clear that other code may use this function.
> 
> No, because some other package may already have changed
> completion-list-insert-choice-function, so you should really read the
> current value of completion-list-insert-choice-function, and then call
> that (via `funcall') rather than hard-coding completion--replace.

Thank you, that makes sense, it solves my problem.

Possibly, such a strategy could even be mentioned in the docstring of
completion-list-insert-choice-function.  How about adding the
following sentences?

  If you want to bind this variable to a function calling the default
  value of this variable as part of its job, do not hard-code this value
  in your code as it may change in future versions of Emacs.
  Instead, read the current value of completion-list-insert-choice-function,
  then call that via `funcall'.

Of course, this is a generic issue with any foo-function variables
that come with a default.  Merely, I do not know where to put such
a more generic remark into the elisp manual so that you find it
when you need it.

> > (Or solve this problem in some other way that other code may rely upon.)
> 
> As a matter of fact there's a new feature in trunk that does just that:
> `add-function'.

Great, though I'll keep this for future versions of BBDB.  Right now
I want to keep BBDB 3 compatible with GNU Emacs 23 and 24.
(Sometimes this is hard when you have to ignore cool new stuff...)

Roland





      reply	other threads:[~2013-02-03 15:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-02 16:24 bug#13609: 24.2.92; completion-list-insert-choice-function Roland Winkler
2013-02-03 13:51 ` Stefan Monnier
2013-02-03 15:46   ` Roland Winkler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20750.34409.832682.449021@gargle.gargle.HOWL \
    --to=winkler@gnu.org \
    --cc=13609-done@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.