diff options
author | 2017-05-24 11:15:59 +0200 | |
---|---|---|
committer | 2017-05-24 11:15:59 +0200 | |
commit | 47aaf2c9a0beb0a530430b9c12ec148af6a2bd88 (patch) | |
tree | 49eac4c567f1a9ac365c94048cc212c1f29947b0 /README.md | |
parent | b58708d15a6659577945c0aa3a63983eebff2e67 (diff) | |
download | nginx-mode-47aaf2c9a0beb0a530430b9c12ec148af6a2bd88.tar.gz nginx-mode-47aaf2c9a0beb0a530430b9c12ec148af6a2bd88.zip |
Remove `run-hook`, it is run automatically.
Hi.
When using `define-derived-mode` one doesn't need (and shouldn't) use `run-hook` because the macro adds the form `run-mode-hook` itself when expanded (use macroexpand to check!).
This results in the hook being called twice, see
```elisp
(defun my-nginx-mode-init ()
(message "Hello"))
(add-hook 'nginx-mode-hook 'my-nginx-mode-init)
```
In messages I have
Hello [2 times]
Simply removing the form and using the one provided by the macro is enough to fix this.
Diffstat (limited to 'README.md')
0 files changed, 0 insertions, 0 deletions