Gnus development mailing list
 help / color / mirror / Atom feed
* Reformatting multi-level quotes
@ 1999-12-18 16:53 Anders Melchiorsen
  1999-12-18 21:53 ` Hrvoje Niksic
  0 siblings, 1 reply; 12+ messages in thread
From: Anders Melchiorsen @ 1999-12-18 16:53 UTC (permalink / raw)


I have a problem formatting quotes when they are nested. Gnus (at
least with my configuration) adds "> " in front of quotes. This gives
a quote like this

> > Old stuff
> > is here
>
> Newer stuff
> is here

and when I try to reformat the "Old stuff" quote (by using M-q,
fill-paragraph-or-region) I get (notice the extra > in the middle)

> > Old stuff > is here

However, if the quote is like

>> Old stuff
>> is here

I get the proper

>> Old stuff is here


So why is Gnus by default creating quotes that cannot easily be
reformatted? I guess I can change the quote prefix string somewhere,
though. Or perhaps I should use something instead of
fill-paragraph-or-region to reformat quotes?

Whatever. I just found it odd, and wanted to report it.

-- 
Regards, Anders
(address is valid)



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

* Re: Reformatting multi-level quotes
  1999-12-18 16:53 Reformatting multi-level quotes Anders Melchiorsen
@ 1999-12-18 21:53 ` Hrvoje Niksic
  1999-12-18 22:51   ` Filladapt's "fill-paragraph" during "W w" (Was: Reformatting multi-level quotes) Lloyd Zusman
  0 siblings, 1 reply; 12+ messages in thread
From: Hrvoje Niksic @ 1999-12-18 21:53 UTC (permalink / raw)


Anders Melchiorsen <postmaster@and.nospam.kampsax.k-net.dk> writes:

> > > Old stuff
> > > is here
> >
> > Newer stuff
> > is here
> 
> and when I try to reformat the "Old stuff" quote (by using M-q,
> fill-paragraph-or-region) I get (notice the extra > in the middle)

Try filladapt-mode:

    (require 'filladapt)
    (setq-default filladapt-mode t)

Filladapt is a very powerful filling mode that replaces the standard
fill functions.  It has many variables to tweak, but it also has a
very sensible default behaviour.  More importantly, it handles the
above correctly by default.

> So why is Gnus by default creating quotes that cannot easily be
> reformatted?

Gnus simply uses the standard quoting prefix.



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

* Filladapt's "fill-paragraph" during "W w" (Was: Reformatting multi-level quotes)
  1999-12-18 21:53 ` Hrvoje Niksic
@ 1999-12-18 22:51   ` Lloyd Zusman
  1999-12-18 23:04     ` Hrvoje Niksic
  0 siblings, 1 reply; 12+ messages in thread
From: Lloyd Zusman @ 1999-12-18 22:51 UTC (permalink / raw)


Hrvoje Niksic <hniksic@iskon.hr> writes:

