~pkal/public-inbox

1

:bind-into should not eval-after-load

Details
Message ID
<87pluzt28q.fsf@ushin.org>
DKIM signature
pass
Download raw message
(setup foo
  (:bind-into bar-map
    "a" foo-baz))

macroexpands to

(eval-after-load 'foo
  #'(lambda nil
      (define-key bar-map "a" #'foo-baz)))

but I would expect it to macroexpand to

#'(lambda nil
    (define-key bar-map "a" #'foo-baz))

The documentation for :bind-into lacks an asterisk, indicating that it
should not be wrapped in with-eval-after-load:

 - (:bind-into FEATURE-OR-MAP &rest REST)

However, because it uses :bind internally, it ends up doing so anyway.

Thank you!!

Joseph
Details
Message ID
<878r1n9bpy.fsf@posteo.net>
In-Reply-To
<87pluzt28q.fsf@ushin.org> (view parent)
DKIM signature
pass
Download raw message
Joseph Turner <joseph@ushin.org> writes:

> (setup foo
>   (:bind-into bar-map
>     "a" foo-baz))
>
> macroexpands to
>
> (eval-after-load 'foo
>   #'(lambda nil
>       (define-key bar-map "a" #'foo-baz)))
>
> but I would expect it to macroexpand to
>
> #'(lambda nil
>     (define-key bar-map "a" #'foo-baz))

I am confused, why should it evaluate to a lambda expression?  Do you
mean

(eval-after-load 'bar
  ...)

> The documentation for :bind-into lacks an asterisk, indicating that it
> should not be wrapped in with-eval-after-load:
>
>  - (:bind-into FEATURE-OR-MAP &rest REST)
>
> However, because it uses :bind internally, it ends up doing so anyway.

Hmm, you are right, but renaming it might break backwards compatibility
for one of the dozen of users ;)

> Thank you!!
>
> Joseph

-- 
	Philip Kaludercic on peregrine
Reply to thread Export thread (mbox)