Some nxml macros from my .emacs file


I seem to remember defining some .emacs macros to make nxml mimic psgml more closely. I don't remember which ones they are, so I'm just posting these candidates from my .emacs file if anyone's interested.

(defun nxml-beginning-of-element ()
  "Jump to point after start-tag."
(global-set-key [?\C-c (home)] 'nxml-beginning-of-element)

(defun nxml-end-of-element ()
  "Jump to point before end-tag."
(global-set-key [?\C-c (end)] 'nxml-end-of-element)

(defun nxml-kill-to-eoelement ()
  "Kill to end of element."
  (let ((start (point)))
  (kill-region start (point))))

(global-set-key "k" 'nxml-kill-to-eoelement) ; that's a ^Ck

; from 2005-08-03T22:12 posting to nxml list
    (defun surround-region-with-tag (tag-name beg end)
      (interactive "sTag name: \nr")
        (goto-char beg)
        (insert "<" tag-name ">")
        (goto-char (+ end 2 (length tag-name)))
        (insert "</" tag-name ">")))

(global-set-key "r" 'surround-region-with-tag)  ; that's a ^Cr