Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Prettification problems #9

Closed
wants to merge 2 commits into from

1 participant

@ffilozov

Emacs level prettification seems to mangle the formatting by removing spaces inside the namespace form. Seems to me like prettification is already done in Clojure code.

@ffilozov ffilozov closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 31 deletions.
  1. +1 −1  README.md
  2. +5 −30 slamhound.el
View
2  README.md
@@ -27,7 +27,7 @@ surgeon required.
Add it to your :dev-dependencies.
- [slamhound "1.1.1"]
+ [slamhound "1.2.0"]
## Leiningen Usage
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:
Something went wrong with that request. Please try again.