This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
[docbook-apps] Re: how to terminate XML tags in emacs
- From: Norman Walsh <ndw at nwalsh dot com>
- To: "Robert P. J. Day" <rpjday at mindspring dot com>
- Cc: docbook apps list <docbook-apps at lists dot oasis-open dot org>
- Date: Sat, 29 Mar 2003 14:13:22 -0500
- Subject: [docbook-apps] Re: how to terminate XML tags in emacs
- References: <Pine.LNX.4.44.0302231225190.28121-100000@dell><uptpgt94p.fsf@gmx.de>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
/ Martin Stemplinger <mstemplinger at gmx dot de> was heard to say:
| Norm wrote a docbook-mode that is much smaller than psgml. You can
| find it at http://nwalsh.com/emacs/docbookide/index.html. Maybe
| that's what you are looking for?
Pity I haven't been maintaining that. I'm not sure I'm even using it
regularly anymore.
|> all i want to be able to do is, with a control sequence
|> (from psgml, what was it? C-c / or just C-/), be able
|> to close the innermost element, that's all.
I use this:
(defun sgml-slash-check ()
"For psgml-mode, if you type `/' after `<', insert the appropriate
end tag, if there is an open element."
(interactive)
(if (= (char-before) 60)
;; Slash after <, let's end the current open element if we can
(let ((tag nil))
(save-excursion
(setq tag (xml-backward-element t)))
(if tag
(insert (format "/%s>" tag))
(insert "/")))
(insert "/")))
(defun setup-slash-check ()
(define-key sgml-mode-map "/" 'sgml-slash-check)
(define-key sgml-mode-map [M-left] 'xml-backward-element)
(define-key sgml-mode-map [M-right] 'xml-forward-element))
(add-hook 'sgml-mode-hook 'setup-slash-check)
Be seeing you,
norm
- --
Norman Walsh <ndw at nwalsh dot com> | Advertising is not a means of
http://www.oasis-open.org/docbook/ | supporting media. Media is an
Chair, DocBook Technical Committee | excuse for presenting
| advertising.--Rusty Foster
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.7 <http://mailcrypt.sourceforge.net/>
iD8DBQE+hfBSOyltUcwYWjsRAk5BAKCq7VN1zuM/lyBwhNcZ9+ghkBPa3QCbBdGM
YLEwlIZXcCorrJoxSiMKVdU=
=8fa3
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe at lists dot oasis-open dot org
For additional commands, e-mail: docbook-apps-help at lists dot oasis-open dot org