all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Coloring window parts without content
@ 2006-11-29 10:48 spamfilteraccount
  2006-11-30  7:03 ` Dieter Wilhelm
       [not found] ` <mailman.1343.1164870209.2155.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 13+ messages in thread
From: spamfilteraccount @ 2006-11-29 10:48 UTC (permalink / raw)


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.

I can insert spaces of course after the heading text, but it's clumsy.
Is it possible to color buffer parts beyond the ending of the current
line? AFAIK, only buffer contents can have face properties.

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

* Re: Coloring window parts without content
  2006-11-29 10:48 Coloring window parts without content spamfilteraccount
@ 2006-11-30  7:03 ` Dieter Wilhelm
       [not found] ` <mailman.1343.1164870209.2155.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 13+ messages in thread
From: Dieter Wilhelm @ 2006-11-30  7:03 UTC (permalink / raw)
  Cc: help-gnu-emacs

"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 can insert spaces of course after the heading text, but it's clumsy.
> Is it possible to color buffer parts beyond the ending of the current
> line? AFAIK, only buffer contents can have face properties.

Sorry, no precise idea (maybe with overlays?) but I'm hopeful that in
above function you will find an answer on how one could achieve this
(and hopefully returning your findings 8-).

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

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

* Re: Coloring window parts without content
       [not found] ` <mailman.1343.1164870209.2155.help-gnu-emacs@gnu.org>
@ 2006-11-30  7:19   ` spamfilteraccount
  2006-11-30  8:01     ` Dieter Wilhelm
       [not found]     ` <mailman.1345.1164873691.2155.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 13+ messages in thread
From: spamfilteraccount @ 2006-11-30  7:19 UTC (permalink / raw)



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.

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

* Re: Coloring window parts without content
  2006-11-30  7:19   ` spamfilteraccount
@ 2006-11-30  8:01     ` Dieter Wilhelm
       [not found]     ` <mailman.1345.1164873691.2155.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 13+ messages in thread
From: Dieter Wilhelm @ 2006-11-30  8:01 UTC (permalink / raw)
  Cc: help-gnu-emacs

"spamfilteraccount@gmail.com" <spamfilteraccount@gmail.com> writes:

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

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

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

* Re: Coloring window parts without content
       [not found]     ` <mailman.1345.1164873691.2155.help-gnu-emacs@gnu.org>
@ 2006-11-30  8:17       ` spamfilteraccount
  2006-12-01  0:39         ` Dieter Wilhelm
       [not found]         ` <mailman.1380.1164933580.2155.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 13+ messages in thread
From: spamfilteraccount @ 2006-11-30  8:17 UTC (permalink / raw)



Dieter Wilhelm wrote:
>
> >
> > 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).
>

Well, here's  a demo outline created with manual spacing:

http://img86.imageshack.us/img86/7140/outlinedz7.jpg

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

* Re: Coloring window parts without content
  2006-11-30  8:17       ` spamfilteraccount
@ 2006-12-01  0:39         ` Dieter Wilhelm
       [not found]         ` <mailman.1380.1164933580.2155.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 13+ messages in thread
From: Dieter Wilhelm @ 2006-12-01  0:39 UTC (permalink / raw)
  Cc: help-gnu-emacs

"spamfilteraccount@gmail.com" <spamfilteraccount@gmail.com> writes:

> Dieter Wilhelm wrote:
>>
>> >
>> > 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).
>>
>
> Well, here's  a demo outline created with manual spacing:
>
> http://img86.imageshack.us/img86/7140/outlinedz7.jpg

Thanks, one can't miss the headings!  But I think it would be more
convincing (more objective) when the same content would be shown
directly in comparison with the "old" method.

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

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

* Re: Coloring window parts without content
       [not found]         ` <mailman.1380.1164933580.2155.help-gnu-emacs@gnu.org>
@ 2006-12-01  7:16           ` spamfilteraccount
  2006-12-01  7:56             ` Dieter Wilhelm
                               ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: spamfilteraccount @ 2006-12-01  7:16 UTC (permalink / raw)



Dieter Wilhelm wrote:
> >
> > Well, here's  a demo outline created with manual spacing:
> >
> > http://img86.imageshack.us/img86/7140/outlinedz7.jpg
>
> Thanks, one can't miss the headings!  But I think it would be more
> convincing (more objective) when the same content would be shown
> directly in comparison with the "old" method.
>

Okay, here's an other capture with standard colors:

http://img154.imageshack.us/img154/7913/oldnh6.jpg

You may hav to click the picture to see it in full resolution.


BTW, the only thing the outline.el developers should do is to change
font locking so that the face property includes the ending newline
characters. If it is done then both the current coloring behavior and
the one I proposed could be used (depending on face settings), so it
could be the best of both worlds.

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

* Re: Coloring window parts without content
  2006-12-01  7:16           ` spamfilteraccount
