aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2016-04-29 09:16:54 +0200
committerDan Gudmundsson <[email protected]>2016-04-29 09:16:54 +0200
commitc20930a3fb9022d253302881a852f06f27091ad7 (patch)
tree5f15a5f818090af4c47e88e43a0baab7a3b0e07c /lib
parent90b6445aedd3b1f84b72caf89781c9e3482e4316 (diff)
parente3a71ace30edc91d50adf54106c0b0c274156231 (diff)
downloadotp-c20930a3fb9022d253302881a852f06f27091ad7.tar.gz
otp-c20930a3fb9022d253302881a852f06f27091ad7.tar.bz2
otp-c20930a3fb9022d253302881a852f06f27091ad7.zip
Merge remote-tracking branch 'erlang/pr/1006'
* erlang/pr/1006: Use define-derived-mode to define erlang-mode
Diffstat (limited to 'lib')
-rw-r--r--lib/tools/emacs/erlang.el15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el
index 17a156ff00..0a3fc0ddff 100644
--- a/lib/tools/emacs/erlang.el
+++ b/lib/tools/emacs/erlang.el
@@ -1345,7 +1345,7 @@ Lock syntax table. The effect is that `apply' in the atom
;;;###autoload
-(defun erlang-mode ()
+(define-derived-mode erlang-mode prog-mode "Erlang"
"Major mode for editing Erlang source files in Emacs.
It knows about syntax and comment, it can indent code, it is capable
of fontifying the source file, the TAGS commands are aware of Erlang
@@ -1404,12 +1404,9 @@ and examples of hooks.
Other commands:
\\{erlang-mode-map}"
- (interactive)
- (kill-all-local-variables)
- (setq major-mode 'erlang-mode)
- (setq mode-name "Erlang")
+ ;; Use our own syntax table function
+ :syntax-table nil
(erlang-syntax-table-init)
- (use-local-map erlang-mode-map)
(erlang-electric-init)
(erlang-menu-init)
(erlang-mode-variables)
@@ -1419,12 +1416,8 @@ Other commands:
(erlang-font-lock-init)
(erlang-skel-init)
(tempo-use-tag-list 'erlang-tempo-tags)
- (run-hooks 'erlang-mode-hook)
(if (zerop (buffer-size))
- (run-hooks 'erlang-new-file-hook))
- ;; Doesn't exist in Emacs v21.4; required by Emacs v23.
- (if (boundp 'after-change-major-mode-hook)
- (run-hooks 'after-change-major-mode-hook)))
+ (run-hooks 'erlang-new-file-hook)))
;;;###autoload
(dolist (r '("\\.erl$" "\\.app\\.src$" "\\.escript"