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

Indentation error on consecutive defmacro calls #212

Closed
ianrumford opened this issue May 28, 2015 · 2 comments · Fixed by #214
Closed

Indentation error on consecutive defmacro calls #212

ianrumford opened this issue May 28, 2015 · 2 comments · Fixed by #214

Comments

@ianrumford
Copy link

Hi Matt,

Just started using elixir-mode and its great. Thanks you so much for your effort.

btw I'm using elixir-mode 2.2.4 with emacs 24.3.1

I'm working my way through Chris McCord metaprogramming book and this example from chapter 2:

defmodule ControlFlow do
  defmacro my_if(expr, do: if_block), do: if(expr, do: if_block, else: nil)
  defmacro my_if(expr, do: if_block, else: else_block) do
    quote do
      case unquote(expr) do
        result when result in [false, nil] -> unquote(else_block)
        _ -> unquote(if_block)
      end
    end
  end
end

ends up look like this when tabbed:

defmodule ControlFlow do
  defmacro my_if(expr, do: if_block), do: if(expr, do: if_block, else: nil)
                                          defmacro my_if(expr, do: if_block, else: else_block) do
                                            quote do
                                              case unquote(expr) do
                                                result when result in [false, nil] -> unquote(else_block)
                                                _ -> unquote(if_block)
                                              end
                                            end
                                            end
end
@mattdeboard
Copy link
Contributor

Oof. Alright, thanks for the report.

@tonini
Copy link
Contributor

tonini commented May 28, 2015

I will have a look at this one.

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

Successfully merging a pull request may close this issue.

3 participants