Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Improvement to the Erlang Mode for Emacs: Do not jump to a new line after -> when writing specs.
(defun erlang-after-arrow ()
"Return true if point is immediately after a function arrow (`->').
Make a special case when in a spec line."
(not (save-match-data (looking-at "-\\(spec\\|type\\)"))))
(and (>= (point) 2)
(eq (char-before (point)) ?-))
(or (not (listp erlang-electric-commands))
(memq 'erlang-electric-gt
(not (erlang-in-literal))
(looking-at "\\s *\\(%.*\\)?$")
(erlang-test-criteria-list erlang-electric-arrow-criteria)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment