From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master b75fb81 1/4: Extend button.el to take callback data Date: Thu, 01 Aug 2019 16:44:19 -0400 Message-ID: References: <20190730132507.32385.70681@vcs0.savannah.gnu.org> <20190730132509.77D2820C0A@vcs0.savannah.gnu.org> <87lfwd2ihn.fsf@tcd.ie> <87pnlpm5x9.fsf@mouse.gnus.org> <87ef24vrpz.fsf@tcd.ie> <877e7wlv98.fsf@mouse.gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="199131"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: "Basil L. Contovounesios" , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 01 22:46:17 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1htHxm-000pdG-8r for ged-emacs-devel@m.gmane.org; Thu, 01 Aug 2019 22:46:14 +0200 Original-Received: from localhost ([::1]:59156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htHxl-0005im-Bt for ged-emacs-devel@m.gmane.org; Thu, 01 Aug 2019 16:46:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40149) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htHwK-0004dg-0Y for emacs-devel@gnu.org; Thu, 01 Aug 2019 16:44:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1htHwI-0004fC-QA for emacs-devel@gnu.org; Thu, 01 Aug 2019 16:44:43 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:50287) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1htHwI-0004TE-Gu for emacs-devel@gnu.org; Thu, 01 Aug 2019 16:44:42 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 255A985AFD; Thu, 1 Aug 2019 16:44:22 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D317A82922; Thu, 1 Aug 2019 16:44:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1564692260; bh=w3uJra1aMxiu0g4suGcPV42M9tNhGGjOMbuBBWHIDxE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=BGEth4tD33v7n6Ye07g/8iMacCTDHNod28pooramCpmUW/cRkw208b9qRWVfRBEsP ZlTSYTWFUu6WjbcvTHnIut5hQsf/joFAZTf1/9HbZEjeOZOhXY7ljTPj0Ki8lv7spq qTGuSaNQhj5es7UHMXaRWGTwRH2b3PEYbIQvyO73fzvfYClD5BhT+Sz4QWb2hEsMnI VvHRQv556k2ypRuWDNK5WZINp6l7yyNA7SIl4oFYD/dLfAEZfnEgfdM4lGppysjx5W 7v31D4T8nuL7ULL4LFGcjLOiV/DIQf0gKPEfSXL+pS/mvPVzRnzTg8fimwlwgXoZJ+ tIVGUzoGLsrAA== Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BC0AF120BA1; Thu, 1 Aug 2019 16:44:20 -0400 (EDT) In-Reply-To: <877e7wlv98.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Thu, 01 Aug 2019 18:12:51 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:239114 Archived-At: > (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