Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (35 sloc) 1.51 KB
;;; starter-kit-lisp.el --- Some helpful Lisp code
;; Part of the Emacs Starter Kit
(add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
(add-hook 'emacs-lisp-mode-hook 'coding-hook)
(add-hook 'lisp-mode-hook 'coding-hook)
(add-hook 'emacs-lisp-mode-hook 'emacs-lisp-remove-elc-on-save)
(when (functionp 'paredit-mode)
(add-hook 'emacs-lisp-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'lisp-mode-hook (lambda () (paredit-mode +1))))
(defun emacs-lisp-remove-elc-on-save ()
"If you're saving an elisp file, likely the .elc is no longer valid."
(make-local-variable 'after-save-hook)
(add-hook 'after-save-hook
(lambda ()
(if (file-exists-p (concat buffer-file-name "c"))
(delete-file (concat buffer-file-name "c"))))))
(font-lock-add-keywords 'emacs-lisp-mode
'(("(\\|)" . 'paren-face)))
(font-lock-add-keywords 'scheme-mode
'(("(\\|)" . 'paren-face)))
(define-key lisp-mode-shared-map (kbd "C-c l") "lambda")
(define-key read-expression-map (kbd "TAB") 'lisp-complete-symbol)
(define-key lisp-mode-shared-map (kbd "RET") 'reindent-then-newline-and-indent)
(define-key lisp-mode-shared-map (kbd "C-\\") 'lisp-complete-symbol)
(define-key lisp-mode-shared-map (kbd "C-c v") 'eval-buffer)
(defface paren-face
'((((class color) (background dark))
(:foreground "grey20"))
(((class color) (background light))
(:foreground "grey55")))
"Face used to dim parentheses."
:group 'starter-kit-faces)
(provide 'starter-kit-lisp)
;; starter-kit-lisp.el ends here