[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: slow redisplay after changing cursor color
From: |
Kim F. Storm |
Subject: |
Re: slow redisplay after changing cursor color |
Date: |
Wed, 15 Sep 2004 19:06:45 +0200 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) |
Richard Stallman <address@hidden> writes:
> I didn't change defface / custormize-face to reject :inherit from face
> with the face-no-inherit property (it would be nice, but I don't quite
> know how to do that).
>
> The code that processes the user's input could check for a :inherit
> attribute, and look at the face to be inherited from.
I tried this, but got stuck -- someone who understands defface and
customize-face, please take a look...
Something like:
(if (and (equal (car attr) :inherit)
(get (cdr attr) ; the face
'face-no-inherit))
(error "You cannot inherit from %S" (cdr attr)))
>
> However, :inherit is not the only way to use a face.
>
> What happens, with your code, if someone simply gives an overlay a
> face property of `cursor-color'? That would realize a face using the
> color from `cursor-color', right? With your change, that won't update
> either if the face is changed. Or at least I think so; what actually
> happens?
That sounds like a correct analysis, but I just tried it, and the
display is updated correctly...
Execute this in a fundamental buffer:
(progn
(insert "\n12345\n")
(add-text-properties (- (point) 6) (1- (point)) '(face cursor)))
Then execute this in the *scratch* buffer:
(require 'cl)
(loop for i from 0 to 501 by 1
do (set-cursor-color (if (eq 1 (mod i 2))
"blue"
"red"))
(sit-for 0))
Ok, the 12345 does not change color until the command completes, but I
think that's a very small problem (the example is "constructed").
>
> If it's the way I expect, I think we should urge users not to do that,
> or else make it get an error, or else make it work.
>
> Is it necessary to add anything to NEWS or the manuals about this ?
>
> It should tell people that they can't, or shouldn't, use certain faces
> in certain ways. I don't think it needs to describe the mechanism
> such as the face-no-inherit property.
Is this ok?
Faces must not inherit from the `cursor' face. If you do this, such
faces may not be correctly updated if you change the cursor face.
--
Kim F. Storm http://www.cua.dk
- slow redisplay after changing cursor color, NAKAMURA Toshikazu, 2004/09/12
- Re: slow redisplay after changing cursor color, Richard Stallman, 2004/09/13
- Re: slow redisplay after changing cursor color, Kim F. Storm, 2004/09/13
- Re: slow redisplay after changing cursor color, Richard Stallman, 2004/09/13
- Re: slow redisplay after changing cursor color, Kim F. Storm, 2004/09/14
- Re: slow redisplay after changing cursor color, Kim F. Storm, 2004/09/14
- Re: slow redisplay after changing cursor color, Stefan Monnier, 2004/09/14
- Re: slow redisplay after changing cursor color, Kim F. Storm, 2004/09/14
- Re: slow redisplay after changing cursor color, NAKAMURA Toshikazu, 2004/09/15
- Re: slow redisplay after changing cursor color, Richard Stallman, 2004/09/15
- Re: slow redisplay after changing cursor color,
Kim F. Storm <=
- Re: slow redisplay after changing cursor color, Richard Stallman, 2004/09/17