unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Auto xml end-tag
@ 2005-09-21 10:56 Trond Hersløv
  2005-09-21 13:42 ` Lennart Borgman
  2005-09-21 14:10 ` Magnus Henoch
  0 siblings, 2 replies; 6+ messages in thread
From: Trond Hersløv @ 2005-09-21 10:56 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 1216 bytes --]

Hi!
I am myself not able to program to new things into my emacs, but I have a strong wish for a certain functionality.
Maybe there already exists a library that someone can show me how to include, of if not, maybe some of you also thinks this is a good idea, and actually make the effort to program it.

Much of my work nowdays includes writing som kind of sgml based text files: XML, HTML, JSP, config files (eg. Apache webserver) etc.
One of the biggest problems with these textfiles is the mismatch of start and end tag. For example:
<MyTag>This is the body</Mytag>
Errors like this is often in a big file hard to find, so my whish for a new functionality is this:

After I have written <MyTag> or <MyTag attr1="test" attr="hello"> I could press e.g Ctrl-t and emacs would insert </MyTag> for me.
It would very nice if it could work recursiv ofcourse, but if it only works for the last tag, it would be fine too.

Who can help me?
Freiendly regards
Trond




**********************************************************************
This email message has been swept by
MIMEsweeper for the presence of computer viruses.
**********************************************************************


[-- Attachment #1.2: Type: text/html, Size: 2421 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Auto xml end-tag
       [not found] <mailman.7833.1127300596.20277.help-gnu-emacs@gnu.org>
@ 2005-09-21 13:32 ` Tim X
  2005-09-22 15:02 ` Stefan Monnier
  1 sibling, 0 replies; 6+ messages in thread
From: Tim X @ 2005-09-21 13:32 UTC (permalink / raw)


Trond Hersløv <trond.herslov@GOTOGATE.no> writes:

> Hi!
> I am myself not able to program to new things into my emacs, but I have a
> strong wish for a certain functionality.
> Maybe there already exists a library that someone can show me how to include,
> of if not, maybe some of you also thinks this is a good idea, and actually make
> the effort to program it.
> 
> Much of my work nowdays includes writing som kind of sgml based text files:
> XML, HTML, JSP, config files (eg. Apache webserver) etc.
> 
> One of the biggest problems with these textfiles is the mismatch of start and
> end tag. For example:
> <MyTag>This is the body</Mytag>
> Errors like this is often in a big file hard to find, so my whish for a new
> functionality is this:
> 
> After I have written <MyTag> or <MyTag attr1="test" attr="hello"> I could press
> e.g Ctrl-t and emacs would insert </MyTag> for me.
> 
> It would very nice if it could work recursiv ofcourse, but if it only works for
> the last tag, it would be fine too.
> 
> Who can help me?
> Freiendly regards
> Trond
> 
> **********************************************************************
> This email message has been swept by
> MIMEsweeper for the presence of computer viruses.
> **********************************************************************

Check out both emacs psgml mode and nxml mode. I find nxml mode very
good for creating xml documents. Psgml mode is more general and
requires more configuration to get working exactly as you want, but
its a very good and powerful mode.

Check out http://www.emacswiki.org for more information.

Tim

-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Auto xml end-tag
  2005-09-21 10:56 Trond Hersløv
@ 2005-09-21 13:42 ` Lennart Borgman
  2005-09-21 14:10 ` Magnus Henoch
  1 sibling, 0 replies; 6+ messages in thread
From: Lennart Borgman @ 2005-09-21 13:42 UTC (permalink / raw)
  Cc: help-gnu-emacs

Trond Hersløv wrote:

> Hi!
> I am myself not able to program to new things into my emacs, but I 
> have a strong wish for a certain functionality.
> Maybe there already exists a library that someone can show me how to 
> include, of if not, maybe some of you also thinks this is a good idea, 
> and actually make the effort to program it.
>
> Much of my work nowdays includes writing som kind of sgml based text 
> files: XML, HTML, JSP, config files (eg. Apache webserver) etc.
>
> One of the biggest problems with these textfiles is the mismatch of 
> start and end tag. For example:
> <MyTag>This is the body</Mytag>
> Errors like this is often in a big file hard to find, so my whish for 
> a new functionality is this:
>
> After I have written <MyTag> or <MyTag attr1="test" attr="hello"> I 
> could press e.g Ctrl-t and emacs would insert </MyTag> for me.
>
> It would very nice if it could work recursiv ofcourse, but if it only 
> works for the last tag, it would be fine too.
>
Maybe you should look into nxml-mode. Look at http://www.emacswiki.org/ 
for some starting info about it.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Auto xml end-tag
  2005-09-21 10:56 Trond Hersløv
  2005-09-21 13:42 ` Lennart Borgman
@ 2005-09-21 14:10 ` Magnus Henoch
  1 sibling, 0 replies; 6+ messages in thread
From: Magnus Henoch @ 2005-09-21 14:10 UTC (permalink / raw)


Trond Hersløv <trond.herslov@GOTOGATE.no> writes:

> After I have written <MyTag> or <MyTag attr1="test" attr="hello"> I
> could press e.g Ctrl-t and emacs would insert </MyTag> for me.

In sgml-mode, C-c / does that.

Magnus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Auto xml end-tag
       [not found] <mailman.7833.1127300596.20277.help-gnu-emacs@gnu.org>
  2005-09-21 13:32 ` Auto xml end-tag Tim X
@ 2005-09-22 15:02 ` Stefan Monnier
  2005-09-22 20:35   ` Kevin Rodgers
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2005-09-22 15:02 UTC (permalink / raw)


> <MyTag>This is the body</Mytag>

The sgml-mode.el distributed with Emacs has C-c / to close the tag, tho it's
only available in the Emacs-CVS code (i.e. in the Emacs-22 release when it
comes out).
Of course, there's also psgml and nxml.  Additionally, you may be able to
just use <MyTag>This is the body</> which IIRC is perfectly valid XML.


        Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Auto xml end-tag
  2005-09-22 15:02 ` Stefan Monnier
@ 2005-09-22 20:35   ` Kevin Rodgers
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Rodgers @ 2005-09-22 20:35 UTC (permalink / raw)


Stefan Monnier wrote:
 > The sgml-mode.el distributed with Emacs has C-c / to close the tag, 
tho it's
 > only available in the Emacs-CVS code (i.e. in the Emacs-22 release 
when it
 > comes out).
 > Of course, there's also psgml and nxml.  Additionally, you may be able to
 > just use <MyTag>This is the body</> which IIRC is perfectly valid XML.

It is valid SGML only if "SHORTTAG YES" is specified in the SGML
declaration, but it is not valid XML:

http://www.w3.org/TR/2004/REC-xml-20040204/#sec-logical-struct

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-09-22 20:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.7833.1127300596.20277.help-gnu-emacs@gnu.org>
2005-09-21 13:32 ` Auto xml end-tag Tim X
2005-09-22 15:02 ` Stefan Monnier
2005-09-22 20:35   ` Kevin Rodgers
2005-09-21 10:56 Trond Hersløv
2005-09-21 13:42 ` Lennart Borgman
2005-09-21 14:10 ` Magnus Henoch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).