From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#28990: 27.0.50; thunk-delay: running expansion also requires lexical-binding Date: Fri, 27 Oct 2017 16:08:12 +0200 Message-ID: <87efpofzub.fsf@web.de> References: <87po9be3um.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1509113367 16908 195.159.176.226 (27 Oct 2017 14:09:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 27 Oct 2017 14:09:27 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Nicolas Petton , Stefan Monnier To: 28990@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 27 16:09:21 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e85Jx-0002vc-HL for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Oct 2017 16:09:13 +0200 Original-Received: from localhost ([::1]:57483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e85K4-0004Vc-U0 for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Oct 2017 10:09:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e85Jw-0004Ss-05 for bug-gnu-emacs@gnu.org; Fri, 27 Oct 2017 10:09:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e85Jm-0005RT-KU for bug-gnu-emacs@gnu.org; Fri, 27 Oct 2017 10:09:11 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57014) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e85Jm-0005RP-Fn for bug-gnu-emacs@gnu.org; Fri, 27 Oct 2017 10:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e85Jm-0001uX-Ac for bug-gnu-emacs@gnu.org; Fri, 27 Oct 2017 10:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Oct 2017 14:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28990 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28990-submit@debbugs.gnu.org id=B28990.15091133107270 (code B ref 28990); Fri, 27 Oct 2017 14:09:02 +0000 Original-Received: (at 28990) by debbugs.gnu.org; 27 Oct 2017 14:08:30 +0000 Original-Received: from localhost ([127.0.0.1]:37456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e85JG-0001t7-7x for submit@debbugs.gnu.org; Fri, 27 Oct 2017 10:08:30 -0400 Original-Received: from mout.web.de ([212.227.15.4]:61297) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e85JE-0001sr-Tz for 28990@debbugs.gnu.org; Fri, 27 Oct 2017 10:08:29 -0400 Original-Received: from drachen.dragon ([92.77.160.4]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MAvZs-1e0LXu148i-009xJr; Fri, 27 Oct 2017 16:08:14 +0200 In-Reply-To: <87po9be3um.fsf@web.de> (Michael Heerdegen's message of "Wed, 25 Oct 2017 15:47:45 +0200") X-Provags-ID: V03:K0:BQL6d046BvPH+zsRMboiGllHVjnBE415L0RIY9wvmKQ/a0pJgXR XC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X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:139077 Archived-At: --=-=-= Content-Type: text/plain Michael Heerdegen writes: > #+begin_src emacs-lisp > (defun my-thunk-test () > (thunk-force (thunk-delay (+ 1 2)))) > #+end_src > > This compiles ok, but executing (my-thunk-test) without lexbind enabled > gives you a meaningless error like "void-variable: forced". Nicolas, Stefan - ok to fix it like that? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-WIP-Fix-bug-28990.patch >From 45fe6b1bc9573257e59842283fd7da36d760c524 Mon Sep 17 00:00:00 2001 From: Michael Heerdegen Date: Thu, 26 Oct 2017 12:57:55 +0200 Subject: [PATCH] WIP: Fix bug#28990 --- lisp/emacs-lisp/thunk.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/emacs-lisp/thunk.el b/lisp/emacs-lisp/thunk.el index bb6d277c27..6dc892c44b 100644 --- a/lisp/emacs-lisp/thunk.el +++ b/lisp/emacs-lisp/thunk.el @@ -44,9 +44,12 @@ ;;; Code: +(eval-when-compile (require 'cl-macs)) + (defmacro thunk-delay (&rest body) "Delay the evaluation of BODY." (declare (debug t)) + (cl-assert lexical-binding) (let ((forced (make-symbol "forced")) (val (make-symbol "val"))) `(let (,forced ,val) -- 2.14.2 --=-=-= Content-Type: text/plain I would additionally add a sentence to "thunk.el"'s header saying that creating thunks requires lexical binding. TIA, Michael. --=-=-=--