1

I have the following in my .emacs.el:

(when (require 'edit-server nil t)
  (custom-set-variables
   '(edit-server-default-major-mode 'markdown-mode)
   '(edit-server-new-frame nil))
  (edit-server-start))

The file is byte compiled, so what is actually loaded is .emacs.elc.

edit-server is installed using the package system (package-list-packages).

When I start Emacs,

  • edit-server is not running
  • (featurep 'edit-server) is nil
  • the variables are not set.

When I open .emacs.el and evaluate the when form, the server is started.

When I load .emacs.elc from dired right after starting emacs, the server is started.

When I start emacs -q, no matter how many times I load .emacs.elc, the server is not started.

So, why can't I start the server this way?

  • @Drew: I edited the answers to your questions into the question itself. – sds Jul 28 '17 at 12:55
  • My .emacs.el as 1.5kloc. This is why I compile it. – sds Jul 28 '17 at 14:21
  • Yes, same problem with a separate file. – sds Jul 28 '17 at 14:37
  • thanks @Drew, I will. Thanks for pushing me to investigate further! – sds Jul 28 '17 at 15:09
1

Experiments revealed that byte-compilation was a red herring - it did not affect the behavior.

It turned out that I must have (package-initialize) before requireing any packages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.