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: address@hidden
Subject: Re: Coloring window parts without content
Date: 29 Nov 2006 23:19:26 -0800
User-agent: G2/1.0

Dieter Wilhelm wrote:
> "spamfilteraccount@gmail.com" <spamfilteraccount@gmail.com> 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. :)


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.



reply via email to

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