0

So, here is my init.el:


(add-to-list 'load-path "~/.emacs.d/site-lisp/use-package")
(require 'use-package)

(with-eval-after-load 'info
  (info-initialize)
  (add-to-list 'Info-directory-list
               "~/.emacs.d/site-lisp/use-package/"))

(use-package try :ensure t) works only when I go next to (add-to-list ...) and press C-x C-e and then, next to (require-package 'use-package), and pressing C-x C-e. Only if do this use-package is activated. When I close Emacs and re-open it I have to press C-x C-e again, and so on. How I can use-package remain active, so to speak; or how can it get triggered everytime I open Emacs?

3
  • 1
    Are you sure that's the whole file? – db48x Feb 4 at 9:08
  • Any reason not to use the code in the use-package readme? github.com/jwiegley/use-package#getting-started – mmmmmm Feb 4 at 12:25
  • Please provide a step-by-step recipe to reproduce the problem, starting with emacs -Q. It's not clear at all whether or why a (require 'use-package) at the top level of your init file would not try to load use-package. – Drew Feb 4 at 16:10
0

It sounds like Emacs doesn't load your init.el file at startup.

Try to rename it as ~/.emacs.

1
  • yeah, this make sense. I renamed it but it still not loading the file when I open Emacs. – aSphereInAManifold Feb 4 at 18:22
0

Like mentioned above your init.el file is probably not loaded properly.

Please keep in mind that emacs has an particular order in which it searches for the initial init files. https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html#Find-Init

~/.emacs.el > ~/.emacs > ~/.emacs.d/init.el

That also means if there is an ~/.emacs.el emacs will not search for ~/.emacs, or ~/.emacs.d/init.el anymore

If you wish your init file to be ~/.emacs.d/init.el please make sure that both of the other files don't exist.

1
  • I deleted .emacs and then reopened Emacs and it did not work. – aSphereInAManifold Feb 4 at 23:17
0

I got it to work by removing Emacs27 and installing Emacs26 and then rebooting ie reboot.

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.