Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Prettification is done in stich.clj

  • Loading branch information...
commit fee2deefe3b4efaceb4fb2604dbb1e31d9e21bb5 1 parent 0bc2128
@ffilozov ffilozov authored
Showing with 5 additions and 30 deletions.
  1. +5 −30 slamhound.el
View
35 slamhound.el
@@ -52,31 +52,6 @@
(catch Exception e
(println :error (.getMessage e)))))))
-(defun slamhound-point-at-end-of-sexp (start)
- (save-excursion (goto-char start) (end-of-sexp) (point)))
-
-(defun slamhound-prettify-subclause ()
- (backward-char 2)
- (let ((beginning-of-sexp (point)))
- (while (search-forward-regexp "[ \n]" (slamhound-point-at-end-of-sexp
- beginning-of-sexp) t)
- (just-one-space -1))))
-
-(defun slamhound-prettify-clause (clause)
- (just-one-space -1)
- (beginning-of-line)
- (let ((end-of-clause (save-excursion (end-of-sexp) (point))))
- (while (search-forward-regexp "[(\\[][a-z]" end-of-clause t)
- (slamhound-prettify-subclause))))
-
-(defun slamhound-prettify ()
- (interactive)
- (goto-char (point-min))
- (let ((end-of-ns (save-excursion (end-of-defun) (point))))
- (while (search-forward-regexp "(:\\([-a-z]+\\)" end-of-ns t)
- (slamhound-prettify-clause (match-string 0)))
- (indent-region (point-min) end-of-ns)))
-
;;;###autoload
(defun slamhound ()
"Run slamhound on the current buffer. Requires active slime connection."
@@ -86,11 +61,11 @@
(setq rrr result)
(if (string-match "^:error \\(.*\\)" result)
(error (match-string 1 result))
- (goto-char (point-min))
- (kill-sexp)
- ;; TODO: translate \n into newline
- (insert result)
- (slamhound-prettify))))
+ (save-excursion
+ (goto-char (point-min))
+ (kill-sexp)
+ ;; TODO: translate \n into newline
+ (insert result)))))
;; Project-wide:
Please sign in to comment.
Something went wrong with that request. Please try again.