More on the debug behaviour of the `Insert Element' menu.
If I `debug-on-entry sgml-insert-element' and use the menu, nothing
happens, and the debugger is not invoked. If I use button3, the
debugger in invoked as expected in the process of inserting the
element. If I `debug-on-enty sgml-element-menu' then use the menu, the
debugger in invoked, and when I continue, the element is inserted
correctly. If I `debug-on-entry sgml-menu-ask' the debugger is invoked
as expected by either the menu or button3, and on continuing, the
element is inserted in both cases.
Anything else I should try?
Peter
(defun sgml-tags-menu (event)
"Pop up a menu with valid tags and insert the choosen tag.
If the variable sgml-balanced-tag-edit is t, also inserts the
corresponding end tag. If sgml-leave-point-after-insert is t, the point
is left after the inserted tag(s), unless the element has som required
content. If sgml-leave-point-after-insert is nil the point is left
after the first tag inserted."
(interactive "*e")
(let ((end (sgml-mouse-region)))
(sgml-parse-to-here)
(cond
((eq sgml-markup-type 'start-tag)
(sgml-attrib-menu event))
(t
(let ((what
(sgml-menu-ask event (if (or end sgml-balanced-tag-edit)
'element 'tags))))
(cond
((null what))
(end
(sgml-tag-region what (point) end))
(sgml-balanced-tag-edit
(sgml-insert-element what))
(t
(sgml-insert-tag what))))))))
(defun sgml-element-menu (event)
"Pop up a menu with valid elements and insert choice.
If sgml-leave-point-after-insert is nil the point is left after the
first
tag inserted."
(interactive "*e")
(let ((what (sgml-menu-ask event 'element)))
(and what (sgml-insert-element what))))
--
__ /__ Peter B. West pbwest(a)netscape.net
/
http://www.powerup.com.au/~pbwest
/ "Lord, to whom shall we go?"