Gnus development mailing list
 help / color / mirror / Atom feed
* Truncating lines in the article buffer
@ 2010-10-07 21:17 Lars Magne Ingebrigtsen
  2010-10-13 21:56 ` Kevin Ryde
  0 siblings, 1 reply; 17+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-07 21:17 UTC (permalink / raw)
  To: ding; +Cc: emacs-devel

Line wrapping in the article buffer is necessary (because people post
using long lines).  But there's one instance when it would make sense to
have `truncate-lines' set to t: When displaying HTML tables.  They
become totally incomprehensible when using line wrapping.  It would make
more sense for them to have `truncate-lines'-like behaviour, and just
let the user scroll to the right to see the rest of the table.

Is there any way to say "I want these lines to behave as if
`truncate-lines' is t, but not anything else"?  I've looked at the text
property section in the manual, but couldn't find anything obvious...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Truncating lines in the article buffer
  2010-10-07 21:17 Truncating lines in the article buffer Lars Magne Ingebrigtsen
@ 2010-10-13 21:56 ` Kevin Ryde
  2010-10-13 22:01   ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 17+ messages in thread
From: Kevin Ryde @ 2010-10-13 21:56 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>
> `truncate-lines' set to t: When displaying HTML tables.  They
> become totally incomprehensible when using line wrapping.

I get annoyed by w3m drawing tables off the right edge of the screen.
I know the widths in the html might end up asking for that, or even
demanding it, but it's hard to read hscrolling across and back all the
time.  If columns are flowed text you'd much prefer to fit them in the
screen (as long as it left a tolerably sensible amount for each).



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

* Re: Truncating lines in the article buffer
  2010-10-13 21:56 ` Kevin Ryde
@ 2010-10-13 22:01   ` Lars Magne Ingebrigtsen
  2010-10-14 15:09     ` Ted Zlatanov
  0 siblings, 1 reply; 17+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-13 22:01 UTC (permalink / raw)
  To: ding

Kevin Ryde <user42@zip.com.au> writes:

>> `truncate-lines' set to t: When displaying HTML tables.  They
>> become totally incomprehensible when using line wrapping.
>
> I get annoyed by w3m drawing tables off the right edge of the screen.

Oh, so it's possible to get line truncation for some lines?

> I know the widths in the html might end up asking for that, or even
> demanding it, but it's hard to read hscrolling across and back all the
> time.  If columns are flowed text you'd much prefer to fit them in the
> screen (as long as it left a tolerably sensible amount for each).

Of course.  But that's often not possible with deeply nested tables.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Truncating lines in the article buffer
  2010-10-13 22:01   ` Lars Magne Ingebrigtsen
@ 2010-10-14 15:09     ` Ted Zlatanov
  2010-10-14 16:24       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 17+ messages in thread
From: Ted Zlatanov @ 2010-10-14 15:09 UTC (permalink / raw)
  To: ding

On Thu, 14 Oct 2010 00:01:13 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

>> I know the widths in the html might end up asking for that, or even
>> demanding it, but it's hard to read hscrolling across and back all the
>> time.  If columns are flowed text you'd much prefer to fit them in the
>> screen (as long as it left a tolerably sensible amount for each).

LMI> Of course.  But that's often not possible with deeply nested tables.

I hate to even say this, but...

Consider using SVG to render the tables.  It's scalable (including the
fonts) so the image will look good at any resolution (if the pixel count
allows it).  It's really easy to insert PNG and JPEG images too.  See
this for some good examples:

http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html

That won't allow links inside the SVG image, though, because the
interface with librsvg is one-way (web browsers can do more).  So maybe
use SVG for each table cell without links if links are a requirement.

I personally would be happy with cell contents that cut off whatever did
not fit (with ... to indicate it).

Ted




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

* Re: Truncating lines in the article buffer
  2010-10-14 15:09     ` Ted Zlatanov
@ 2010-10-14 16:24       ` Lars Magne Ingebrigtsen
  2010-10-14 17:00         ` Ted Zlatanov
  0 siblings, 1 reply; 17+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-14 16:24 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> Consider using SVG to render the tables.  It's scalable (including the
> fonts) so the image will look good at any resolution (if the pixel count
> allows it).  It's really easy to insert PNG and JPEG images too.  See
> this for some good examples:

You mean render the entire table as a picture?  No, I don't want that.
Emacs is about text, and if you can't display the HTML as text, it's not
Emacs.  (Kill/yank/click links, etc.)

Besides, Emacs totally, utterly sucks at displaying images, and tables
used for layout are usually big.  As in, the entire page is inside
nested tables.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Truncating lines in the article buffer
  2010-10-14 16:24       ` Lars Magne Ingebrigtsen
