0
(require 'eglot)
(do-something)

There's another..

(with-eval-after-load 'eglot
  (do-something)
)

They seem to do the same, are there any difference?

Drew
  • 75,699
  • 9
  • 109
  • 225
eugene
  • 481
  • 1
  • 5
  • 11

1 Answers1

0

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.

Drew
  • 75,699
  • 9
  • 109
  • 225