HOME

lisp-init

LISP

ELisp

Automatically byte-compile the current buffer:

(defun byte-compile-current-buffer ()
  "`byte-compile' current buffer if it's emacs-lisp-mode and compiled file exists."
  (interactive)
  (when (and (eq major-mode 'emacs-lisp-mode)
             (file-exists-p (concat (file-name-sans-extension (buffer-file-name)) ".elc")))
    (byte-compile-file buffer-file-name)))

(add-hook 'emacs-lisp-mode-hook
          (lambda ()
            (add-hook 'after-save-hook 'byte-compile-current-buffer)))

Paredit

TODO Need to think about some keybindings for slurp

Something along the lines of:

(defun toby/paredit-init ()
  (progn
    (define-key paredit-mode-map (kbd "C-0") 'paredit-forward-slurp-sexp)
    (define-key paredit-mode-map (kbd "C-0") 'paredit-backward-slurp-sexp)
    ))

(eval-after-load 'paredit-mode 'toby/paredit-init)
(provide 'lisp-init)

Author: Toby Tripp

Created: 2015-02-04 Wed 10:41

Emacs 24.3.1 (Org mode 8.2.10)

Validate