Refactor DOOM init & add new init hooks

+ Add doom-init-hook and doom-post-init-hook to simplify Emacs init
  hooks into less ambiguous ones.
+ Attach former after-init-hook and emacs-startup-hook hooks to new doom
  init hooks.
+ Vastly improves daemon and tty support: preventing incorrect colors
  from bleeding across face class barriers, and into GUI Emacs and vice
  versa, when spawned with emacsclient.
+ Fix persp-mode breaking Emacs daemon, and ensuring that initialization
  is done properly in terminal Emacs (and emacsclient frames).
This commit is contained in:
Henrik Lissner 2017-06-12 00:20:30 +02:00
parent d3054f4679
commit 4984a548d1
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
17 changed files with 121 additions and 80 deletions

View file

@ -90,8 +90,7 @@ is enabled/disabled.'")
("^ \\*" :regexp t :size 12 :noselect t :autokill t :autoclose t)))
:config
(add-transient-hook! 'after-make-frame-functions (shackle-mode +1))
(add-hook 'window-setup-hook #'shackle-mode)
(add-hook 'doom-init-hook #'shackle-mode)
(defun doom*shackle-always-align (plist)
"Ensure popups are always aligned and selected by default. Eliminates the need
@ -540,7 +539,7 @@ you came from."
;; Ensure these settings are attached to org-load-hook as late as possible,
;; giving other modules a chance to add their own hooks.
(add-hook! 'emacs-startup-hook
(defun doom|init-org-popups ()
(add-hook! 'org-load-hook
(set! :popup
'("*Calendar*" :size 0.4 :noselect t)
@ -601,6 +600,7 @@ you came from."
(let ((map org-agenda-mode-map))
(define-key map "q" 'org-agenda-Quit)
(define-key map "Q" 'org-agenda-Quit)))))
(add-hook 'doom-init-hook #'doom|init-org-popups)
(provide 'core-popups)
;;; core-popups.el ends here