[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable
From: |
Eli Zaretskii |
Subject: |
bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable |
Date: |
Mon, 11 Jun 2018 18:28:13 +0300 |
> 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?
- bug#31707: [PATCH 1/1] ido: add ido-fallback special variable, Christophe Junke, 2018/06/04
- bug#31707: [PATCH 1/1] ido: add ido-fallback special variable, Eli Zaretskii, 2018/06/09
- bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable, Christophe Junke, 2018/06/11
- bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable, Noam Postavsky, 2018/06/11
- bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable, Christophe Junke, 2018/06/11
- bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable,
Eli Zaretskii <=
- Message not available
- bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable, Eli Zaretskii, 2018/06/11
- bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable, Noam Postavsky, 2018/06/21
- bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable, Eli Zaretskii, 2018/06/22
- bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable, Christophe Junke, 2018/06/22
- bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable, Eli Zaretskii, 2018/06/22
- bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable, Noam Postavsky, 2018/06/22
- bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable, Eli Zaretskii, 2018/06/22
- bug#31707: [PATCH 1/1] ido: add ido-fallback special variable, Noam Postavsky, 2018/06/23
- bug#31707: [PATCH 1/1] ido: add ido-fallback special variable, Eli Zaretskii, 2018/06/24
- bug#31707: [PATCH 1/1] ido: add ido-fallback special variable, Noam Postavsky, 2018/06/25