This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[docbook-apps] Re: how to terminate XML tags in emacs


-----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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]