summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Andrew J. Cosgriff2017-06-12 14:36:07 +1000
committerGravatar GitHub2017-06-12 14:36:07 +1000
commita3ea62939516a24abd1e4efb6194bbcc5981502f (patch)
tree859bb67328ff04576c0385f8d23758219802bc25
parent9e25e1f696087c412a45fe004b98b9345f610767 (diff)
parent95cb9169e398b7a62916d6c15bc279f2246861a6 (diff)
downloadnginx-mode-a3ea62939516a24abd1e4efb6194bbcc5981502f.tar.gz
nginx-mode-a3ea62939516a24abd1e4efb6194bbcc5981502f.zip
Merge pull request #17 from joewreschnig/magic-fallback-mode
Add top-level Nginx configuration blocks to magic-fallback-mode-alist.
-rw-r--r--nginx-mode.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/nginx-mode.el b/nginx-mode.el
index 03ec64f..34f1e11 100644
--- a/nginx-mode.el
+++ b/nginx-mode.el
@@ -190,6 +190,11 @@ The variable nginx-indent-level controls the amount of indentation.
(add-to-list 'auto-mode-alist '("nginx\\.conf\\'" . nginx-mode))
;;;###autoload
(add-to-list 'auto-mode-alist '("/nginx/.+\\.conf\\'" . nginx-mode))
+;;;###autoload
+(add-to-list
+ 'magic-fallback-mode-alist
+ '("\\(?:.*\n\\)*\\(?:http\\|server\\|location .+\\|upstream .+\\)[ \n\t]+{"
+ . nginx-mode))
(provide 'nginx-mode)