all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* font-lock-face superseeds face?
@ 2007-06-15 16:45 Lennart Borgman (gmail)
  2007-06-16  8:48 ` martin rudalics
  0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman (gmail) @ 2007-06-15 16:45 UTC (permalink / raw)
  To: Emacs Devel

Is not the text property 'font-lock-face supposed to superseed 'face? 
Should not this give one character shown in the face 'highlight:

   (put-text-property (1- (point)) (point) 'font-lock-face 'highlight)

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

* Re: font-lock-face superseeds face?
  2007-06-15 16:45 font-lock-face superseeds face? Lennart Borgman (gmail)
@ 2007-06-16  8:48 ` martin rudalics
  2007-06-16  9:13   ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 9+ messages in thread
From: martin rudalics @ 2007-06-16  8:48 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: Emacs Devel

> Is not the text property 'font-lock-face supposed to superseed 'face? 
> Should not this give one character shown in the face 'highlight:
> 
>   (put-text-property (1- (point)) (point) 'font-lock-face 'highlight)

It works properly here with Emacs -Q, putting the line into *scratch*,
point after it, and doing C-x C-e.  The closing parenthesis is displayed
with the 'highlight face.  What did you do to make it fail?

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

* Re: font-lock-face superseeds face?
  2007-06-16  8:48 ` martin rudalics
@ 2007-06-16  9:13   ` Lennart Borgman (gmail)
  2007-06-16 10:09     ` martin rudalics
  0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman (gmail) @ 2007-06-16  9:13 UTC (permalink / raw)
  To: martin rudalics; +Cc: Emacs Devel

martin rudalics wrote:
>> Is not the text property 'font-lock-face supposed to superseed 'face? 
>> Should not this give one character shown in the face 'highlight:
>>
>>   (put-text-property (1- (point)) (point) 'font-lock-face 'highlight)
> 
> It works properly here with Emacs -Q, putting the line into *scratch*,
> point after it, and doing C-x C-e.  The closing parenthesis is displayed
> with the 'highlight face.  What did you do to make it fail?

Thanks for the answer. Yes, it works for me to evaluating it like you did.

I evaluated it from the minibuffer with M-:, but that does not make any 
difference.

However if I now comment out the statement the 'highlight face is 
hidden. Does that happen for you too?

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

* Re: font-lock-face superseeds face?
  2007-06-16  9:13   ` Lennart Borgman (gmail)
@ 2007-06-16 10:09     ` martin rudalics
  2007-06-16 10:11       ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 9+ messages in thread
From: martin rudalics @ 2007-06-16 10:09 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: Emacs Devel

> However if I now comment out the statement the 'highlight face is 
> hidden. Does that happen for you too?

Yes.

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

* Re: font-lock-face superseeds face?
  2007-06-16 10:09     ` martin rudalics
@ 2007-06-16 10:11       ` Lennart Borgman (gmail)
  2007-06-16 12:25         ` martin rudalics
  0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman (gmail) @ 2007-06-16 10:11 UTC (permalink / raw)
  To: martin rudalics; +Cc: Emacs Devel

martin rudalics wrote:
>> However if I now comment out the statement the 'highlight face is 
>> hidden. Does that happen for you too?
> 
> Yes.

Well, and is not that a bug? Or have I misunderstood how 'font-lock-face 
should behave?

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

* Re: font-lock-face superseeds face?
  2007-06-16 10:11       ` Lennart Borgman (gmail)
@ 2007-06-16 12:25         ` martin rudalics
  2007-06-16 12:38           ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 9+ messages in thread
From: martin rudalics @ 2007-06-16 12:25 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: Emacs Devel

> Well, and is not that a bug? Or have I misunderstood how 'font-lock-face 
> should behave?

Did you try to trace the behavior?  Is it in redisplay?

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

* Re: font-lock-face superseeds face?
  2007-06-16 12:25         ` martin rudalics
@ 2007-06-16 12:38           ` Lennart Borgman (gmail)
  2007-06-16 14:44             ` martin rudalics
  0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman (gmail) @ 2007-06-16 12:38 UTC (permalink / raw)
  To: martin rudalics; +Cc: Emacs Devel

martin rudalics wrote:
>> Well, and is not that a bug? Or have I misunderstood how 
>> 'font-lock-face should behave?
> 
> Did you try to trace the behavior?  Is it in redisplay?

No, I have not tried that yet. I wanted to be sure what the behaviour 
should be first. Actually I believe it worked as I expect it to long 
before, but I am not sure. It is however quite possible I got fooled by 
the different cases we have seen here.

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

* Re: font-lock-face superseeds face?
  2007-06-16 12:38           ` Lennart Borgman (gmail)
@ 2007-06-16 14:44             ` martin rudalics
  2007-06-16 20:15               ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 9+ messages in thread
From: martin rudalics @ 2007-06-16 14:44 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: Emacs Devel

 > No, I have not tried that yet. I wanted to be sure what the behaviour
 > should be first. Actually I believe it worked as I expect it to long
 > before, but I am not sure. It is however quite possible I got fooled by
 > the different cases we have seen here.

I never used the `font-lock-face' property before hence I can't tell.
The documentation tells me nothing about whether it should override
("supersede") any other face / font-lock-face.  The Elisp manual says

      ...  This can be advantageous for special buffers
      which are not intended to be user-editable, or for static areas of
      text which are always fontified in the same way. ...

and none of these apply in your case.  If you want to change the
behavior in your particular use case insert a line like

	    (unless (text-property-not-all beg (point) 'font-lock-face nil)

before

	      (when face (put-text-property beg (point) 'face face))

in `font-lock-fontify-syntactically-region'.

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

* Re: font-lock-face superseeds face?
  2007-06-16 14:44             ` martin rudalics
@ 2007-06-16 20:15               ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 9+ messages in thread
From: Lennart Borgman (gmail) @ 2007-06-16 20:15 UTC (permalink / raw)
  To: martin rudalics; +Cc: Emacs Devel

martin rudalics wrote:
>  > No, I have not tried that yet. I wanted to be sure what the behaviour
>  > should be first. Actually I believe it worked as I expect it to long
>  > before, but I am not sure. It is however quite possible I got fooled by
>  > the different cases we have seen here.
> 
> I never used the `font-lock-face' property before hence I can't tell.
> The documentation tells me nothing about whether it should override
> ("supersede") any other face / font-lock-face.  The Elisp manual says
> 
>      ...  This can be advantageous for special buffers
>      which are not intended to be user-editable, or for static areas of
>      text which are always fontified in the same way. ...
> 
> and none of these apply in your case.  If you want to change the
> behavior in your particular use case insert a line like
> 
>         (unless (text-property-not-all beg (point) 'font-lock-face nil)
> 
> before
> 
>           (when face (put-text-property beg (point) 'face face))
> 
> in `font-lock-fontify-syntactically-region'.

In my case I just want to avoid using overlays (it simplifies the code 
very much in my case).

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

end of thread, other threads:[~2007-06-16 20:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-15 16:45 font-lock-face superseeds face? Lennart Borgman (gmail)
2007-06-16  8:48 ` martin rudalics
2007-06-16  9:13   ` Lennart Borgman (gmail)
2007-06-16 10:09     ` martin rudalics
2007-06-16 10:11       ` Lennart Borgman (gmail)
2007-06-16 12:25         ` martin rudalics
2007-06-16 12:38           ` Lennart Borgman (gmail)
2007-06-16 14:44             ` martin rudalics
2007-06-16 20:15               ` Lennart Borgman (gmail)

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.