[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
When are the face text properties actually set?
From: |
jack-mac |
Subject: |
When are the face text properties actually set? |
Date: |
Wed, 13 Jun 2012 07:32:31 -0700 (PDT) |
User-agent: |
G2/1.0 |
I'm using GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.22.0)
of 2011-03-04 on roseapple, modified by Debian
I start "emacs -Q", open any emacs-lisp file which containing more
than
one page of text. I choose a point (e.g. 2400) which is beyond the
first page and type the following:
M-: (get-text-property 2400 'face) RET
=> nil
M-: (progn (goto-char 2400) (get-text-property 2400 'face))
=> nil
Now, point 2400 is visible.
M-: (get-text-property 2400 'face) RET
=> font-lock-comment-face
The function get-text-property returns nil only when the point given
as argument has not yet been displayed.
So, I can reproduce it each time I close and reopen the file. (C-x C-v
RET)
Is this normal or is it a bug?
If it's normal, is there any way to force the text properties to be
set the way they will be set when the point is displayed?
I mean: I just want (get-text-property 2400 'face) to return the text
property whether it has already been displayed or not!
I tried the following which works more or less:
M-: (progn (goto-char 2400) (sit-for 0) (get-text-property
2400 'face))
=> font-lock-comment-face
but, if I use it inside my personal search and replace function, the
text is continuously scrolled all over the file, which is quite
disturbing.
I also tried M-x font-lock-fontify-buffer but it did not change
anything.
And there is no lazy-font anymore in the emacs I use.
Thanks in advance
)jack(