1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Support 'strong-italic' facemenu face in html-mode

* lisp/textmodes/sgml-mode.el (sgml-face-tag-alist)
(sgml-mode-facemenu-add-face-function, html-face-tag-alist):
Support 'strong-italic' facemenu face.
This commit is contained in:
Stefan Kangas 2021-10-02 15:14:15 +02:00
parent 89d9f466dd
commit 6d0ea5e307

View file

@ -440,7 +440,8 @@ These have to be run via `sgml-syntax-propertize'"))
;; internal
(defvar sgml-face-tag-alist ()
"Alist of face and tag name for facemenu.")
"Alist of face and tag name for facemenu.
The tag name can be a string or a list of strings.")
(defvar sgml-tag-face-alist ()
"Tag names and face or list of faces to fontify with when invisible.
@ -528,11 +529,13 @@ an optional alist of possible values."
(comment-indent-new-line soft)))
(defun sgml-mode-facemenu-add-face-function (face _end)
(let ((tag-face (cdr (assq face sgml-face-tag-alist))))
"Add \"face\" tags with `facemenu-keymap' commands."
(let ((tag-face (ensure-list (cdr (assq face sgml-face-tag-alist)))))
(cond (tag-face
(setq tag-face (funcall skeleton-transformation-function tag-face))
(setq facemenu-end-add-face (concat "</" tag-face ">"))
(concat "<" tag-face ">"))
(setq facemenu-end-add-face
(mapconcat (lambda (f) (concat "</" f ">")) (reverse tag-face) ""))
(mapconcat (lambda (f) (concat "<" f ">")) tag-face ""))
((and (consp face)
(consp (car face))
(null (cdr face))
@ -1868,6 +1871,7 @@ This takes effect when first loading the library.")
(defvar html-face-tag-alist
'((bold . "strong")
(italic . "em")
(bold-italic . ("strong" "em"))
(underline . "u")
(mode-line . "rev"))
"Value of `sgml-face-tag-alist' for HTML mode.")