From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: "Basil L. Contovounesios" <contovob@tcd.ie>, emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master b75fb81 1/4: Extend button.el to take callback data
Date: Thu, 01 Aug 2019 16:44:19 -0400 [thread overview]
Message-ID: <jwvv9vgvcxf.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <877e7wlv98.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Thu, 01 Aug 2019 18:12:51 +0200")
> (make-text-button start (point)
> 'face 'rcirc-url
> 'follow-link t
> 'burron-data url
> 'action #'browse-url)
Odd. I thought the benefit was for
(define-button-type 'my-type 'action #'browse-url)
[...]
(make-text-button start (point)
'type 'my-type
'burron-data url)
where a closure is not an option. In your above case, you could just use
(make-text-button start (point)
'face 'rcirc-url
'follow-link t
'action (lambda () (browse-url url)))
>> Alternatively, action functions can also be closures.
> They can be, in lexical packages.
In this for the purpose of designing new APIs, we can take it for
granted that lexical-scoping is available. It's easy enough to convert
an old package to use lexical-scoping.
Stefan
next prev parent reply other threads:[~2019-08-01 20:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190730132507.32385.70681@vcs0.savannah.gnu.org>
[not found] ` <20190730132509.77D2820C0A@vcs0.savannah.gnu.org>
2019-08-01 12:11 ` [Emacs-diffs] master b75fb81 1/4: Extend button.el to take callback data Basil L. Contovounesios
2019-08-01 12:22 ` Lars Ingebrigtsen
2019-08-01 15:19 ` Basil L. Contovounesios
2019-08-01 16:12 ` Lars Ingebrigtsen
2019-08-01 20:44 ` Stefan Monnier [this message]
2019-08-02 18:41 ` Lars Ingebrigtsen
2019-08-02 0:40 ` Basil L. Contovounesios
2019-08-02 18:46 ` Lars Ingebrigtsen
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvv9vgvcxf.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=contovob@tcd.ie \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.