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

Regression: incorrect indentation of multiple arity extend-type forms #344

Closed
julienfantin opened this issue Nov 5, 2015 · 11 comments
Closed

Comments

@julienfantin
Copy link

With clojure-mode 5.0.0:

(extend-type Foo
  (bar
      ([x])
    ([x y])))

Which used to be:

(extend-type Foo
  (bar
    ([x])
    ([x y])))

Emacs debug info:

In GNU Emacs 24.5.1 (x86_64-apple-darwin15.0.0, Carbon Version 157 AppKit 1404.13)
 of 2015-11-02 on mbp
Repository revision: 232183c1fbb3665a51cfb1e9dbd380127bb4a971
Windowing system distributor `Apple Inc.', version 10.11.1
Configured using:
 `configure --prefix=/usr/local/Cellar/emacs-mac/emacs-24.5-z-mac-5.13
 --enable-locallisppath=/usr/local/share/emacs/site-lisp
 --infodir=/usr/local/Cellar/emacs-mac/emacs-24.5-z-mac-5.13/share/info/emacs
 --with-mac
 --enable-mac-app=/usr/local/Cellar/emacs-mac/emacs-24.5-z-mac-5.13'

Important settings:
  locale-coding-system: utf-8-unix

Major mode: ClojureC

Minor modes in effect:
  global-git-commit-mode: t
  clj-refactor-mode: t
  cider-mode: t
  lispy-mode: t
  paredit-mode: t
  subword-mode: t
  hl-line-mode: t
  linum-mode: t
  highlight-numbers-mode: t
  diff-hl-mode: t
  diff-auto-refine-mode: t
  highlight-symbol-nav-mode: t
  highlight-symbol-mode: t
  eldoc-mode: t
  hl-todo-mode: t
  rainbow-delimiters-mode: t
  hl-sexp-mode: t
  show-paren-mode: t
  flycheck-mode: t
  ws-butler-mode: t
  aggressive-indent-mode: t
  auto-indent-mode: t
  company-statistics-mode: t
  company-flx-mode: t
  company-mode: t
  yas-minor-mode: t
  orgstruct-mode: t
  which-key-mode: t
  winner-mode: t
  helm-mode: t
  async-bytecomp-package-mode: t
  helm-fuzzier-mode: t
  helm-flx-mode: t
  helm-autoresize-mode: t
  persp-mode: t
  projectile-global-mode: t
  projectile-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  recentf-mode: t
  savehist-mode: t
  global-page-break-lines-mode: t
  lisps-mode: t
  esk-savage-indent-mode: t
  delete-selection-mode: t
  global-auto-revert-mode: t
  shell-dirtrack-mode: t
  override-global-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mac-mouse-wheel-mode: t
  prettify-symbols-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t
@Malabarba
Copy link
Member

Oh. Didn't know type methods could have multiple arities.
Will get to that.

@domkm
Copy link
Contributor

domkm commented Dec 31, 2015

@Malabarba This issue still exists for specify and specify! in ClojureScript.

@Malabarba
Copy link
Member

Could you show an example snippet? Just to make sure I get it right.

@domkm
Copy link
Contributor

domkm commented Jan 2, 2016

@Malabarba Sure.

Here is how specify is indented:

(specify obj
  ISwap
  (-swap!
      ([this f] (reset! this (f @this)))
    ([this f a] (reset! this (f @this a)))
    ([this f a b] (reset! this (f @this a b)))
    ([this f a b xs] (reset! this (apply f @this a b xs)))))

Here is how, I assume, specify should be indented:

(specify obj
  ISwap
  (-swap!
    ([this f] (reset! this (f @this)))
    ([this f a] (reset! this (f @this a)))
    ([this f a b] (reset! this (f @this a b)))
    ([this f a b xs] (reset! this (apply f @this a b xs)))))

Same goes for specify!.

@bbatsov
Copy link
Member

bbatsov commented Jan 2, 2016

Probably there should be a separate ticket for this. As specify is not part of Clojure I wonder why it's in clojure-mode to be begin with - seems we have to leave its indentation configuration to the users.

@domkm
Copy link
Contributor

domkm commented Jan 2, 2016

@bbatsov specify and specify! are part of ClojureScript.

@bbatsov
Copy link
Member

bbatsov commented Jan 2, 2016

Ah, OK.

@bbatsov
Copy link
Member

bbatsov commented Jan 2, 2016

@domkm Try setting the same indentation config for them as here - 9518de7

@domkm
Copy link
Contributor

domkm commented Jan 2, 2016

@bbatsov Nice, '(1 :defn) fixes it for me.

@bbatsov
Copy link
Member

bbatsov commented Jan 2, 2016

I'll commit the fix right now.

@domkm
Copy link
Contributor

domkm commented Jan 2, 2016

Thanks!

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