-
-
Save xiangchu0/27fb13179ed849e6e9a2c99ca8eb55d8 to your computer and use it in GitHub Desktop.
Improvement to the Erlang Mode for Emacs: Do not jump to a new line after -> when writing specs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun erlang-after-arrow () | |
"Return true if point is immediately after a function arrow (`->'). | |
Make a special case when in a spec line." | |
(and | |
(save-excursion | |
(beginning-of-line) | |
(not (save-match-data (looking-at "-\\(spec\\|type\\)")))) | |
(and (>= (point) 2) | |
(and | |
(save-excursion | |
(backward-char) | |
(eq (char-before (point)) ?-)) | |
(or (not (listp erlang-electric-commands)) | |
(memq 'erlang-electric-gt | |
erlang-electric-commands)) | |
(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