From: Eli Zaretskii <eliz@gnu.org>
To: Noam Postavsky <npostavs@gmail.com>
Cc: junke.christophe@gmail.com, 31783@debbugs.gnu.org
Subject: bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable
Date: Mon, 11 Jun 2018 18:28:13 +0300 [thread overview]
Message-ID: <83h8m9qr5e.fsf@gnu.org> (raw)
In-Reply-To: <87efhdzfbc.fsf@gmail.com> (message from Noam Postavsky on Mon, 11 Jun 2018 08:19:03 -0400)
> From: Noam Postavsky <npostavs@gmail.com>
> Date: Mon, 11 Jun 2018 08:19:03 -0400
> Cc: 31783@debbugs.gnu.org
>
> Christophe Junke <junke.christophe@gmail.com> writes:
>
> > I agree that it is simpler to rename the existing variable, and just
> > add a defvar declaration. Here is a different version of the patch
> > which does only this.
>
> > +;; Indicates which fallback command to call when ido-exit is 'fallback.
> > +(defvar ido-fallback nil)
>
> > -(defun ido-buffer-internal (method &optional fallback prompt default initial switch-cmd)
> > +(defun ido-buffer-internal (method &optional ido-fallback prompt default initial switch-cmd)
>
> I believe this doesn't work, function parameters are always lexically
> bound. Compare
>
> ; -*- lexical-binding: t -*-
> (setq lexical-binding t) ; for use in *scratch*
>
> (defvar x nil)
>
> (disassemble (lambda (x y)
> (+ x y)))
>
> (let ((x 1))
> (disassemble (lambda (y)
> (+ x y))))
>
> So I think your first patch was fine.
There's some misunderstanding here, most probably mine. Sorry; please
help me understand what am I missing.
The original report said that the problem was caused by using
lexical-binding in ido.el, so I proposed to defvar the offending
variable to make it dynamically bound, which is the boilerplate
solution for all such problems. I thought that was all that was
needed, and I definitely didn't suggest to rename anything.
What did I miss?
next prev parent reply other threads:[~2018-06-11 15:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-04 8:39 bug#31707: [PATCH 1/1] ido: add ido-fallback special variable Christophe Junke
2018-06-09 7:00 ` Eli Zaretskii
2018-06-11 8:23 ` bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable Christophe Junke
2018-06-11 12:19 ` Noam Postavsky
2018-06-11 12:54 ` Christophe Junke
2018-06-11 15:28 ` Eli Zaretskii [this message]
[not found] ` <CAFDFyRiHzxOB7Q6uV1hPYmuC3KfiqJRCmk=nrQ5wTPWUue_W4Q@mail.gmail.com>
2018-06-11 16:55 ` Eli Zaretskii
2018-06-22 0:34 ` Noam Postavsky
2018-06-22 6:34 ` Eli Zaretskii
2018-06-22 8:24 ` Christophe Junke
2018-06-22 9:02 ` Eli Zaretskii
2018-06-22 11:32 ` Noam Postavsky
2018-06-22 12:45 ` Eli Zaretskii
2018-06-24 1:52 ` bug#31707: [PATCH 1/1] ido: add ido-fallback special variable Noam Postavsky
2018-06-24 14:54 ` Eli Zaretskii
2018-06-26 0:40 ` Noam Postavsky
2018-06-11 18:52 ` bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable Christophe Junke
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=83h8m9qr5e.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=31783@debbugs.gnu.org \
--cc=junke.christophe@gmail.com \
--cc=npostavs@gmail.com \
/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.