OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: how to terminate XML tags in emacs


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

/ Martin Stemplinger <mstemplinger@gmx.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@nwalsh.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-----


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]