help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coloring window parts without content


From: Dieter Wilhelm
Subject: Re: Coloring window parts without content
Date: Thu, 30 Nov 2006 09:01:04 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

"address@hidden" <address@hidden> writes:

> Dieter Wilhelm wrote:
>> "address@hidden" <address@hidden> writes:
>>
>> > I'd like to color the headings in outline, so that the headings have a
>> > distinct background color which spans horizontally across the visible
>> > window.
>>
>> This reminds me a bit of hl-line-mode.
>
> I took a look at hl-line-mode implementation and the solution is very
> simple. It puts an overlay onto the whole line including the newline
> character (note the 1+):
>
>       (move-overlay hl-line-overlay
>                   (line-beginning-position) (1+ (line-end-position))
>                   (current-buffer)))))
>
> I also tried it with text properties and it works the same way:
>
>    (put-text-property (line-beginning-position) (+ 1
> (line-end-position))
>                      'face 'highlight)
>
>
> I thought I finally found something which emacs couldn't do, but I was
> wrong. Emacs cannot be beaten. :)
>

Thank you for your response, I learned something as well 8-)

>
> The only thing remaining is to hack outline mode somehow to propertize
> headings this way. I think it's an improvement, so it should  be
> included (with an option maybe) in the default outline.el.

Yes, it might improve readability (A graphic example comparing this
would be ideal to convince people working on this).

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany




reply via email to

[Prev in Thread] Current Thread [Next in Thread]