> Anders Melchiorsen <postmaster@and.nospam.kampsax.k-net.dk> writes:
> 
> > [ ... question about filling multi-level quotes ... ]
> 
> Try filladapt-mode:
> 
>     (require 'filladapt)
>     (setq-default filladapt-mode t)

This brings up a related question: what's the canonical method for
causing filladapt's `fill-paragraph' function to be the one to run for
each paragraph during the standard `W w' article washing procedure
(`gnus-article-fill-cited-article')?

Thanks in advance.

> [ ... ]

-- 
 Lloyd Zusman
 ljz@asfast.com



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

* Re: Filladapt's "fill-paragraph" during "W w" (Was: Reformatting multi-level quotes)
  1999-12-18 22:51   ` Filladapt's "fill-paragraph" during "W w" (Was: Reformatting multi-level quotes) Lloyd Zusman
@ 1999-12-18 23:04     ` Hrvoje Niksic
  1999-12-18 23:20       ` Lloyd Zusman
  0 siblings, 1 reply; 12+ messages in thread
From: Hrvoje Niksic @ 1999-12-18 23:04 UTC (permalink / raw)


Lloyd Zusman <ljz@asfast.com> writes:

> This brings up a related question: what's the canonical method for
> causing filladapt's `fill-paragraph' function to be the one to run
> for each paragraph during the standard `W w' article washing
> procedure (`gnus-article-fill-cited-article')?

I'm not sure you can do that at all.  AFAIK gnus-cite implements its
own algorithms for filling articles.  Ones that work quite well, so
I've never tried to replace them with filladapt.



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

* Re: Filladapt's "fill-paragraph" during "W w" (Was: Reformatting multi-level quotes)
  1999-12-18 23:04     ` Hrvoje Niksic
@ 1999-12-18 23:20       ` Lloyd Zusman
  1999-12-21  1:15         ` Must filladapt be disabled? (Was: Filladapt's "fill-paragraph" during "W w") Lloyd Zusman
  0 siblings, 1 reply; 12+ messages in thread
From: Lloyd Zusman @ 1999-12-18 23:20 UTC (permalink / raw)


Hrvoje Niksic <hniksic@iskon.hr> writes:

> Lloyd Zusman <ljz@asfast.com> writes:
> 
> > This brings up a related question: what's the canonical method for
> > causing filladapt's `fill-paragraph' function to be the one to run
> > for each paragraph during the standard `W w' article washing
> > procedure (`gnus-article-fill-cited-article')?
> 
> I'm not sure you can do that at all.  AFAIK gnus-cite implements its
> own algorithms for filling articles.  Ones that work quite well, so
> I've never tried to replace them with filladapt.

Well, I was lazy and I asked my question too soon.  I just now looked
inside of `gnus-article-fill-cited-article' within `gnus-cite.el' to
see what changes might be necessary to make it use the `filladapt'
quote filling, and I discovered that it calls `fill-region' at the
appropriate times.  Then, I looked inside of `filladapt.el', and it
turns out that one of the things it does is to replace the standard
`fill-region' with its own smarter version.

Therefore, simply by using `filladapt', the `W w' command will do the
right thing.  I did some testing to confirm this, and it indeed is the
case.

I wish all problems could be solved this easily!

-- 
 Lloyd Zusman
 ljz@asfast.com



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

* Must filladapt be disabled? (Was: Filladapt's "fill-paragraph" during "W w")
  1999-12-18 23:20       ` Lloyd Zusman
@ 1999-12-21  1:15         ` Lloyd Zusman
  1999-12-21  8:08           ` Hrvoje Niksic
  0 siblings, 1 reply; 12+ messages in thread
From: Lloyd Zusman @ 1999-12-21  1:15 UTC (permalink / raw)


I'm replying to my own message because I've been investigating the issue
I brought up, and now I have a new question ...

Lloyd Zusman <ljz@asfast.com> writes:

> Hrvoje Niksic <hniksic@iskon.hr> writes:
> 
> > Lloyd Zusman <ljz@asfast.com> writes:
> > 
> > > [ ... ] what's the canonical method for causing filladapt's
> > > `fill-paragraph' function to be the one to run for each
> > > paragraph during the standard `W w' article washing procedure
> > > (`gnus-article-fill-cited-article')?
> > 
> > I'm not sure you can do that at all.  AFAIK gnus-cite implements its
> > own algorithms for filling articles.  Ones that work quite well, so
> > I've never tried to replace them with filladapt.
> 
> [ ... at this point, I originally said that
>       `gnus-article-fill-cited-article' in `gnus-cite.el' was
>       handling this correctly when `filladapt' was loaded, but I was
>       mistaken ... ]

It turns out after all that `gnus-article-fill-cited-article' does
indeed disable `filladapt' processing.  Look at the line with the
`***HERE***' comment in this excerpt of the function:

  (defun gnus-article-fill-cited-article (&optional force width)
    "Do word wrapping in the current article.
  If WIDTH (the numerical prefix), use that text width when filling."
    (interactive (list t current-prefix-arg))
    (save-excursion
      (set-buffer gnus-article-buffer)
      (let ((buffer-read-only nil)
	    (inhibit-point-motion-hooks t)
	    (marks (gnus-dissect-cited-text))
  	    (adaptive-fill-mode nil)
	    (filladapt-mode nil)  ;; ***HERE***
	    (fill-column (if width (prefix-numeric-value width) fill-column)))
        (save-restriction
          ;;; etc. ...

By turning `filladapt-mode' off, the standard `fill-region' gets
called and not the one that would have been overridden by the
`filladapt' version.

Is there any compelling reason for `filladapt-mode' to be turned off
here?  If not, could this line just get removed (and possibly the line
above with `adaptive-fill-mode' also)?  Or if it's important to
usually turn this off, could this then be controlled by some special
variable, maybe sort of like this??? ...

  (filladapt-mode (if gnus-cite-use-filladapt filladapt-mode))

... where `gnus-cite-use-filladapt' is a variable whose default value
is `nil' but which could be optionally customized to be `t'.

This way, people like me could force `filladapt' filling during
article washing.

Any thoughts?

Thanks in advance.

-- 
 Lloyd Zusman
 ljz@asfast.com



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

* Re: Must filladapt be disabled? (Was: Filladapt's "fill-paragraph" during "W w")
  1999-12-21  1:15         ` Must filladapt be disabled? (Was: Filladapt's "fill-paragraph" during "W w") Lloyd Zusman
@ 1999-12-21  8:08           ` Hrvoje Niksic
  1999-12-21  8:17             ` Hrvoje Niksic
                               ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Hrvoje Niksic @ 1999-12-21  8:08 UTC (permalink / raw)


Lloyd Zusman <ljz@asfast.com> writes:

> Is there any compelling reason for `filladapt-mode' to be turned off
> here?  If not, could this line just get removed (and possibly the
> line above with `adaptive-fill-mode' also)?

But I'd want that line to stay.  There are things that filladapt-mode
can't handle, which the gnus-cite mode can.  For instance, this:

> : > : > > here is a very long line.  here is a very long line.  here is a...

I guess the gnus-cite-use-filladapt would work, but the ideal solution
would be to make sure the code just works with filladapt, and use it
if the user decides so.



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

* Re: Must filladapt be disabled? (Was: Filladapt's "fill-paragraph" during "W w")
  1999-12-21  8:08           ` Hrvoje Niksic
@ 1999-12-21  8:17             ` Hrvoje Niksic
  1999-12-21  9:53               ` Per Abrahamsen
  1999-12-21 16:25             ` Lloyd Zusman
  2000-04-21 17:20             ` Lars Magne Ingebrigtsen
  2 siblings, 1 reply; 12+ messages in thread
From: Hrvoje Niksic @ 1999-12-21  8:17 UTC (permalink / raw)


Hrvoje Niksic <hniksic@iskon.hr> writes:

> > : > : > > here is a very long line.  here is a very long line.  here is a...

I've just noticed that gnus-cite doesn't handle this either.  Oh well.



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

* Re: Must filladapt be disabled? (Was: Filladapt's "fill-paragraph" during "W w")
  1999-12-21  8:17             ` Hrvoje Niksic
@ 1999-12-21  9:53               ` Per Abrahamsen
  1999-12-21 14:24                 ` Lloyd Zusman
  0 siblings, 1 reply; 12+ messages in thread
From: Per Abrahamsen @ 1999-12-21  9:53 UTC (permalink / raw)


Hrvoje Niksic <hniksic@iskon.hr> writes:

> Hrvoje Niksic <hniksic@iskon.hr> writes:
> 
> > > : > : > > here is a very long line.  here is a very long line.  here is a...
> > > : > : > > here is a very long line.  here is a very long line.  here is a...
> 
> I've just noticed that gnus-cite doesn't handle this either.  Oh well.

It does if you have two of them.  The gnus-cite heuristics wants at
least two quoted lines, or a quoted line and an attribution line, in
order to recognize something as a citation prefix.  Otherwise, it gets
too many false positives.



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

* Re: Must filladapt be disabled? (Was: Filladapt's "fill-paragraph" during "W w")
  1999-12-21  9:53               ` Per Abrahamsen
@ 1999-12-21 14:24                 ` Lloyd Zusman
  0 siblings, 0 replies; 12+ messages in thread
From: Lloyd Zusman @ 1999-12-21 14:24 UTC (permalink / raw)


Per Abrahamsen <abraham@dina.kvl.dk> writes:

> Hrvoje Niksic <hniksic@iskon.hr> writes:
> 
> > Hrvoje Niksic <hniksic@iskon.hr> writes:
> > 
> > > > : > : > > here is a very long line.  here is a very long line.  here is a...
> > > > : > : > > here is a very long line.  here is a very long line.  here is a...
> > 
> > I've just noticed that gnus-cite doesn't handle this either.  Oh well.
> 
> It does if you have two of them.  The gnus-cite heuristics wants at
> least two quoted lines, or a quoted line and an attribution line, in
> order to recognize something as a citation prefix.  Otherwise, it gets
> too many false positives.

Well, my goal is for `fill-paragraph' (`M-q') and other `fill-*'
commands to work the same was as `gnus-cite-*' ... or vice versa :)

If its not desirable for `gnus-cite-*' to use filladapt during
`fill-region', how about there being a way for `fill-paragraph' and
its cousins to use the algorithms in `gnus-cite'?

I'd just like my paragraphs and citations to be filled in a consistent
manner.

-- 
 Lloyd Zusman
 ljz@asfast.com



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

* Re: Must filladapt be disabled? (Was: Filladapt's "fill-paragraph" during "W w")
  1999-12-21  8:08           ` Hrvoje Niksic
  1999-12-21  8:17             ` Hrvoje Niksic
@ 1999-12-21 16:25             ` Lloyd Zusman
  2000-04-21 17:20             ` Lars Magne Ingebrigtsen
  2 siblings, 0 replies; 12+ messages in thread
From: Lloyd Zusman @ 1999-12-21 16:25 UTC (permalink / raw)


Hrvoje Niksic <hniksic@iskon.hr> writes:

> Lloyd Zusman <ljz@asfast.com> writes:
> 
> > Is there any compelling reason for `filladapt-mode' to be turned off
> > here?  If not, could this line just get removed (and possibly the
> > line above with `adaptive-fill-mode' also)?
> 
> But I'd want that line to stay.  There are things that filladapt-mode
> can't handle, which the gnus-cite mode can.  For instance, this:
> 
> > : > : > > here is a very long line.  here is a very long line.  here is a...

I'm not positive about this, but filladapt has some rather extensive
customization capabilities, and perhaps it could be configured to
handle cases such as this.  I'll play with this later today and report
back.

> [ ... ]

-- 
 Lloyd Zusman
 ljz@asfast.com



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

* Re: Must filladapt be disabled? (Was: Filladapt's "fill-paragraph" during "W w")
  1999-12-21  8:08           ` Hrvoje Niksic
  1999-12-21  8:17             ` Hrvoje Niksic
  1999-12-21 16:25             ` Lloyd Zusman
@ 2000-04-21 17:20             ` Lars Magne Ingebrigtsen
  2 siblings, 0 replies; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 2000-04-21 17:20 UTC (permalink / raw)


Hrvoje Niksic <hniksic@iskon.hr> writes:

> But I'd want that line to stay.  There are things that filladapt-mode
> can't handle, which the gnus-cite mode can.  For instance, this:
> 
> > : > : > > here is a very long line.  here is a very long line.  here is a...
> 
> I guess the gnus-cite-use-filladapt would work, but the ideal solution
> would be to make sure the code just works with filladapt, and use it
> if the user decides so.

I think it would make sense to have a Gnus function that would
"normalize" citation.  That is, it would transform that line up there
to:

>>>>>>> here is a very long line.  here is a very long line.  here is a...

And then, when you `R' it, you would get the normalized thing to work
on, which would make things easier for filladapt and friends.

-- 
If you want an explanation on what you have just read, please
refer to <URL:http://quimby.gnus.org/gnus/zombie.html>.



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

end of thread, other threads:[~2000-04-21 17:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-18 16:53 Reformatting multi-level quotes Anders Melchiorsen
1999-12-18 21:53 ` Hrvoje Niksic
1999-12-18 22:51   ` Filladapt's "fill-paragraph" during "W w" (Was: Reformatting multi-level quotes) Lloyd Zusman
1999-12-18 23:04     ` Hrvoje Niksic
1999-12-18 23:20       ` Lloyd Zusman
1999-12-21  1:15         ` Must filladapt be disabled? (Was: Filladapt's "fill-paragraph" during "W w") Lloyd Zusman
1999-12-21  8:08           ` Hrvoje Niksic
1999-12-21  8:17             ` Hrvoje Niksic
1999-12-21  9:53               ` Per Abrahamsen
1999-12-21 14:24                 ` Lloyd Zusman
1999-12-21 16:25             ` Lloyd Zusman
2000-04-21 17:20             ` Lars Magne Ingebrigtsen

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 NNTP newsgroup(s).