GNU bug report logs -
#73710
30.0.91; skeleton-transformation-function sometimes unbound when sgml-xml-mode is t
Previous Next
Reported by: Mike Kupfer <kupfer <at> rawbw.com>
Date: Tue, 8 Oct 2024 18:10:02 UTC
Severity: minor
Found in version 30.0.91
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Mike Kupfer <kupfer <at> rawbw.com>
> Date: Tue, 08 Oct 2024 11:09:27 -0700
>
> sgml-mode.el has an autoload for #'skeleton-read, which will pull in
> skeleton.el and define skeleton-transformation-function. But it looks
> like there are code paths that don't trigger the autoload, so you can
> get "Symbol’s value as variable is void: skeleton-transformation-function".
>
> Reproducer:
>
> - save the attached test file to disk
>
> - emacs -Q
> - M-: (setq sgml-xml-mode t) RET
> - visit the test file
> - move point to the "t" in "<table>"
> - C-c C-a
Thanks.
Does the patch below give good results?
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index f126df8..ee58589 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -533,6 +533,7 @@ sgml-mode-facemenu-add-face-function
"Add \"face\" tags with `facemenu-keymap' commands."
(let ((tag-face (ensure-list (cdr (assq face sgml-face-tag-alist)))))
(cond (tag-face
+ (require 'skeleton)
(setq tag-face (funcall skeleton-transformation-function tag-face))
(setq facemenu-end-add-face
(mapconcat (lambda (f) (concat "</" f ">")) (reverse tag-face)))
@@ -851,6 +852,7 @@ sgml-attributes
(setq alist (cons '("class") alist)))
(unless (assoc-string "id" alist)
(setq alist (cons '("id") alist))))
+ (require 'skeleton)
(if (stringp (car alist))
(progn
(insert (if (eq (preceding-char) ?\s) "" ?\s)
This bug report was last modified 214 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.