Emacs/Spacemacs: additional packages installed do not load unless dotfile synced with M-m f e R

504 views Asked by At

I'm a new Emacs/Spacemacs user, and I've gotten to understand the basics of the underpinnings.

However, I'm puzzled by a behavior:

On the dotfile, under dotspacemacs-additional-packages, I added a few extra packages, namely minimap (Sublime-like minimap), sublimity (provides smooth scrolling), and mode-icons (add nice icons to the mode description).

These packages are successfully installed, but aren't activated until I hit M-m f e R.

Even if I put them under dotspacemacs-user-config as a (require 'name_of_package), they're loaded but inactive until I hit M-m f e R.

Even if I put them under custom-set-variables as, for example, (minimap-mode 1) or (mode-icons-mode 1), they're not active until I hit M-m f e R.

Is there something I'm doing incorrectly, or would this be a bug?

1

There are 1 answers

0
dennismayr On BEST ANSWER

I was doing something incorrectly, or better said, not doing something.

If you've ever encountered this problem, you may try something like this: Moving the custom-set-variables (package_name t) right below (require 'package_name), as shown below:

(defun dotspacemacs/user-config ()
  "Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration.
This is the place where most of your configurations should be done. Unless it is
explicitly specified that a variable should be set before a package is loaded,
you should place your code here."
  (require 'sublimity)
  (sublimity-mode t)
  (require 'sublimity-scroll)
  (require 'minimap)
  (minimap-mode t)
  (mode-icons-mode t)
  (package-initialize))

This way, the additional packages were correctly loaded and activated, having only to back-up the .spacemacs file to replicate the environment elsewhere.

It's quick & dirty but it worked for me; if anybody has a cleaner method, please let me know.

With this problem solved, I've converted to Emacs, perhaps not looking back to Sublime nor Atom.