From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#27016: possible bug in `defsetf' Date: Thu, 13 Jul 2017 20:39:27 -0400 Message-ID: <874lufets0.fsf@users.sourceforge.net> References: <87h9075j12.fsf@users.sourceforge.net> <87injak1lj.fsf@users.sourceforge.net> <877ezp4v96.fsf@drachen> <871sppgyhb.fsf@users.sourceforge.net> <8760eyfp7s.fsf@users.sourceforge.net> <87a849djvp.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1499992754 12921 195.159.176.226 (14 Jul 2017 00:39:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 14 Jul 2017 00:39:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) Cc: Michael Heerdegen , 27016@debbugs.gnu.org, Rafael D Sorkin To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 14 02:39:10 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 1dVodP-0002zu-K3 for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Jul 2017 02:39:07 +0200 Original-Received: from localhost ([::1]:34803 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVodV-0004og-7N for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Jul 2017 20:39:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVodP-0004oa-Uf for bug-gnu-emacs@gnu.org; Thu, 13 Jul 2017 20:39:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVodK-0000UJ-R6 for bug-gnu-emacs@gnu.org; Thu, 13 Jul 2017 20:39:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34853) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVodK-0000UB-Ml for bug-gnu-emacs@gnu.org; Thu, 13 Jul 2017 20:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dVodK-0001Gh-BT for bug-gnu-emacs@gnu.org; Thu, 13 Jul 2017 20:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Jul 2017 00:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27016 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 27016-submit@debbugs.gnu.org id=B27016.14999926844810 (code B ref 27016); Fri, 14 Jul 2017 00:39:02 +0000 Original-Received: (at 27016) by debbugs.gnu.org; 14 Jul 2017 00:38:04 +0000 Original-Received: from localhost ([127.0.0.1]:37530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVocO-0001FW-5e for submit@debbugs.gnu.org; Thu, 13 Jul 2017 20:38:04 -0400 Original-Received: from mail-it0-f43.google.com ([209.85.214.43]:36005) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVocL-0001F1-HP for 27016@debbugs.gnu.org; Thu, 13 Jul 2017 20:38:02 -0400 Original-Received: by mail-it0-f43.google.com with SMTP id m68so8367373ith.1 for <27016@debbugs.gnu.org>; Thu, 13 Jul 2017 17:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=qqXXl9upG7++ctMF6xFZCRhFKHnncWmGxmB7z05XriI=; b=c1XVxwf5rOFnliMMwTasZPCncEPuFDiSnwofLVng+IiG1Th/vUyJd8z6St/0twWQBU APrngGJhUMhkOxiyzilx01G5EDyeiQGs0AJQ9SoKoU55y1ox6h0Ngq9D6tAg8tnUNdVb 4judwETKQfYHnQ2eE9iQHrjLHND5rIXZJlx7KQAu9RQ3upCrHMpa0DTJN4re8phdNzOO yiEhOSY7f2apFEUvuH+GxeDTyavzUOezGlnMfhZXnMO2r4VO8qD1WO7V7mUdOBMJqz0w qcWmBEsgsvNIvb77hyX4EDjsl8D15JRLCu8/6AmT1DXchFRKB2HdjtVTjR+FB16RVk+2 Kwdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=qqXXl9upG7++ctMF6xFZCRhFKHnncWmGxmB7z05XriI=; b=PVS/b76KPmJE72Eg/mExB8edgPynzX1eaGbwvzDYNgB2RCW+ssxUgdUJ7uL3u7dLDM y4NAr9XQsfSg3j/gYRtyif37SrnqhGfeoyPW5LLJ3XzUd2WO+TzhAKONtzFiqglenki0 1tgWvYDXTfGIJOf1jguXxs3/AEiX/crJMpJCCaNa3YGlzFJDd6JVd8DEqTNLrwLABjN4 /+MaSmWhO7msxwIfq07A9THk5+Bdq9+wuxpAUB6j7tFUyeCxVPwbrJhBhbFPgO41Q5Bz FMnQWXFmxCdbwa/82hOzksFFlvEMqo+58QTakgl4031Iq7O7w86PMKjgEft4lyluTDmy NzsA== X-Gm-Message-State: AIVw113mRbbZ1B8IBQoF8rRIEtk1HlUb7ATe6JFVaBNpC49Bvzd+SExH JGQcoSQKmaGBAA== X-Received: by 10.36.154.67 with SMTP id l64mr1434863ite.87.1499992675635; Thu, 13 Jul 2017 17:37:55 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id d72sm3898121iod.46.2017.07.13.17.37.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2017 17:37:54 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Thu, 13 Jul 2017 10:25:38 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org 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:134524 Archived-At: Stefan Monnier writes: > Looks about right. Except that it isn't. While compiling map.el, I get ../../emacs-master/lisp/emacs-lisp/map.el:292:1:Error: Symbol=E2=80=99s fun= ction definition is void: internal-make-closure I can fix this with @@ -146,7 +146,7 @@ (defmacro gv-define-expander (name handler) HANDLER is a function which takes an argument DO followed by the same arguments as NAME. DO is a function as defined in `gv-get'." (declare (indent 1) (debug (sexp form))) - `(function-put ',name 'gv-expander ,handler)) + `(function-put ',name 'gv-expander (eval-when-compile ,handler))) But that doesn't look like the right thing. > I know it's not how it's done everywhere now, but I like to put the > byte-defop-compiler-1 next to the handler function. Makes sense. >> +(defun byte-compile-function-put (form) >> + (pcase form >> + (`(,_ (,(or 'quote 'function) ,(and fun (guard (symbolp fun)))) >> + ',prop ,(or `#',value (and value (guard (functionp value))))) > > The value doesn't have to be `functionp` (it is in the case of > gv-expander, but it depends on the property). Right. I got a bit turned around with the quoting levels. And given the error above, I'm still not sure I have it worked out correctly. >> + (let ((fplist (assq fun byte-compile-plist-environment))) >> + (if fplist >> + (setcdr fplist (plist-put (cdr fplist) prop value)) >> + (push (cons fun (list prop value)) >> + byte-compile-plist-environment))))) > > I'd just unconditionally use `push`: > > (push (cons fun `(,prop ,value . ,fplist)) > byte-compile-plist-environment))))) Yeah, that is simpler.