(require 'eglot)
(do-something)
There's another..
(with-eval-after-load 'eglot
(do-something)
)
They seem to do the same, are there any difference?
(require 'eglot)
(do-something)
There's another..
(with-eval-after-load 'eglot
(do-something)
)
They seem to do the same, are there any difference?
Read their descriptions. Not at all the same.
with-eval-after-load doesn't load its first argument; require does.
Even if the require fails in your scenario, (do-something) is invoked. In the other case it's not invoked unless eglot has been successfully loaded.