From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jake Newsgroups: gmane.emacs.devel Subject: Re: Changing a cl-defstruct definition in a published package Date: Thu, 19 Jul 2018 17:34:07 -0400 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001aaa2f057160f154" X-Trace: blaine.gmane.org 1532035985 22713 195.159.176.226 (19 Jul 2018 21:33:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 19 Jul 2018 21:33:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 19 23:33:01 2018 Return-path: Envelope-to: ged-emacs-devel@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 1fgGXf-0005dI-Ut for ged-emacs-devel@m.gmane.org; Thu, 19 Jul 2018 23:33:01 +0200 Original-Received: from localhost ([::1]:45497 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgGZj-0001l8-R1 for ged-emacs-devel@m.gmane.org; Thu, 19 Jul 2018 17:35:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgGZ3-0001l3-AL for emacs-devel@gnu.org; Thu, 19 Jul 2018 17:34:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgGZ2-000788-Bl for emacs-devel@gnu.org; Thu, 19 Jul 2018 17:34:21 -0400 Original-Received: from mail-qk0-x235.google.com ([2607:f8b0:400d:c09::235]:45364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fgGZ2-00077z-54 for emacs-devel@gnu.org; Thu, 19 Jul 2018 17:34:20 -0400 Original-Received: by mail-qk0-x235.google.com with SMTP id c192-v6so5156026qkg.12 for ; Thu, 19 Jul 2018 14:34:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NXdmApBd7fG7eBNPt1xYl+CGd4LaAHoM5EHvwOHgFiM=; b=Hc+85/ArfR5qA3Th9WeaqmtmTzLVGgQe5YXDqZ2vgTPnW+qk98llNvhjSeESR9JKkA wfRPxh09HM4fFu+UQPmZ1aRkJ1sz4vvuIArRkCa9qfiEbXbaMj/BKZFSQutDDcZAPr09 l0Wed5fc6UM+VyVM5VIC1PaC9r4YTHKkfAocJJR1v4VIjq11thlE46Hf6jJnZFgsMg/A mQelfmQlaYYbax6iaoccQS14u2deh/Raig2CQzFYLOTKuWS3WP83Ff/lZW3Ek4LOs29A yeN0QSKKWUm+2y9WmR35BH0cMwcuVFugE7mqKmnojrcbEmxZ5SdC2g54DajLkei8zE1Q zwaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NXdmApBd7fG7eBNPt1xYl+CGd4LaAHoM5EHvwOHgFiM=; b=huIQf8XZeUc9JGtLMsfNQLonHA8O7ckimhApG08OFFQ+x0sDj/Hh/s6LXyEct8i7yg I6/ZRfQilZ0jJ3mBz49Esoje9n4KRnbh5IW0+UPnZN5CLxhxsjNNgI+AzSs4LXg7P9lC pYlZwq8xUf4jTuSIk1vYm/xQc35b6rYwvratXZQxpvnHLg9ltCKzJiPLGWmZHEHiwlIE c0WDphejGuTBeZSu+j67nOuXUxZVatcsDeU3XehAXfurOHXBBQ6e14zQE1SZ7wV91vT/ LYUdAnnDeIvvC1lA+YWj2csmnoCPZwuuxJabO8lA1mQwW6vuYimDu5o6HqxzAj6eqPsh bzXg== X-Gm-Message-State: AOUpUlFG+VpmK2goDHsZa9U8x1pVmFoD55l86QwQqiLr2NLU+6o4zfyc 0nj6aXrvYrx3onVerOC45VFXoJYLvTCKRX25B7s= X-Google-Smtp-Source: AAOMgpdSeuS5vE/wxPSUqrTZpK3WBgHHMMgx43Fr9u+P2orH9yybk3Wx+qUNoJXLhBz71UIaP8qFcwWqLwl13XszN/U= X-Received: by 2002:a37:1b41:: with SMTP id b62-v6mr10761666qkb.343.1532036059407; Thu, 19 Jul 2018 14:34:19 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::235 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:227565 Archived-At: --0000000000001aaa2f057160f154 Content-Type: text/plain; charset="UTF-8" Oh I see. I think that I've actually misunderstood the use-package code and that's precisely the behavior they're going for: they want to install the package immediately not when use-package is being byte-compiled, but when it is being used from any file that is being byte-compiled. So it works for them, but it's not the behavior we want here. On Thu, Jul 19, 2018 at 5:11 PM Stefan Monnier wrote: > > (message > > (eval-when-compile > > (if (bound-and-true-p byte-compile-current-file) > > "I'm being byte-compiled!" > > "I'm being evaluated :("))) > > Let's say, this is in a file foo.el. And let's say we have a file > bar.el which contains: > > (require 'foo) > ... > > Then byte-compiling bar.el (when foo.el has not been byte-compiled) > will emit a message "I'm being byte-compiled!". > > But yes, there are other ways. I think I remember using something like > > (setq my-witness t) > > (eval-when-compile > (message (if (bound-and-true-p my-witness) > "Loading this file non-compiled" > "Byte-compiling this file"))) > > (setq my-witness nil) > > in the past, > > > Stefan > > > --0000000000001aaa2f057160f154 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Oh I see. I think that I've actually misunderstood the= use-package code and that's precisely the behavior they're going f= or: they want to install the package immediately not when use-package is be= ing byte-compiled, but when it is being used from any file that is being by= te-compiled. So it works for them, but it's not the behavior we want he= re.

On Thu, Jul 19, 20= 18 at 5:11 PM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> (message
>=C2=A0 (eval-when-compile
>=C2=A0 =C2=A0 (if (bound-and-true-p byte-compile-current-file)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 "I'm being byte-compiled!" >=C2=A0 =C2=A0 =C2=A0 "I'm being evaluated :(")))

Let's say, this is in a file foo.el.=C2=A0 And let's say we have a = file
bar.el which contains:

=C2=A0 =C2=A0(require 'foo)
=C2=A0 =C2=A0...

Then byte-compiling bar.el (when foo.el has not been byte-compiled)
will emit a message "I'm being byte-compiled!".

But yes, there are other ways.=C2=A0 I think I remember using something lik= e

=C2=A0 =C2=A0 (setq my-witness t)

=C2=A0 =C2=A0 (eval-when-compile
=C2=A0 =C2=A0 =C2=A0 (message (if (bound-and-true-p my-witness)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"= Loading this file non-compiled"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"Byte-co= mpiling this file")))

=C2=A0 =C2=A0 (setq my-witness nil)

in the past,


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan


--0000000000001aaa2f057160f154--