Skip to content

Commit 59409f4

Browse files
committed
enable mhtml-mode by default
* lisp/files.el (auto-mode-alist): Reference mhtml-mode, not html-mode. (magic-fallback-mode-alist): Likewise. * lisp/net/eww.el (eww-view-source): Use mthml-mode.
1 parent 335174e commit 59409f4

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lisp/files.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,7 +2429,7 @@ since only a single case-insensitive search through the alist is made."
24292429
(lambda (elt)
24302430
(cons (purecopy (car elt)) (cdr elt)))
24312431
`(;; do this first, so that .html.pl is Polish html, not Perl
2432-
("\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'" . html-mode)
2432+
("\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'" . mhtml-mode)
24332433
("\\.svgz?\\'" . image-mode)
24342434
("\\.svgz?\\'" . xml-mode)
24352435
("\\.x[bp]m\\'" . image-mode)
@@ -2791,8 +2791,8 @@ If FUNCTION is nil, then it is not called. (That is a way of saying
27912791
comment-re "*"
27922792
"\\(?:!DOCTYPE[ \t\r\n]+[^>]*>[ \t\r\n]*<[ \t\r\n]*" comment-re "*\\)?"
27932793
"[Hh][Tt][Mm][Ll]"))
2794-
. html-mode)
2795-
("<!DOCTYPE[ \t\r\n]+[Hh][Tt][Mm][Ll]" . html-mode)
2794+
. mhtml-mode)
2795+
("<!DOCTYPE[ \t\r\n]+[Hh][Tt][Mm][Ll]" . mhtml-mode)
27962796
;; These two must come after html, because they are more general:
27972797
("<\\?xml " . xml-mode)
27982798
(,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")

lisp/net/eww.el

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,11 @@ Currently this means either text/html or application/xhtml+xml."
641641
(when (coding-system-p cs)
642642
(decode-coding-region (point-min) (point-max) cs)
643643
(setq buffer-file-coding-system last-coding-system-used))))
644-
(when (fboundp 'html-mode)
645-
(html-mode))))
644+
(cond
645+
((fboundp 'mhtml-mode)
646+
(mhtml-mode))
647+
((fboundp 'html-mode)
648+
(html-mode)))))
646649
(view-buffer buf)))
647650

648651
(defun eww-toggle-paragraph-direction ()

0 commit comments

Comments
 (0)