|
From: | Kevin Ryde |
Subject: | Re: filling long html href |
Date: | Fri, 27 Apr 2007 10:53:38 +1000 |
User-agent: | Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux) |
Stefan Monnier <address@hidden> writes: > > In theory, yes, but IIRC the resulting regexp may be of a size exponential > w.r.t the size of the literals ;-( Yes, at worst. A tree of common prefixes, if you know what I mean (like regexp-opt I suppose). > I believe in practice it's not going to be exponential, but it may still be > fairly big&ugly. Yes, about 1200 chars :(. Richard Stallman <address@hidden> writes: > > How would you write paragraph-start to do that? Proof of concept below, eval it then visit a html file. On the sample foo.html below notice the "<code>" lines were previously each an individual paragraph but now are one. The <p> bits are still individual paragraphs, as are the <foobar> bits (a deliberate unknown tag name). > I think it is very hard, perhaps impossible. Not impossible, but easier if the regex engine could get some perl style non-match lookahead (a regexp special which matches only if the following text isn't a given expression). Otherwise it'd be much easier of course to specify what is a separator rather than what's not. Just for myself I've managed with only <p> and <li>. I suppose it depends what and how much you write. Maybe a judicious (and perhaps customizable) selection among the standard tags would be enough. (Enough for the original motivation of <code> etc not being a new paragraph and hence not hindering filling.)
html-para.el
Description: application/emacs-lisp
hello world
this all
flows
together
One paragraph.
Two paragraph.
pre formworld something
[Prev in Thread] | Current Thread | [Next in Thread] |