Skip to content

Commit

Permalink
Nonlisp paredit fixes; clojure-project bugfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Jul 20, 2009
1 parent a46328f commit b418209
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
7 changes: 7 additions & 0 deletions starter-kit-defuns.el
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ Symbols matching the text at point are put first in the completion list."
(interactive)
(message (if (y-or-n-p "Do you have a test for that? ") "Good." "Bad!")))

(defun esk-paredit-nonlisp ()
"Turn on paredit mode for non-lisps."
(set (make-local-variable 'paredit-space-for-delimiter-predicate)
(lambda (endp delimiter)
(equal (char-syntax (char-before)) ?\")))
(paredit-mode 1))

;; A monkeypatch to cause annotate to ignore whitespace
(defun vc-git-annotate-command (file buf &optional rev)
(let ((name (file-relative-name file)))
Expand Down
15 changes: 5 additions & 10 deletions starter-kit-js.el
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,15 @@
(add-to-list 'auto-mode-alist '("\\.js$" . espresso-mode))
(add-to-list 'auto-mode-alist '("\\.json$" . espresso-mode))
(add-hook 'espresso-mode-hook 'moz-minor-mode)
(add-hook 'espresso-mode-hook 'turn-on-paredit)
(add-hook 'espresso-mode-hook 'esk-paredit-nonlisp)
(add-hook 'espresso-mode-hook 'run-coding-hook)
(add-hook 'espresso-mode-hook 'idle-highlight)
(setq espresso-indent-level 2)

(defun esk-pp-json ()
"Pretty-print the json object following point."
(interactive)
(require 'json)
(let ((json-object (save-excursion (json-read))))
(switch-to-buffer "*json*")
(delete-region (point-min) (point-max))
(insert (pp json-object))
(goto-char (point-min))))
;; espresso's insert-and-indent doesn't play nicely with pretty-lambda
(eval-after-load 'espresso
'(progn (define-key espresso-mode-map "{" 'paredit-open-brace)
(define-key espresso-mode-map "}" 'paredit-close-brace-and-newline)))

(provide 'starter-kit-js)
;;; starter-kit-js.el ends here
2 changes: 2 additions & 0 deletions starter-kit-lisp.el
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ Kills existing SLIME session, if any."
(locate-dominating-file default-directory "pom.xml"))))
(when (get-buffer "*inferior-lisp*")
(kill-buffer "*inferior-lisp*"))
(defvar swank-clojure-extra-vm-args nil)
(defvar slime-lisp-implementations nil)
(add-to-list 'swank-clojure-extra-vm-args
(format "-Dclojure.compile.path=%s"
(expand-file-name "target/classes/" path)))
Expand Down

0 comments on commit b418209

Please sign in to comment.