Merge branch 'master' of home:dotfiles
1 file changed, 30 insertions(+), 1 deletion(-)
changed files
M emacs/init.el → emacs/init.el
@@ -9,6 +9,8 @@ user-mail-address "alan@alanpearce.co.uk" user-full-name "Alan Pearce" custom-file "~/.emacs.d/custom.el") +(load custom-file :noerror) + ;;; Allow lisps to use a common setup. I don't know why they don't have some lispy mode as their parent, but this is close enough (defcustom lisp-common-mode-hook nil "Hook run when entering any Lisp mode."@@ -47,7 +49,10 @@ (defun env/recheck-location () (interactive) (setq env/location (env/get-location))) -(defvar *init-file* (expand-file-name "init.el" (file-name-directory (file-truename user-init-file))) +(defvar *init-file* + (when user-init-file + (expand-file-name "init.el" + (file-name-directory (file-truename user-init-file)))) "Where the emacs init file really is, passing through symlinks.") ;;;; Package Management@@ -576,6 +581,7 @@ ;;;; Planning (use-package org + :ensure org-plus-contrib :bind (("C-c C-a" . org-agenda-list) ("C-c a" . org-agenda) ("C-c l" . org-store-link)@@ -763,6 +769,7 @@ eshell-review-quick-commands nil eshell-smart-space-goes-to-end t) (eshell-smart-initialize))))) +(autoload #'eshell/cd "em-dirs") (defun eshell-goto-current-dir (&optional arg) (interactive "P") (let ((dir default-directory))@@ -908,10 +915,16 @@ (run-hooks 'lisp-common-mode-hook) (setq indent-tabs-mode nil) (local-set-key (kbd "RET") #'paredit-newline)) +(defun set-common-lisp-indentation () + (set (make-local-variable 'lisp-indent-function) + #'common-lisp-indent-function)) + (add-hook 'emacs-lisp-mode-hook #'ap/lisp-setup) (add-hook 'emacs-lisp-mode-hook #'turn-on-eldoc-mode) (add-hook 'scheme-mode-hook #'ap/lisp-setup) +(add-hook 'lisp-mode-hook #'ap/lisp-setup) +(add-hook 'lisp-mode-hook #'set-common-lisp-indentation) (use-package bytecomp :defer t@@ -973,6 +986,18 @@ (if p (init-narrow-to-section))) (add-hook 'emacs-lisp-mode-hook 'imenu-elisp-sections) +(defun eval-and-replace () + "Replace the preceding sexp with its value." + (interactive) + (backward-kill-sexp) + (condition-case nil + (prin1 (eval (read (current-kill 0))) + (current-buffer)) + (error (message "Invalid expression") + (insert (current-kill 0))))) + +(bind-key "C-c e" #'eval-and-replace) + ;;;; Programming (use-package auto-compile@@ -1084,6 +1109,10 @@ :ensure t :mode (("\\.mustache" . mustache-mode) ("\\.mt\\'" . mustache-mode) ("\\.template\\'" . mustache-mode))) + +(use-package jinja2-mode + :ensure t + :mode (("\\.j2\\'" . jinja2-mode))) (use-package nxhtml-mode :defer t