From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Wellons Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Use closures in hashcash.el Date: Wed, 13 Mar 2019 11:22:44 -0400 Message-ID: <20190313152244.6bzv2dlk3inugz5z@nullprogram.com> References: <20190312031247.clqdquwuempidmt3@nullprogram.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="224060"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: NeoMutt/20170113 (1.7.2) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 13 18:07:46 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h47M1-000w8l-LI for ged-emacs-devel@m.gmane.org; Wed, 13 Mar 2019 18:07:45 +0100 Original-Received: from localhost ([127.0.0.1]:48077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h47M0-000284-F4 for ged-emacs-devel@m.gmane.org; Wed, 13 Mar 2019 13:07:44 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h45iW-0006nj-Js for emacs-devel@gnu.org; Wed, 13 Mar 2019 11:22:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h45iV-0004qA-Rt for emacs-devel@gnu.org; Wed, 13 Mar 2019 11:22:52 -0400 Original-Received: from mail.nullprogram.com ([192.241.191.137]:36040) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h45iV-0004mw-N4 for emacs-devel@gnu.org; Wed, 13 Mar 2019 11:22:51 -0400 Original-Received: from nullprogram.com (localhost [127.0.0.1]) by mail.nullprogram.com (Postfix) with ESMTPS id 92C34C5B91 for ; Wed, 13 Mar 2019 11:22:45 -0400 (EDT) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 192.241.191.137 X-Mailman-Approved-At: Wed, 13 Mar 2019 13:00:34 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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:234131 Archived-At: Michael Heerdegen has pointed out that the second backtick change isn't correct since it doesn't remember the original buffer. Here's a correction (sorry!): diff --git a/lisp/mail/hashcash.el b/lisp/mail/hashcash.el index 519c6d94e1..6ee1aee55a 100644 --- a/lisp/mail/hashcash.el +++ b/lisp/mail/hashcash.el @@ -243,8 +243,9 @@ Only start calculation. Results are inserted when ready." (hashcash-generate-payment-async (hashcash-payment-to arg) (hashcash-payment-required arg) - (lambda (process payment) - (hashcash-insert-payment-async-2 (current-buffer) process payment))))) + (let ((buffer (current-buffer))) + (lambda (process payment) + (hashcash-insert-payment-async-2 buffer process payment)))))) (defun hashcash-insert-payment-async-2 (buffer process pay) (when (buffer-live-p buffer)