unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Christophe Junke <junke.christophe@gmail.com>
To: Noam Postavsky <npostavs@gmail.com>
Cc: 31783@debbugs.gnu.org
Subject: bug#31783: [PATCH v2] ido.el: define a special ido-fallback variable
Date: Mon, 11 Jun 2018 14:54:52 +0200	[thread overview]
Message-ID: <CAFDFyRhogifDYHGD2N+ooMdRsvrFtK-sbMopQ+eFv4Bf0cnNHQ@mail.gmail.com> (raw)
In-Reply-To: <87efhdzfbc.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1625 bytes --]

 > I believe this doesn't work, function parameters are always lexically
bound.

Indeed, there is even a warning from disassemble about the lexical argument
shadowing the dynamic one.

Thank you for noticing that.

> So I think your first patch was fine.

Fine.

To recap, the first patch also redefines "ido-fallback-command" so that it
accepts an optional parameter (the fallback command).
Is that ok for you? The idea was to let Ido be exited with a custom
fallback command through a function, and without requiring other packages
to set a variable directly.


Thank you.




On Mon, Jun 11, 2018 at 2:19 PM, Noam Postavsky <npostavs@gmail.com> wrote:

> 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.
>

[-- Attachment #2: Type: text/html, Size: 2426 bytes --]

  reply	other threads:[~2018-06-11 12:54 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 [this message]
2018-06-11 15:28       ` Eli Zaretskii
     [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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFDFyRhogifDYHGD2N+ooMdRsvrFtK-sbMopQ+eFv4Bf0cnNHQ@mail.gmail.com \
    --to=junke.christophe@gmail.com \
    --cc=31783@debbugs.gnu.org \
    --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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).