@ 2006-12-01  7:56             ` Dieter Wilhelm
       [not found]             ` <mailman.1390.1164959790.2155.help-gnu-emacs@gnu.org>
                               ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Dieter Wilhelm @ 2006-12-01  7:56 UTC (permalink / raw)
  Cc: help-gnu-emacs

"spamfilteraccount@gmail.com" <spamfilteraccount@gmail.com> writes:

> Dieter Wilhelm wrote:
>> >
>> > Well, here's  a demo outline created with manual spacing:
>> >
>> > http://img86.imageshack.us/img86/7140/outlinedz7.jpg
>>
>> Thanks, one can't miss the headings!  But I think it would be more
>> convincing (more objective) when the same content would be shown
>> directly in comparison with the "old" method.
>>
>
> Okay, here's an other capture with standard colors:
>
> http://img154.imageshack.us/img154/7913/oldnh6.jpg
>

Thank you.

>
> BTW, the only thing the outline.el developers should do is to change
> font locking so that the face property includes the ending newline
> characters. If it is done then both the current coloring behavior and
> the one I proposed could be used (depending on face settings), so it
> could be the best of both worlds.

I think it would be a nice option.  You could send both of the images
to emacs-devel@gnu.org making a feature request out of it.  Let's see
what the developers think of it.

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

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

* Re: Coloring window parts without content
       [not found]             ` <mailman.1390.1164959790.2155.help-gnu-emacs@gnu.org>
@ 2006-12-01  8:09               ` spamfilteraccount
  2006-12-01  8:22                 ` spamfilteraccount
  2006-12-01 20:17                 ` Dieter Wilhelm
  0 siblings, 2 replies; 13+ messages in thread
From: spamfilteraccount @ 2006-12-01  8:09 UTC (permalink / raw)



Dieter Wilhelm wrote:
>
> I think it would be a nice option.  You could send both of the images
> to emacs-devel@gnu.org making a feature request out of it.  Let's see
> what the developers think of it.

Well, they should make new faces for outline first. Currently (emacs
21), outline uses the standard font-lock faces for coloring heading
levels (font-lock-function-name-face, etc), so the faces cannot be
changed without affecting faces in programming modes. (I had to hack
outline-mode to make it work as on the capture without affecting the
standard faces).

This is unreasonable and I've seen complaints in 2002 about this and
nothing has changed since then. So there are other things which should
be fixed first, but emacs 22 is already in feature freeze mode, so it
will be fixed only in emacs 23 I guess.

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

* Re: Coloring window parts without content
  2006-12-01  8:09               ` spamfilteraccount
@ 2006-12-01  8:22                 ` spamfilteraccount
  2006-12-01 20:17                 ` Dieter Wilhelm
  1 sibling, 0 replies; 13+ messages in thread
From: spamfilteraccount @ 2006-12-01  8:22 UTC (permalink / raw)



spamfilteraccount@gmail.com wrote:
>
> This is unreasonable and I've seen complaints in 2002 about this and
> nothing has changed since then.

Correction. It is fixed in emacs cvs.

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

* Re: Coloring window parts without content
  2006-12-01  8:09               ` spamfilteraccount
  2006-12-01  8:22                 ` spamfilteraccount
@ 2006-12-01 20:17                 ` Dieter Wilhelm
  1 sibling, 0 replies; 13+ messages in thread
From: Dieter Wilhelm @ 2006-12-01 20:17 UTC (permalink / raw)
  Cc: help-gnu-emacs

"spamfilteraccount@gmail.com" <spamfilteraccount@gmail.com> writes:

> Dieter Wilhelm wrote:
>>
>> I think it would be a nice option.  You could send both of the images
>> to emacs-devel@gnu.org making a feature request out of it.  Let's see
>> what the developers think of it.
>
...

>
> be fixed first, but emacs 22 is already in feature freeze mode, so it

