lang/{javascript,cc}: fix empty buffer-file-name in magic-mode-alist
This commit is contained in:
parent
c1db7f56ec
commit
8e5683eaa2
2 changed files with 8 additions and 4 deletions
|
@ -107,7 +107,8 @@
|
|||
:init
|
||||
;; auto-detect JSX file
|
||||
(push (cons (lambda ()
|
||||
(and (equal (file-name-extension buffer-file-name) "js")
|
||||
(and buffer-file-name
|
||||
(equal (file-name-extension buffer-file-name) "js")
|
||||
(re-search-forward "\\(^\\s-*import React\\|\\( from \\|require(\\)[\"']react\\)"
|
||||
magic-mode-regexp-match-limit t)
|
||||
(progn
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue