Gnus development mailing list
 help / color / mirror / Atom feed
* Re: colorizing empty space
       [not found] ` <878vzk67mi.fsf@stupidchicken.com>
@ 2011-01-24 18:17   ` Ted Zlatanov
  2011-01-24 22:16     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Ted Zlatanov @ 2011-01-24 18:17 UTC (permalink / raw)
  To: ding; +Cc: emacs-devel

On Mon, 20 Dec 2010 18:50:13 +0800 Chong Yidong <cyd@stupidchicken.com> wrote: 

CY> Ted Zlatanov <tzz@lifelogs.com> writes:
>> I wonder if there's a way to give all the lines max(paragraph lines)+1
>> width using "visual" space, so at least one "visual" space is added on
>> the right (shown with x):
>> 
>> Helloxxxx\n
>> therexxxx\n
>> everyonex\n
>> 
>> which can then be colorized with the proper background.  I'd like this
>> to happen without actually modifying the text (so if copied it will
>> retain the original content), so I was wondering if font-lock or some
>> other Emacs wizardry could be used to create this "visual" space effect.

CY> You could make the "xxxx\n" a display string on top of the newline
CY> character.

That sounds reasonable.  Thank you for the hint.  We'll try it in Gnus.

Ted




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

* Re: colorizing empty space
  2011-01-24 18:17   ` colorizing empty space Ted Zlatanov
@ 2011-01-24 22:16     ` Lars Ingebrigtsen
  2011-01-24 23:02       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2011-01-24 22:16 UTC (permalink / raw)
  To: ding; +Cc: emacs-devel

Ted Zlatanov <tzz@lifelogs.com> writes:

> CY> You could make the "xxxx\n" a display string on top of the newline
> CY> character.
>
> That sounds reasonable.  Thank you for the hint.  We'll try it in Gnus.

A display string?  How does that work?

Oh, putting a `display' property on the newlines that has a lot of
spaces in it?  Neat.  I'll try to have shr do that and see how that
looks. 

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




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

* Re: colorizing empty space
  2011-01-24 22:16     ` Lars Ingebrigtsen
@ 2011-01-24 23:02       ` Lars Ingebrigtsen
  2011-01-24 23:14         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2011-01-24 23:02 UTC (permalink / raw)
  To: ding; +Cc: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Oh, putting a `display' property on the newlines that has a lot of
> spaces in it?  Neat.  I'll try to have shr do that and see how that
> looks. 

Uhm.  But then we'd have to put the background colour on the newline
character anyway, so that won't help?

Or perhaps putting the display property on the last character on the
line would do the trick?  (And we'd have to add the character itself,
then, to the property.)

But what about completely blank lines?

Uhm...  or perhaps Emacs respects text with properties as the display
property...  yeah...  I'll try that, then.

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




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

* Re: colorizing empty space
  2011-01-24 23:02       ` Lars Ingebrigtsen
@ 2011-01-24 23:14         ` Lars Ingebrigtsen
  2011-01-24 23:26           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2011-01-24 23:14 UTC (permalink / raw)
  To: ding; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 197 bytes --]

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Uhm...  or perhaps Emacs respects text with properties as the display
> property...  yeah...  I'll try that, then.

That works.  Here's my test case:


[-- Attachment #2: Type: text/html, Size: 132 bytes --]

[-- Attachment #3: Type: text/plain, Size: 554 bytes --]


The problem is, though, that this doesn't really solve anything.
Whether you put a `display' property on the text, or you pad it with
spaces, the result is much the same: If you kill'n'yank the text to a
different buffer, and want to use it there, you still have to deal with
the pesky extra padding.  With the `display' hack it's even worse,
because there's not obvious way to get rid of the padding.

So I think this approach isn't quite workable.

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

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

* Re: colorizing empty space
  2011-01-24 23:14         ` Lars Ingebrigtsen
@ 2011-01-24 23:26           ` Lars Ingebrigtsen
  2011-01-25  0:34             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2011-01-24 23:26 UTC (permalink / raw)
  To: ding; +Cc: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> So I think this approach isn't quite workable.

It was suggested to use overlays and `before-string', and that seems to
work perfectly with kill'n'yank.

The current implementation doesn't handle all cases (nested boxes where
the outer one is bigger than the inner), but that should be a SMOP.

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




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

* Re: colorizing empty space
  2011-01-24 23:26           ` Lars Ingebrigtsen
@ 2011-01-25  0:34             ` Lars Ingebrigtsen
  2011-01-28  1:34               ` Ted Zlatanov
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2011-01-25  0:34 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 54 bytes --]

This should now work properly for nested boxes, too:


[-- Attachment #2: Type: text/html, Size: 150 bytes --]

[-- Attachment #3: Type: text/plain, Size: 103 bytes --]


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

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

* Re: colorizing empty space
  2011-01-25  0:34             ` Lars Ingebrigtsen
@ 2011-01-28  1:34               ` Ted Zlatanov
  0 siblings, 0 replies; 7+ messages in thread
From: Ted Zlatanov @ 2011-01-28  1:34 UTC (permalink / raw)
  To: ding

On Mon, 24 Jan 2011 16:34:04 -0800 Lars Ingebrigtsen <larsi@gnus.org> wrote: 

LI> This should now work properly for nested boxes, too:
LI> Little text that's very long.

LI> This is a text.
LI> More
LI> More text

Confirming that this works properly.  Thank you for working on it.

Ted




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

end of thread, other threads:[~2011-01-28  1:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87oc8la5u2.fsf@lifelogs.com>
     [not found] ` <878vzk67mi.fsf@stupidchicken.com>
2011-01-24 18:17   ` colorizing empty space Ted Zlatanov
2011-01-24 22:16     ` Lars Ingebrigtsen
2011-01-24 23:02       ` Lars Ingebrigtsen
2011-01-24 23:14         ` Lars Ingebrigtsen
2011-01-24 23:26           ` Lars Ingebrigtsen
2011-01-25  0:34             ` Lars Ingebrigtsen
2011-01-28  1:34               ` Ted Zlatanov

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).