Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading the slime payload upsets clojure-mode's formatting #63

Closed
pjstadig opened this issue Feb 3, 2012 · 4 comments
Closed

Loading the slime payload upsets clojure-mode's formatting #63

pjstadig opened this issue Feb 3, 2012 · 4 comments

Comments

@pjstadig
Copy link
Contributor

pjstadig commented Feb 3, 2012

When given a form like

(deftest ^{:regression true} test-blah
  ...)

clojure-mode will format it by indenting the "..." two spaces from the margin. After M-x clojure-jack-in, clojure-mode will indent the "..." underneath the metadata map.

Repro steps using swank-clojure 1.3.4 and clojure-mode c858a:

  1. Format the test source file with clojure-mode, and notice that "..." is indented two spaces.
  2. M-x clojure-jack-in
  3. C-c C-k to compile the test namespace.
  4. Format the source file with clojure-mode and notice that the "..." is indented to line up with the metadata map.
  5. Open clojure-mode.el and C-c v.
  6. Go back to the test source file, format with clojure-mode, and notice that the "..." is indented two spaces.

After performing a bisect it appears this problem was introduced in cdfc45.

@pjstadig
Copy link
Contributor Author

pjstadig commented Feb 3, 2012

Enabling clojure-mode to respond to indentation-update messages makes it update (get 'deftest 'clojure-indent-function) from 'defun to 1, which is the source of this weird indentation behavior.

@hugoduncan
Copy link
Member

The table of special indentations in clojure-mode probably needs to get into swank-clojure somehow (or have :indent metadata set on them in clojure.core).

The hook is so you can write macros, and set ^{:indent n} so they indent properly when used.

If it needs reverting until a swank-clojure side change is made, then so be it.

@scgilardi
Copy link
Contributor

In case it helps diagnose or point to a fix, this works around the issue https://gist.github.com/182e50836b1e7cd78557 (using checkouts of clojure-mode and swank-clojure)

@technomancy
Copy link
Contributor

Sorry, we've trimmed this out of clojure-mode; it now only contains code for static operations on buffers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants