all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
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: Fri, 02 Aug 2019 20:41:51 +0200	[thread overview]
Message-ID: <87r263o1e8.fsf@mouse.gnus.org> (raw)
In-Reply-To: <jwvv9vgvcxf.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 01 Aug 2019 16:44:19 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

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

Ah, yes, that seems useful.

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

In this case, I just wanted to rewrite some stuff to avoid using
widgets, which can be rather convoluted to reason about.  But it does
have callback values like this, so this brings button a feature to make
conversion easier.

But, yes, everything should be converted to lexical binding, and then
my example use case is much less of a thing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



  reply	other threads:[~2019-08-02 18:41 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
2019-08-02 18:41             ` Lars Ingebrigtsen [this message]
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=87r263o1e8.fsf@mouse.gnus.org \
    --to=larsi@gnus.org \
    --cc=contovob@tcd.ie \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.