When I insert a portion of JavaScript code within an HTML file, Emacs convert some basic JS symbols to their HTML code. For example when I type >
, Emacs convert it automatically to >
which this makes it impossible to code JS.
How to circumvent this issue?
EDIT:
Here is the content of my .emacs
file:
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ansi-color-faces-vector
[default default default italic underline success warning error])
'(custom-enabled-themes (quote (tango-dark)))
'(package-selected-packages (quote (js2-mode green-is-the-new-black-theme))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(package-initialize)
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(add-to-list 'package-archives '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/"))
(require 'green-is-the-new-black-theme)
(setq column-number-mode t)
(setq-default indent-tabs-mode nil)
(setq sgml-quick-keys 'indent)
;; For JavaScript
(require 'js2-mode)
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
;; Better imenu
(add-hook 'js2-mode-hook #'js2-imenu-extras-mode)
html-mode
. I suspect you're using some mode or configuration which you haven't detailed in your question. Please show how to replicate the problem, starting fromemacs -Q
.