unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: John Wiegley <johnw@gnu.org>
Cc: contovob@tcd.ie, 64901@debbugs.gnu.org, david@fiander.info
Subject: bug#64901: 29.1; use-package fails to require bind-key at runtime in compiled files
Date: Thu, 03 Aug 2023 11:59:43 +0300	[thread overview]
Message-ID: <83edkky000.fsf@gnu.org> (raw)
In-Reply-To: <m2fs52xx3k.fsf@newartisans.com> (message from John Wiegley on Tue, 01 Aug 2023 14:37:51 -0700)

> From: John Wiegley <johnw@gnu.org>
> Cc: contovob@tcd.ie,  64901@debbugs.gnu.org,  david@fiander.info
> Date: Tue, 01 Aug 2023 14:37:51 -0700
> 
> >>>>> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> I have no further notes to add, but I would like to see that restriction
> >> lifted also.
> 
> > Any suggestions for how should we go about that?
> 
> I would suggest that in the macro ‘bind-key’, we emit ‘(require ’bind-key)’. I
> can see now what an oversight this was, since indeed the macro will omit code
> that references a variable that may not be in scope after direct compilation:

Thanks.  Is the below what you had in mind?

diff --git a/lisp/use-package/bind-key.el b/lisp/use-package/bind-key.el
index 0ab72ea..4affd8f 100644
--- a/lisp/use-package/bind-key.el
+++ b/lisp/use-package/bind-key.el
@@ -180,6 +180,7 @@ bind-key
 Emacs can evaluate this form at any time that it does redisplay
 or operates on menu data structures, so you should write it so it
 can safely be called at any time."
+  (require 'bind-key)
   (let ((namevar (make-symbol "name"))
         (keyvar (make-symbol "key"))
         (kmapvar (make-symbol "kmap"))





  reply	other threads:[~2023-08-03  8:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27 14:51 bug#64901: 29.1; use-package fails to require bind-key at runtime in compiled files David Fiander
2023-07-27 16:52 ` Eli Zaretskii
2023-07-27 17:03   ` David Fiander
2023-07-27 17:12     ` Eli Zaretskii
2023-07-28  6:56       ` Eli Zaretskii
2023-07-28  9:28         ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-28 12:12           ` Eli Zaretskii
2023-07-28 16:55             ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-28 17:37               ` John Wiegley
2023-07-29  7:52                 ` Eli Zaretskii
2023-08-01 21:37                   ` John Wiegley
2023-08-03  8:59                     ` Eli Zaretskii [this message]
2023-08-03 22:16                       ` John Wiegley
2023-08-04  6:43                         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83edkky000.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=64901@debbugs.gnu.org \
    --cc=contovob@tcd.ie \
    --cc=david@fiander.info \
    --cc=johnw@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).