@ 2010-10-14 17:00         ` Ted Zlatanov
  2010-10-14 18:19           ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 17+ messages in thread
From: Ted Zlatanov @ 2010-10-14 17:00 UTC (permalink / raw)
  To: ding

On Thu, 14 Oct 2010 18:24:35 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

LMI> Ted Zlatanov <tzz@lifelogs.com> writes:
>> Consider using SVG to render the tables.  It's scalable (including the
>> fonts) so the image will look good at any resolution (if the pixel count
>> allows it).  It's really easy to insert PNG and JPEG images too.  See
>> this for some good examples:

LMI> You mean render the entire table as a picture?  No, I don't want that.
LMI> Emacs is about text, and if you can't display the HTML as text, it's not
LMI> Emacs.  (Kill/yank/click links, etc.)

LMI> Besides, Emacs totally, utterly sucks at displaying images, and tables
LMI> used for layout are usually big.  As in, the entire page is inside
LMI> nested tables.

Then you can't render HTML accurately with the current approach.  You're
fighting Emacs at every step: the text layout is hard, you can't flow
around images, displaying images is a pain, etc.

Maybe we're approaching this wrong because we think a table should be
displayed like HTML does.  How about unwrapping tables into lists?  So
this (a 2x2 table with headers H1 and H2):

 H1  H2
[aaa|bbb]
[ccc|ddd]

gets rendered as

* H1
** aaa
** ccc

* H2
** bbb
** ddd

(I've skipped out the obvious nesting example since it's simply a nested
list.)

That gives you a lot more horizontal space and laying out the text even
in nested situations becomes trivial (you always have a full line for
the table cell).  The image-text flow problem is eliminated.

We'll need a keybinding to flip columns/rows I think, but otherwise this
is a pretty good *view* of the table, even if it's not an accurate
*rendering*.  More importantly, it provides something usable right now
and as the Emacs display engine gets improved it can be improved too.

Ted




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

* Re: Truncating lines in the article buffer
  2010-10-14 17:00         ` Ted Zlatanov
@ 2010-10-14 18:19           ` Lars Magne Ingebrigtsen
  2010-10-14 18:39             ` Ted Zlatanov
  0 siblings, 1 reply; 17+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-14 18:19 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> Then you can't render HTML accurately with the current approach.  You're
> fighting Emacs at every step: the text layout is hard, you can't flow
> around images, displaying images is a pain, etc.

