bug-gnu-emacs
[Top][All Lists]
Advanced

[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: Noam Postavsky
Subject: bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable
Date: Mon, 11 Jun 2018 08:19:03 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

merge 31783 31707
quit

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.





reply via email to

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