True, but you could wait until a month after the release.  At least
this is what I was being told with another feature request.

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

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

* Re: Coloring window parts without content
  2006-12-01  7:16           ` spamfilteraccount
  2006-12-01  7:56             ` Dieter Wilhelm
       [not found]             ` <mailman.1390.1164959790.2155.help-gnu-emacs@gnu.org>
@ 2006-12-04  9:54             ` Hadron Quark
  2006-12-04 13:06             ` spamfilteraccount
  3 siblings, 0 replies; 13+ messages in thread
From: Hadron Quark @ 2006-12-04  9:54 UTC (permalink / raw)


"spamfilteraccount@gmail.com" <spamfilteraccount@gmail.com> writes:

> Dieter Wilhelm wrote:
>> >
>> > Well, here's  a demo outline created with manual spacing:
>> >
>> > http://img86.imageshack.us/img86/7140/outlinedz7.jpg
>>
>> Thanks, one can't miss the headings!  But I think it would be more
>> convincing (more objective) when the same content would be shown
>> directly in comparison with the "old" method.
>>
>
> Okay, here's an other capture with standard colors:
>
> http://img154.imageshack.us/img154/7913/oldnh6.jpg
>
> You may hav to click the picture to see it in full resolution.
>
>
> BTW, the only thing the outline.el developers should do is to change
> font locking so that the face property includes the ending newline
> characters. If it is done then both the current coloring behavior and
> the one I proposed could be used (depending on face settings), so it
> could be the best of both worlds.
>

Is there a speedbar integration for org?

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

* Re: Coloring window parts without content
  2006-12-01  7:16           ` spamfilteraccount
                               ` (2 preceding siblings ...)
  2006-12-04  9:54             ` Hadron Quark
@ 2006-12-04 13:06             ` spamfilteraccount
  3 siblings, 0 replies; 13+ messages in thread
From: spamfilteraccount @ 2006-12-04 13:06 UTC (permalink / raw)



spamfilteraccount@gmail.com wrote:
>
> BTW, the only thing the outline.el developers should do is to change
> font locking so that the face property includes the ending newline
> characters. If it is done then both the current coloring behavior and
> the one I proposed could be used (depending on face settings), so it
> could be the best of both worlds.

If anyone wants to try it here's a simple hack.

I replaced outline-font-lock-keywords with this definition (note the
\xa after outline-regexp, the newline character is also matched):

(defvar outline-font-lock-keywords
 ;; Highlight headings according to the level.
 '((eval . (list (concat "^" outline-regexp ".+\xa")
                 0 '(or (cdr (assq (outline-font-lock-level)
                                   '((1 . outline-1-face)
                                     (2 . outline-2-face)
                                     (3 . outline-3-face)
                                     (4 . outline-4-face)
                                     (5 . outline-5-face)
                                     (6 . outline-6-face)
                                     (7 . outline-7-face)
                                     (8 . outline-8-face))))
                        font-lock-warning-face)
                 nil t))))


It's for emacs21. You have to define your own faces to use it:

(defface outline-1-face
  '((t (:background "lightsteelblue1")))
  "Outline face for level 1.") 
...

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

end of thread, other threads:[~2006-12-04 13:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-29 10:48 Coloring window parts without content spamfilteraccount
2006-11-30  7:03 ` Dieter Wilhelm
     [not found] ` <mailman.1343.1164870209.2155.help-gnu-emacs@gnu.org>
2006-11-30  7:19   ` spamfilteraccount
2006-11-30  8:01     ` Dieter Wilhelm
     [not found]     ` <mailman.1345.1164873691.2155.help-gnu-emacs@gnu.org>
2006-11-30  8:17       ` spamfilteraccount
2006-12-01  0:39         ` Dieter Wilhelm
     [not found]         ` <mailman.1380.1164933580.2155.help-gnu-emacs@gnu.org>
2006-12-01  7:16           ` spamfilteraccount
2006-12-01  7:56             ` Dieter Wilhelm
     [not found]             ` <mailman.1390.1164959790.2155.help-gnu-emacs@gnu.org>
2006-12-01  8:09               ` spamfilteraccount
2006-12-01  8:22                 ` spamfilteraccount
2006-12-01 20:17                 ` Dieter Wilhelm
2006-12-04  9:54             ` Hadron Quark
2006-12-04 13:06             ` spamfilteraccount

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.