all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* SGML/XML: fill-paragraph between start and end tags
@ 2004-03-03 15:35 Moore, Mathew L
  2004-03-05 16:47 ` Jeffery B. Rancier
  0 siblings, 1 reply; 4+ messages in thread
From: Moore, Mathew L @ 2004-03-03 15:35 UTC (permalink / raw)


I am writing xml in sgml-mode.

Is there a convenient way to perform a fill-paragraph that operates only
between the start-tag and end-tag surrounding the current point?

If I have this:

<report>
  <title>This is a short tag</title>
  <description>
    <p>This is a long paragraph...</p>
  </description>
</report>

and do a fill-paragraph while the point is between the <p> and </p>,
then I get this,

<report>
  <title>This is a short tag</title>
  <description>
    <p>This is a long paragraph that needs to be
  filled only between the "p" tags.</p>
  </description> </report>

instead of the more preferable,

<report>
  <title>This is a short tag</title>
  <description>
    <p>This is a long paragraph that needs to be
    filled only between the "p" tags.</p>
  </description>
</report>

Thanks in advance,

--Matt Moore

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

* Re: SGML/XML: fill-paragraph between start and end tags
       [not found] <mailman.1096.1078485135.340.help-gnu-emacs@gnu.org>
@ 2004-03-05 14:28 ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2004-03-05 14:28 UTC (permalink / raw)


> I am writing xml in sgml-mode.

If you're not using it already I recommend you try out the sgml-mode.el
version in the Emacs-CVS repository, which you can browse from
http://savannah.gnu.org/projects/emacs.  It has some improvements for
XML editing.

> Is there a convenient way to perform a fill-paragraph that operates only
> between the start-tag and end-tag surrounding the current point?

Other than selecting the region and calling fill-region, no, I don't know
how to do that conveniently.

> If I have this:

> <report>
>   <title>This is a short tag</title>
>   <description>
>     <p>This is a long paragraph...</p>
>   </description>
> </report>

> and do a fill-paragraph while the point is between the <p> and </p>,
> then I get this,

> <report>
>   <title>This is a short tag</title>
>   <description>
>     <p>This is a long paragraph that needs to be
>   filled only between the "p" tags.</p>
>   </description> </report>

A lonely tag like </description> should be considered as
a paragraph separator and prevent filling.  There's obviously a bug.
Please report it with M-x report-emacs-bug.  But if you can try it with the
above-mentioned CVS code first (I believe the new sgml-mode.el still works
in Emacs-21.3) it's even better.


        Stefan

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

* Re: SGML/XML: fill-paragraph between start and end tags
  2004-03-03 15:35 Moore, Mathew L
@ 2004-03-05 16:47 ` Jeffery B. Rancier
  0 siblings, 0 replies; 4+ messages in thread
From: Jeffery B. Rancier @ 2004-03-05 16:47 UTC (permalink / raw)


"Moore, Mathew L" <MooreML@BATTELLE.ORG> writes:

> I am writing xml in sgml-mode.
>
> Is there a convenient way to perform a fill-paragraph that operates only
> between the start-tag and end-tag surrounding the current point?
>
> If I have this:
>
> <report>
>   <title>This is a short tag</title>
>   <description>
>     <p>This is a long paragraph...</p>
>   </description>
> </report>
>
> and do a fill-paragraph while the point is between the <p> and </p>,
> then I get this,
>
> <report>
>   <title>This is a short tag</title>
>   <description>
>     <p>This is a long paragraph that needs to be
>   filled only between the "p" tags.</p>
>   </description> </report>
>
> instead of the more preferable,
>
> <report>
>   <title>This is a short tag</title>
>   <description>
>     <p>This is a long paragraph that needs to be
>     filled only between the "p" tags.</p>
>   </description>
> </report>
>
> Thanks in advance,
>
> --Matt Moore

You may want to look at psgml mode:

http://sourceforge.net/projects/psgml/
-- 
Thanks,
Jeff

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

* RE: SGML/XML: fill-paragraph between start and end tags
@ 2004-03-09 14:18 Moore, Mathew L
  0 siblings, 0 replies; 4+ messages in thread
From: Moore, Mathew L @ 2004-03-09 14:18 UTC (permalink / raw)


> -----Original Message-----
> From: Stefan Monnier [mailto:monnier@iro.umontreal.ca] 
> Sent: Friday, March 05, 2004 09:29
> To: help-gnu-emacs@gnu.org
> Subject: Re: SGML/XML: fill-paragraph between start and end tags
> 
> 
> > I am writing xml in sgml-mode.
> 
> If you're not using it already I recommend you try out the 
> sgml-mode.el
> version in the Emacs-CVS repository, which you can browse from
> http://savannah.gnu.org/projects/emacs.  It has some improvements for
> XML editing.
> 



The CVS version of sgml-mode seems to solve the problem outlined below.
I'll try to keep myself a little more up-to-date.

Thanks, Stefan!

--Matt



> > If I have this:
> 
> > <report>
> >   <title>This is a short tag</title>
> >   <description>
> >     <p>This is a long paragraph...</p>
> >   </description>
> > </report>
> 
> > and do a fill-paragraph while the point is between the <p> and </p>,
> > then I get this,
> 
> > <report>
> >   <title>This is a short tag</title>
> >   <description>
> >     <p>This is a long paragraph that needs to be
> >   filled only between the "p" tags.</p>
> >   </description> </report>
> 
> A lonely tag like </description> should be considered as
> a paragraph separator and prevent filling.  There's obviously a bug.
> Please report it with M-x report-emacs-bug.  But if you can 
> try it with the
> above-mentioned CVS code first (I believe the new 
> sgml-mode.el still works
> in Emacs-21.3) it's even better.
> 
> 
>         Stefan
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
> 

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

end of thread, other threads:[~2004-03-09 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1096.1078485135.340.help-gnu-emacs@gnu.org>
2004-03-05 14:28 ` SGML/XML: fill-paragraph between start and end tags Stefan Monnier
2004-03-09 14:18 Moore, Mathew L
  -- strict thread matches above, loose matches on Subject: below --
2004-03-03 15:35 Moore, Mathew L
2004-03-05 16:47 ` Jeffery B. Rancier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.