On Wed, Nov 29, 2023, 07:45 Joseph Turner <joseph@breatheoutbreathe.in> wrote:
:

;;;###autoload
(with-eval-after-load 'optional-dependency
  (cl-pushnew 'sns-var optional-dependency-var))

Instead, you must expand the shorthand symbol into its full form:

;;;###autoload
(with-eval-after-load 'optional-dependency
  (cl-pushnew 'some-nice-string-utils-var optional-dependency-var))

For a real-world example, see

https://git.sr.ht/~ushin/hyperdrive.el/commit/48afc51ac22713f2c54f75a7ea3b5c6b0e12b53d

Thanks for the extra case. I think this merits a fix in the autoload extractor, watch should become autoload aware. I'll try to look at it.

João