bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#64901: 29.1; use-package fails to require bind-key at runtime in com


From: Eli Zaretskii
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

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]