Permalink
Browse files

Move swank payloads to lein-swank plugin.

  • Loading branch information...
1 parent 1dd73d6 commit 634b76e50ed56bec0072491384c4ef0a1e99a85a @technomancy committed Feb 21, 2012
View
@@ -5,3 +5,4 @@ multi-lib/
pom.xml
.lein-failures
.lein-deps-sum
+/lein-swank/.lein-plugins/checksum
@@ -0,0 +1,4 @@
+["swank/payload/slime.el"
+ "swank/payload/slime-repl.el"
+ "swank/payload/slime-frame-colors.el"
+ "swank/payload/slime-eldoc.el"]
@@ -0,0 +1,37 @@
+;;; slime-compile-presave.el --- Refuse to save non-compiling Slime buffers
+
+;; Copyright © 2011 Phil Hagelberg
+;;
+;; Authors: Phil Hagelberg <technomancy@gmail.com>
+;; URL: http://github.com/technomancy/swank-clojure
+;; Version: 1.0.0
+;; Keywords: languages, lisp
+
+;; This file is not part of GNU Emacs.
+
+;;; Code:
+
+(defvar slime-compile-presave? nil
+ "Refuse to save slime-enabled buffers if they don't compile.")
+
+;;;###autoload
+(defun slime-compile-presave-toggle ()
+ (interactive)
+ (message "slime-compile-presave %s."
+ (if (setq slime-compile-presave? (not slime-compile-presave?))
+ "enabled" "disabled")))
+
+;;;###autoload
+(defun slime-compile-presave-enable ()
+ (make-local-variable 'before-save-hook)
+ (add-hook 'before-save-hook (defun slime-compile-presave ()
+ (when slime-compile-presave?
+ (slime-eval `(swank:eval-and-grab-output
+ ,(buffer-substring-no-properties
+ (point-min) (point-max))))))))
+
+;;;###autoload
+(add-hook 'slime-mode-hook 'slime-compile-presave-enable)
+
+(provide 'slime-compile-presave)
+;;; slime-compile-presave.el ends here
@@ -0,0 +1,12 @@
+(require 'eldoc)
+(defun clojure-slime-eldoc-message ()
+ (when (and (featurep 'slime)
+ (slime-background-activities-enabled-p))
+ (slime-echo-arglist) ; async, return nil for now
+ nil))
+
+(defun clojure-localize-documentation-function ()
+ (set (make-local-variable 'eldoc-documentation-function)
+ 'clojure-slime-eldoc-message))
+
+(add-hook 'slime-mode-hook 'clojure-localize-documentation-function)
@@ -0,0 +1,18 @@
+(require 'ansi-color)
+
+(defadvice sldb-insert-frame (around colorize-clj-trace (frame &optional face))
+ (progn
+ (ad-set-arg 0 (list (sldb-frame.number frame)
+ (ansi-color-apply (sldb-frame.string frame))
+ (sldb-frame.plist frame)))
+ ad-do-it
+ (save-excursion
+ (forward-line -1)
+ (skip-chars-forward "0-9 :")
+ (let ((beg-line (point)))
+ (end-of-line)
+ (remove-text-properties beg-line (point) '(face nil))))))
+
+(ad-activate #'sldb-insert-frame)
+
+(provide 'slime-frame-colors)
Oops, something went wrong.

0 comments on commit 634b76e

Please sign in to comment.