From: Eli Zaretskii <eliz@gnu.org>
To: Mike Kupfer <kupfer@rawbw.com>
Cc: 73710@debbugs.gnu.org
Subject: bug#73710: 30.0.91; skeleton-transformation-function sometimes unbound when sgml-xml-mode is t
Date: Sun, 13 Oct 2024 15:01:13 +0300 [thread overview]
Message-ID: <86o73otdo6.fsf@gnu.org> (raw)
In-Reply-To: <20013.1728410967@alto.camomileplus.org> (message from Mike Kupfer on Tue, 08 Oct 2024 11:09:27 -0700)
> From: Mike Kupfer <kupfer@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)
next prev parent reply other threads:[~2024-10-13 12:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-08 18:09 bug#73710: 30.0.91; skeleton-transformation-function sometimes unbound when sgml-xml-mode is t Mike Kupfer
2024-10-13 12:01 ` Eli Zaretskii [this message]
2024-10-19 1:09 ` Mike Kupfer
2024-10-19 6:42 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86o73otdo6.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=73710@debbugs.gnu.org \
--cc=kupfer@rawbw.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).