1

When I type a period after an end, this is the indenting I get:

a() ->
    receive
        {abc, Val} ->
            io:format("Val: ~w~n", [Val])
                end.

On the other hand, if I type a comma after an end, the end slides to the left:

a() ->
    receive
        {abc, Val} ->
            io:format("Val: ~w~n", [Val])
    end,

I wish a period would make the end slide to the left as well.

And, in the first example if I select the whole function clause and choose Erlang > Indent > Indent Region from the menu bar, I get:

a() ->
    receive
        {abc, Val} ->
            io:format("Val: ~w~n", [Val])
    end.

Why am I unable to get that indenting automatically? In fact, I think that after I type end, the end should automatically move to the left and line up with the receive--before I type any punctuation. It shouldn't matter what punctuation follows.

7stud
  • 46,922
  • 14
  • 101
  • 127
  • I don't use Emacs anymore, but I believe the auto indentation was triggered only for characters in `electric-indent-chars`. See https://www.gnu.org/s/emacs/manual/html_node/elisp/Auto_002dIndentation.html. What is the value of `electric-indent-chars` in your emacs-mode buffer? – Dogbert May 19 '17 at 11:28
  • @Dogbert, where is my emacs-mode buffer? – 7stud May 19 '17 at 17:51
  • Oops, sorry, I meant `erlang-mode` buffer, just any buffer that has an Erlang file opened (where this issue occurs). – Dogbert May 19 '17 at 18:04
  • @Dogbert, I get no match after `electric-indent-ch`. Here is the list of possible completions: *Possible completions are: electric-indent-just-newline electric-indent-local-mode electric-indent-mode* – 7stud May 19 '17 at 18:41
  • @7stud post your question here https://emacs.stackexchange.com/ hope you get an answer. And take a look at Atom.io I'm using it for Erlang, it is good in my opinion. – Aus May 22 '17 at 08:06
  • @Aus, Thanks for the tip. I've tried Atom.io before and it's too slow--like 3 second lags for autocomplete. I moved to VS Code instead. But, I like moving around a file with key strokes, like with vim. I may have to try and get VS Code setup properly for Erlang. – 7stud May 22 '17 at 08:19

0 Answers0