GNU bug report logs - #31783
[PATCH v2] ido.el: define a special ido-fallback variable

Previous Next

Package: emacs;

Reported by: Christophe Junke <junke.christophe <at> gmail.com>

Date: Mon, 11 Jun 2018 08:27:02 UTC

Severity: normal

Tags: fixed, patch

Merged with 31707

Fixed in version 26.2

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 31783 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Christophe Junke <junke.christophe <at> gmail.com>
Cc: 31783 <at> debbugs.gnu.org
Subject: Re: bug#31783: [PATCH v2] ido.el: define a special ido-fallback
 variable
Date: Mon, 11 Jun 2018 08:19:03 -0400
merge 31783 31707
quit

Christophe Junke <junke.christophe <at> 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.




This bug report was last modified 6 years and 330 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.