[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master b2416d2c029 4/6: Don't load comp when installing an existing
From: |
Stefan Monnier |
Subject: |
Re: master b2416d2c029 4/6: Don't load comp when installing an existing trampoline |
Date: |
Mon, 13 Nov 2023 13:46:36 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi Andrea,
> --- a/lisp/emacs-lisp/nadvice.el
> +++ b/lisp/emacs-lisp/nadvice.el
> @@ -389,7 +389,7 @@ is also interactive. There are 3 cases:
> `(advice--add-function ,how (gv-ref ,(advice--normalize-place place))
> ,function ,props))
>
> -(declare-function comp-subr-trampoline-install "comp")
> +(declare-function comp-subr-trampoline-install "comp-run")
>
> ;;;###autoload
> (defun advice--add-function (how ref function props)
> @@ -407,7 +407,7 @@ is also interactive. There are 3 cases:
> (unless (memq subr-name '(macroexpand rename-buffer))
> ;; Must require explicitly as during bootstrap we have no
> ;; autoloads.
> - (require 'comp)
> + (require 'comp-run)
> (comp-subr-trampoline-install subr-name))))
2 things:
- The `declare-function` should be moved to right after (require
'comp-run), i.e. when we do know that the function should be available
and it will thus silence only spurious warnings.
- Why do we do that in `advice--add-function`, which is used by
`advice-add` indeed but also by `add-function`, e.g. when adding
a function to a `foo-function`variable or to a process filter,
where there's no trampoline to install.
- Why do we need this at all?
Won't `Ffset` call `comp-subr-trampoline-install` for us anyway.
Stefan
- Re: master b2416d2c029 4/6: Don't load comp when installing an existing trampoline,
Stefan Monnier <=