From c704ae0ffc5ac39eced99968ff3cff2fadd3d3bb Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 3 May 2026 17:48:07 +0200 Subject: [PATCH] Implement 'sgml-name-8bit-mode' as a proper minor mode * lisp/textmodes/sgml-mode.el (sgml-name-8bit-mode): Merge 'defcustom' and 'defun' into a 'define-minor-mode'. --- lisp/textmodes/sgml-mode.el | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 39e785e66a2..7221bc2f019 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -220,7 +220,7 @@ current line when you manually close a tag." table) "Syntax table used to parse SGML tags.") -(defcustom sgml-name-8bit-mode nil +(define-minor-mode sgml-name-8bit-mode "When non-nil, insert non-ASCII characters as named entities." :type 'boolean) @@ -783,14 +783,6 @@ Uses `sgml-char-names'." (sgml-name-char last-command-event) (self-insert-command 1))) -(defun sgml-name-8bit-mode () - "Toggle whether to insert named entities instead of non-ASCII characters. -This only works for Latin-1 input." - (interactive) - (setq sgml-name-8bit-mode (not sgml-name-8bit-mode)) - (message "sgml name entity mode is now %s" - (if sgml-name-8bit-mode "ON" "OFF"))) - ;; When an element of a skeleton is a string "str", it is passed ;; through `skeleton-transformation-function' and inserted. ;; If "str" is to be inserted literally, one should obtain it as