Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 76 lines (59 sloc) 2.495 kB
5fcb34d @technomancy initial commit
authored
1 ;;; starter-kit-lisp.el --- Some helpful Lisp code
2 ;;
3 ;; Part of the Emacs Starter Kit
4
6d9c1ec @technomancy Totally redo starter-kit-lisp, mostly to improve clojure support.
authored
5 (define-key read-expression-map (kbd "TAB") 'lisp-complete-symbol)
6 (define-key lisp-mode-shared-map (kbd "C-c l") "lambda")
7 (define-key lisp-mode-shared-map (kbd "RET") 'reindent-then-newline-and-indent)
8 (define-key lisp-mode-shared-map (kbd "C-\\") 'lisp-complete-symbol)
9 (define-key lisp-mode-shared-map (kbd "C-c v") 'eval-buffer)
10
92ab867 @technomancy Accidentally committed this; wups.
authored
11 (defface esk-paren-face
6d9c1ec @technomancy Totally redo starter-kit-lisp, mostly to improve clojure support.
authored
12 '((((class color) (background dark))
24e7d08 @technomancy Included the "installer" branch of clojure-mode.
authored
13 (:foreground "grey50"))
6d9c1ec @technomancy Totally redo starter-kit-lisp, mostly to improve clojure support.
authored
14 (((class color) (background light))
15 (:foreground "grey55")))
16 "Face used to dim parentheses."
17 :group 'starter-kit-faces)
18
19 ;;; Emacs Lisp
20
b2ffdf1 @technomancy Make coding-hook a real hook instead of a defun.
authored
21 (add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
354349c @technomancy Paren-face for clojure-mode.
authored
22 (add-hook 'emacs-lisp-mode-hook 'esk-remove-elc-on-save)
12ac2f0 @technomancy Rearrange lisp and ruby helpers.
authored
23
354349c @technomancy Paren-face for clojure-mode.
authored
24 (defun esk-remove-elc-on-save ()
12ac2f0 @technomancy Rearrange lisp and ruby helpers.
authored
25 "If you're saving an elisp file, likely the .elc is no longer valid."
26 (make-local-variable 'after-save-hook)
27 (add-hook 'after-save-hook
28 (lambda ()
29 (if (file-exists-p (concat buffer-file-name "c"))
30 (delete-file (concat buffer-file-name "c"))))))
5fcb34d @technomancy initial commit
authored
31
bc907d2 @technomancy Add org bindings; fix clojure-project root heuristic.
authored
32 (define-key emacs-lisp-mode-map (kbd "M-.") 'find-function-at-point)
33
6d9c1ec @technomancy Totally redo starter-kit-lisp, mostly to improve clojure support.
authored
34 ;;; Clojure
35
dfa93d1 @technomancy Slime debugger fixes to make it nicer to work with Clojure.
authored
36 (eval-after-load 'find-file-in-project
37 '(add-to-list 'ffip-patterns "*.clj"))
38
94be2ae @technomancy Deprecate M-x clojure-project.
authored
39 (defun clojure-project ()
40 (interactive)
41 (message "Deprecated in favour of M-x swank-clojure-project. Install swank-clojure from ELPA."))
43c3437 @technomancy Add M-x clojure-project for launching SLIME with Clojure.
authored
42
5f0a888 @dysinger Refactored out repeated mode hook lines into a lambda that applies to…
dysinger authored
43 ;;; Enhance Lisp Modes
44
94be2ae @technomancy Deprecate M-x clojure-project.
authored
45 (eval-after-load 'paredit
46 ;; need a binding that works in the terminal
c04795f @technomancy Yeah, eval-after-load is freaking stupid.
authored
47 '(define-key paredit-mode-map (kbd "M-)") 'paredit-forward-slurp-sexp))
5f0a888 @dysinger Refactored out repeated mode hook lines into a lambda that applies to…
dysinger authored
48
92bf56f @technomancy Let paredit be handled by autoload and don't set hooks for inf-lisp.
authored
49 (dolist (x '(scheme emacs-lisp lisp clojure))
94be2ae @technomancy Deprecate M-x clojure-project.
authored
50 (when window-system
51 (font-lock-add-keywords
52 (intern (concat (symbol-name x) "-mode"))
53 '(("(\\|)" . 'esk-paren-face))))
5f0a888 @dysinger Refactored out repeated mode hook lines into a lambda that applies to…
dysinger authored
54 (add-hook
1a6e4d1 @technomancy Move idle-highlight activation to coding-hook.
authored
55 (intern (concat (symbol-name x) "-mode-hook")) 'turn-on-paredit)
56 (add-hook
57 (intern (concat (symbol-name x) "-mode-hook")) 'run-coding-hook))
5fcb34d @technomancy initial commit
authored
58
fbbb9e3 @technomancy Render clojure's fn as ƒ.
authored
59 (eval-after-load 'clojure-mode
60 '(font-lock-add-keywords
fd24e10 @technomancy Make clojure's pretty-fns more discerning.
authored
61 'clojure-mode `(("(\\(fn\\>\\)"
fbbb9e3 @technomancy Render clojure's fn as ƒ.
authored
62 (0 (progn (compose-region (match-beginning 1)
63 (match-end 1) "ƒ")
64 nil))))))
65
aac3644 @technomancy Bindings for slime pretty-print.
authored
66 (eval-after-load 'slime
67 '(define-key slime-mode-map (kbd "C-c p")
68 'slime-pprint-eval-last-expression))
69
70 (eval-after-load 'slime-repl
71 '(define-key slime-repl-mode-map (kbd "C-c p")
72 'slime-pprint-eval-last-expression))
73
12ac2f0 @technomancy Rearrange lisp and ruby helpers.
authored
74 (provide 'starter-kit-lisp)
1c8f12e @technomancy Add tty-friendly paredit slurp binding.
authored
75 ;; starter-kit-lisp.el ends here
Something went wrong with that request. Please try again.