From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#31707: [PATCH 1/1] ido: add ido-fallback special variable Date: Sat, 09 Jun 2018 10:00:56 +0300 Message-ID: <83bmcktpef.fsf@gnu.org> References: <20180604083943.13769-1-junke.christophe@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1528527611 6065 195.159.176.226 (9 Jun 2018 07:00:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 9 Jun 2018 07:00:11 +0000 (UTC) Cc: 31707@debbugs.gnu.org To: Christophe Junke Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 09 09:00:06 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fRXr4-0001SL-ES for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jun 2018 09:00:06 +0200 Original-Received: from localhost ([::1]:39273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRXt9-00066Y-2w for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jun 2018 03:02:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRXsz-00066P-Se for bug-gnu-emacs@gnu.org; Sat, 09 Jun 2018 03:02:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRXsw-0001X0-RK for bug-gnu-emacs@gnu.org; Sat, 09 Jun 2018 03:02:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60593) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRXsw-0001Ws-NM for bug-gnu-emacs@gnu.org; Sat, 09 Jun 2018 03:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fRXsw-0008V3-C1 for bug-gnu-emacs@gnu.org; Sat, 09 Jun 2018 03:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Jun 2018 07:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31707 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 31707-submit@debbugs.gnu.org id=B31707.152852766532611 (code B ref 31707); Sat, 09 Jun 2018 07:02:02 +0000 Original-Received: (at 31707) by debbugs.gnu.org; 9 Jun 2018 07:01:05 +0000 Original-Received: from localhost ([127.0.0.1]:40257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fRXrz-0008Ts-M9 for submit@debbugs.gnu.org; Sat, 09 Jun 2018 03:01:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43063) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fRXry-0008TH-Ar for 31707@debbugs.gnu.org; Sat, 09 Jun 2018 03:01:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRXrq-00013z-6s for 31707@debbugs.gnu.org; Sat, 09 Jun 2018 03:00:57 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRXrq-00013l-2s; Sat, 09 Jun 2018 03:00:54 -0400 Original-Received: from [176.228.60.248] (port=2555 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fRXro-00006x-Nz; Sat, 09 Jun 2018 03:00:53 -0400 In-reply-to: <20180604083943.13769-1-junke.christophe@gmail.com> (message from Christophe Junke on Mon, 4 Jun 2018 10:39:43 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:147225 Archived-At: > From: Christophe Junke > Date: Mon, 4 Jun 2018 10:39:43 +0200 > Cc: Christophe Junke > > The Ido module has been compiled with "lexical-binding: t" for some > time now. Previously, when the bindings were dynamic, it was possible > for other packages to modify the "fallback" variables declared inside > "ido-file-internal" and "ido-buffer-internal". > > In particular, that was the case in magit-extras.el, which runs > magit-status on current path when exiting Ido. This feature is now > broken since "fallback" is lexical. For reference, the current code > for "ido-enter-magit-status" does the following: > > (with-no-warnings ; FIXME these are internal variables > (setq ido-exit 'fallback fallback 'magit-status)) > (exit-minibuffer) > > I think it would be cleaner to have it do: > > (ido-fallback-command 'magit-status) > > The current patch: > > - Introduces an ido-fallback special variable, which, when set, > overrides the local, lexical, "fallback" variable; it does so only > when ido-exit is set to 'fallback. > > - Adds an optional parameter to "ido-fallback-command" that is used to > specify which fallback command to run on exit. Thanks. However, if the problem was caused by using lexical-binding in ido.el, then I wonder why you need anything except one additional line: (defvar ido-fallback) This should make ido-fallback a dynamically-bound variable, and all the rest should "just work" as it did before. Right?