|
| <prev next> |
RE: Re: 'Surround with tag' behaviour: msg#00006emacs.nxml.general
It's already in my .emacs file, assigned to ^Cr, which
is what I believe it was in PSGML. Thanks!
Bob From: emacs-nxml-mode@xxxxxxxxxxxxxxx [mailto:emacs-nxml-mode@xxxxxxxxxxxxxxx] On Behalf Of drkm Sent: Wednesday, August 03, 2005 10:12 PM To: emacs-nxml-mode@xxxxxxxxxxxxxxx Subject: [emacs-nxml-mode] Re: 'Surround with tag' behaviour > (defun surround-region-with-tag (tag-name) > (interactive "stag name: ") > (save-excursion > (goto-char (region-beginning)) > (insert (concat "<" tag-name ">"))) > (goto-char (region-end)) > (insert (concat "</" tag-name ">"))) This works even in non-interactive and takes the 'tag-name' length in account: (defun surround-region-with-tag (tag-name beg end) (interactive "sTag name: \nr") (save-excursion (goto-char beg) (insert "<" tag-name ">") (goto-char (+ end 2 (length tag-name))) (insert "</" tag-name ">"))) --drkm YAHOO! GROUPS LINKS
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: File changed during load: 00006, drkm |
|---|---|
| Next by Date: | Re: Re: File changed during load: 00006, Lennart Borgman |
| Previous by Thread: | Re: 'Surround with tag' behaviouri: 00006, drkm |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |