0

I don't know how to check if eval-after-load works or not.

I used the following code to check if FORM is loaded

(eval-after-load 'org
  (message "loaded!"))

After the above is evaluated, I tried the following

  1. reload org buffer
  2. (require 'org)
  3. (load-file "path/to/org")

None of the above display "loaded!" message.

(message "loaded!") is found in after-load-alist.

the question is

  1. how do I use eval-after-load and with-eval-after-load.
  2. How do I check if FORM is loaded.
Drew
  • 75,699
  • 9
  • 109
  • 225
  • 2
    It seems you already have `(require 'org)` before your code is evaluated. You can try to restart emacs to check if it message. – Tianshu Wang Dec 17 '22 at 09:14
  • https://emacs.stackexchange.com/tags/elisp/info – Drew Dec 17 '22 at 16:43
  • 1
    You can use `(featurep 'org)` to see if org is already loaded. If it is, then the body of `eval-after-load` is evaluated immediately. – Drew Dec 17 '22 at 16:46
  • You had several typos in your question, substituting `eval-load-after` (which doesn't exist) for `eval-after-load`. Dunno whether that represents only a typo in your question or is behind the problem you think you're seeing. I corrected the question typo. – Drew Dec 17 '22 at 16:48
  • `with-eval-after-load` is the same as `eval-after-load`, except that it doesn't evaluate the first arg. – Drew Dec 17 '22 at 16:51

0 Answers0