I went over my configuration files and wanted to do some cleanup.
My understanding of with-eval-after-load
was that its body would be evaluated right after the related package is loaded. While cleaning up my configurations files and splitting them even more, I wanted to enclose every package configuration with with-eval-after-load
. Everything went as expected until I enclosed the configuration for helm
and helm-projectile
.
Here is what I had in mind (lisp/init-helm.el):
(with-eval-after-load 'helm
(setq helm-mode-line-string "")
(add-to-list 'helm-sources-using-default-as-input 'helm-source-man-pages)
(define-key global-map (kbd "C-c m") 'helm-imenu)
(define-key global-map (kbd "C-x b") 'helm-buffers-list))
(with-eval-after-load 'helm-command
(global-set-key (kbd "M-x") 'helm-M-x))
(with-eval-after-load 'helm-projectile
(helm-projectile-on))
After restarting Emacs, I get this window size issue:
This is how I resize my window:
(set-frame-parameter nil 'fullscreen 'fullboth)
I'm guessing I am misusing with-eval-after-load
, how would one sanitize his Emacs configuration and make sure nothing breaks no matter what package are installed ?
with-eval-after-load
to wrap all of my package-related customizations once. Then I saw the light and started usinguse-package
instead.(package-initialize)
and replaced it with(require 'use-package)
but I will get File error: Cannot open load file, no such file or directory, use-package when restarting Emacs. And yet, once Emacs has started I can eval(require 'use-package)
with no issue. Finally, I even triedwith-eval-after-load
, still same error. The readme isn't very clear on how to installuse-package
when using packages from package.el..emacs
, preferably a stripped-down version that demonstrates the problem with as few lines and as few external packages as possible. This probably has to do with timing of frame setup vs package load during startup. But without seeing your code, there's not much we can do. Also tell us which version of Emacs you're using.