No, the only thing that's impossible is to render images in tables.  The
rest works pretty well.  (If we'd have truncate-lines on a per-line
basis, it'd be pretty darn perfect.)

> Maybe we're approaching this wrong because we think a table should be
> displayed like HTML does.  How about unwrapping tables into lists?  So
> this (a 2x2 table with headers H1 and H2):
>
>  H1  H2
> [aaa|bbb]
> [ccc|ddd]
>
> gets rendered as
>
> * H1
> ** aaa
> ** ccc
>
> * H2
> ** bbb
> ** ddd

I get work email that has configuration settings laid out as tables.
Believe me, you won't have any idea what they're going on about unless
you're actually seeing the tables as tables.

I'm fine with not displaying the images in the tables.  I think it's
impossible* to do in Emacs, but it's not very important.  Having the
text be readable is, though.

---
* That's a challenge.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Truncating lines in the article buffer
  2010-10-14 18:19           ` Lars Magne Ingebrigtsen
@ 2010-10-14 18:39             ` Ted Zlatanov
  2010-10-14 18:53               ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 17+ messages in thread
From: Ted Zlatanov @ 2010-10-14 18:39 UTC (permalink / raw)
  To: ding

On Thu, 14 Oct 2010 20:19:55 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

LMI> Ted Zlatanov <tzz@lifelogs.com> writes:
>> Then you can't render HTML accurately with the current approach.  You're
>> fighting Emacs at every step: the text layout is hard, you can't flow
>> around images, displaying images is a pain, etc.

LMI> No, the only thing that's impossible is to render images in tables.  The
LMI> rest works pretty well.  (If we'd have truncate-lines on a per-line
LMI> basis, it'd be pretty darn perfect.)

Why not walk through the buffer and apply the equivalent of
truncate-lines to every line?  You could set some text property to
indicate it's needed.

LMI> I'm fine with not displaying the images in the tables.  I think it's
LMI> impossible* to do in Emacs, but it's not very important.  Having the
LMI> text be readable is, though.

You could display the image as an icon (the size of a character) and the
user can toggle it to full size with RET or mouse-1.

Ted




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

* Re: Truncating lines in the article buffer
  2010-10-14 18:39             ` Ted Zlatanov
@ 2010-10-14 18:53               ` Lars Magne Ingebrigtsen
  2010-10-14 20:04                 ` Ted Zlatanov
  2010-10-14 21:39                 ` Knut Anders Hatlen
  0 siblings, 2 replies; 17+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-14 18:53 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> Why not walk through the buffer and apply the equivalent of
> truncate-lines to every line?  You could set some text property to
> indicate it's needed.

truncate-lines doesn't truncate lines.  :-)  It only stops them from
being wrapped.  You can scroll to the right to see the end of the
lines. 

> You could display the image as an icon (the size of a character) and the
> user can toggle it to full size with RET or mouse-1.

Images are currently displayed in tables as [img], and you can `I' them
to insert them.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Truncating lines in the article buffer
  2010-10-14 18:53               ` Lars Magne Ingebrigtsen
@ 2010-10-14 20:04                 ` Ted Zlatanov
  2010-10-14 20:13                   ` Lars Magne Ingebrigtsen
  2010-10-14 20:40                   ` Frank Schmitt
  2010-10-14 21:39                 ` Knut Anders Hatlen
  1 sibling, 2 replies; 17+ messages in thread
From: Ted Zlatanov @ 2010-10-14 20:04 UTC (permalink / raw)
  To: ding

On Thu, 14 Oct 2010 20:53:15 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

LMI> Ted Zlatanov <tzz@lifelogs.com> writes:
>> Why not walk through the buffer and apply the equivalent of
>> truncate-lines to every line?  You could set some text property to
>> indicate it's needed.

LMI> truncate-lines doesn't truncate lines.  :-)  It only stops them from
LMI> being wrapped.  You can scroll to the right to see the end of the
LMI> lines. 

Ah, well that makes sense.  Sorry for being dense.

>> You could display the image as an icon (the size of a character) and the
>> user can toggle it to full size with RET or mouse-1.

LMI> Images are currently displayed in tables as [img], and you can `I' them
LMI> to insert them.

I would show them as a tiny icon the size of a character.  It should at
least be an option (and in fact would be great for NSFW images, since it
would offer a tiny preview).  Then `I' can just toggle between the
scaled and full-size versions of the same image.

Ted




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

* Re: Truncating lines in the article buffer
  2010-10-14 20:04                 ` Ted Zlatanov
@ 2010-10-14 20:13                   ` Lars Magne Ingebrigtsen
  2010-10-14 20:32                     ` Ted Zlatanov
  2010-10-14 20:40                   ` Frank Schmitt
  1 sibling, 1 reply; 17+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-14 20:13 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> I would show them as a tiny icon the size of a character.  It should at
> least be an option (and in fact would be great for NSFW images, since it
> would offer a tiny preview).  Then `I' can just toggle between the
> scaled and full-size versions of the same image.

Then we'd have to rescale the images first -- which is no problem if we
have a imagemagick-enable Emacs, but rather slow otherwise.

Anyway, we have these cases:

1) the image is blocked

2) the image isn't downloaded yet

3) the image is downloaded

For the first two (and images in tables) shr shows "[img]" or (a bit of)
the alt string.  2) then replaces the string with the image
asynchronously when it arrives.  Having another case where you don't
want to block the image, but want to show an itsy-bitsy version of it
instead doesn't sound all that useful, I think.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Truncating lines in the article buffer
  2010-10-14 20:13                   ` Lars Magne Ingebrigtsen
@ 2010-10-14 20:32                     ` Ted Zlatanov
  0 siblings, 0 replies; 17+ messages in thread
From: Ted Zlatanov @ 2010-10-14 20:32 UTC (permalink / raw)
  To: ding

On Thu, 14 Oct 2010 22:13:23 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

LMI> Ted Zlatanov <tzz@lifelogs.com> writes:
>> I would show them as a tiny icon the size of a character.  It should at
>> least be an option (and in fact would be great for NSFW images, since it
>> would offer a tiny preview).  Then `I' can just toggle between the
>> scaled and full-size versions of the same image.

LMI> Having another case where you don't want to block the image, but
LMI> want to show an itsy-bitsy version of it instead doesn't sound all
LMI> that useful, I think.

OK.  I may implement it myself if I find it useful but I think you're right.

Ted




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

* Re: Truncating lines in the article buffer
  2010-10-14 20:04                 ` Ted Zlatanov
  2010-10-14 20:13                   ` Lars Magne Ingebrigtsen
@ 2010-10-14 20:40                   ` Frank Schmitt
  2010-10-14 20:57                     ` Ted Zlatanov
  2010-10-14 21:15                     ` Lars Magne Ingebrigtsen
  1 sibling, 2 replies; 17+ messages in thread
From: Frank Schmitt @ 2010-10-14 20:40 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Thu, 14 Oct 2010 20:53:15 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 
>
> LMI> Images are currently displayed in tables as [img], and you can `I' them
> LMI> to insert them.
>
> I would show them as a tiny icon the size of a character.  It should at
> least be an option (and in fact would be great for NSFW images, since it
> would offer a tiny preview).  Then `I' can just toggle between the
> scaled and full-size versions of the same image.

Did I hear someone saying pornview.el here? :-)

-- 
Have you ever considered how much text can fit in eighty columns?  Given that a
signature typically contains up to four lines of text, this space allows you to
attach a tremendous amount of valuable information to your messages.  Seize the
opportunity and don't waste your signature on bullshit that nobody cares about.




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

* Re: Truncating lines in the article buffer
  2010-10-14 20:40                   ` Frank Schmitt
@ 2010-10-14 20:57                     ` Ted Zlatanov
  2010-10-14 21:15                     ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 17+ messages in thread
From: Ted Zlatanov @ 2010-10-14 20:57 UTC (permalink / raw)
  To: ding

On Thu, 14 Oct 2010 22:40:18 +0200 Frank Schmitt <ich@frank-schmitt.net> wrote: 

FS> Ted Zlatanov <tzz@lifelogs.com> writes:
>> On Thu, 14 Oct 2010 20:53:15 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 
>> 
LMI> Images are currently displayed in tables as [img], and you can `I' them
LMI> to insert them.
>> 
>> I would show them as a tiny icon the size of a character.  It should at
>> least be an option (and in fact would be great for NSFW images, since it
>> would offer a tiny preview).  Then `I' can just toggle between the
>> scaled and full-size versions of the same image.

FS> Did I hear someone saying pornview.el here? :-)

"I felt a great disturbance in the Force, as if millions of voices
suddenly cried out in terror and were suddenly silenced. I fear
something terrible has happened."

Ted




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

* Re: Truncating lines in the article buffer
  2010-10-14 20:40                   ` Frank Schmitt
  2010-10-14 20:57                     ` Ted Zlatanov
@ 2010-10-14 21:15                     ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 17+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-14 21:15 UTC (permalink / raw)
  To: ding

Frank Schmitt <ich@frank-schmitt.net> writes:

> Did I hear someone saying pornview.el here? :-)

I think you did...

Anyway, I've now made shr switch truncate-lines on if there are wide
tables.  I'm not sure how that'll work out in practise, but I guess
we'll find out.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Truncating lines in the article buffer
  2010-10-14 18:53               ` Lars Magne Ingebrigtsen
  2010-10-14 20:04                 ` Ted Zlatanov
@ 2010-10-14 21:39                 ` Knut Anders Hatlen
  2010-10-15 14:18                   ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 17+ messages in thread
From: Knut Anders Hatlen @ 2010-10-14 21:39 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Images are currently displayed in tables as [img], and you can `I' them
> to insert them.

Are you planning to make W D W insert all images? Currently I get
"Symbol's function definition is void: gnus-html-show-images" when I try
it with shr.

-- 
Knut Anders




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

* Re: Truncating lines in the article buffer
  2010-10-14 21:39                 ` Knut Anders Hatlen
@ 2010-10-15 14:18                   ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 17+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-15 14:18 UTC (permalink / raw)
  To: ding

Knut Anders Hatlen <kahatlen@gmail.com> writes:

> Are you planning to make W D W insert all images? Currently I get
> "Symbol's function definition is void: gnus-html-show-images" when I try
> it with shr.

I've now fixed the error message, but not actually made it do anything.
The main reason is that I'm not quite sure what the interface should
be.  Gnus knows nothing about the shr-ness of it all, so it'd be odd to
look for images using shr-specific text properties.

I'm thinking perhaps shr should register some kind of callback function
with Gnus...  or perhaps that's over-engineering it.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

end of thread, other threads:[~2010-10-15 14:18 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-07 21:17 Truncating lines in the article buffer Lars Magne Ingebrigtsen
2010-10-13 21:56 ` Kevin Ryde
2010-10-13 22:01   ` Lars Magne Ingebrigtsen
2010-10-14 15:09     ` Ted Zlatanov
2010-10-14 16:24       ` Lars Magne Ingebrigtsen
2010-10-14 17:00         ` Ted Zlatanov
2010-10-14 18:19           ` Lars Magne Ingebrigtsen
2010-10-14 18:39             ` Ted Zlatanov
2010-10-14 18:53               ` Lars Magne Ingebrigtsen
2010-10-14 20:04                 ` Ted Zlatanov
2010-10-14 20:13                   ` Lars Magne Ingebrigtsen
2010-10-14 20:32                     ` Ted Zlatanov
2010-10-14 20:40                   ` Frank Schmitt
2010-10-14 20:57                     ` Ted Zlatanov
2010-10-14 21:15                     ` Lars Magne Ingebrigtsen
2010-10-14 21:39                 ` Knut Anders Hatlen
2010-10-15 14:18                   ` 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).