add checks for config files and load email from .emacs

ご主人様
not manx 4 years ago
parent 229e6d1d53
commit 8111456cf9
Signed by: C-xC-c
GPG Key ID: F52ED472284EF2F4

@ -27,6 +27,9 @@
;; I read somewhere that Company breaks things?
(add-hook 'org-mode-hook 'company-mode)
;; Don't indent whole file with org-mode
(eval-after-load "org-mode" (local-set-key (kbd "s-i") nil))
(setq org-structure-template-alist
(append
'(("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC")
@ -57,7 +60,7 @@
(add-hook 'org-mode-hook (local-keybind "C-c C-l" manx/org-insert-link))
(tool-bar-mode -1)
1(tool-bar-mode -1)
(menu-bar-mode -1)
(scroll-bar-mode -1)
(line-number-mode 1)
@ -302,7 +305,7 @@ the checking happens for all pairs in auto-minor-mode-alist"
(funcall (cdar alist) 1))
(setq alist (cdr alist))))))
(add-hook 'find-file-hook #'enable-minor-mode-based-on-extension)
(add-hook 'find-file-hook#'enable-minor-mode-based-on-extension)
(define-minor-mode sensitive-minor-mode
"For sensitive files like password lists.
@ -334,5 +337,3 @@ Null prefix argument turns off the mode."
(lambda ()
(push
'("lambdainteractive" . ) prettify-symbols-alist)))
(load "~/.emacs.d/email.el")

@ -448,7 +448,3 @@ For example, used with sensitive-mode to not create backups
(push
'("lambdainteractive" . ?Λ) prettify-symbols-alist)))
#+END_SRC
* Email
#+BEGIN_SRC emacs-lisp
(load "~/.emacs.d/email.el")
#+END_SRC

@ -15,19 +15,23 @@
(package-install 'spacemacs-theme))
(defun in-emacs-home (file)
"Checks if a file exists in your emacs home"
(when (stringp file)
(let ((file (concat user-emacs-directory file)))
(when (file-exists-p file)
file))))
;; Files we care about loading
(setq custom-file (in-emacs-home "custom.el"))
(defconst emacs-config (in-emacs-home "config.el"))
(defconst emacs-org (in-emacs-home "config.org"))
;; org-babel won't compile these sometimes?
(load emacs-config)
(load custom-file 'noerrror)
(when (file-newer-than-file-p emacs-org emacs-config)
(org-babel-load-file emacs-org))
(defconst emacs-email (in-emacs-home "email.el"))
;; If everything exists then execute files
(when (mapcar (lambda (x) (not (null x)))
(list custom-file emacs-config emacs-org emacs-email))
(if (file-newer-than-file-p emacs-org emacs-config)
(org-babel-load-file emacs-org)
(load emacs-config))
(load custom-file 'noerrror)
(load emacs-email 'noerror))

Loading…
Cancel
Save