From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: When are the face text properties actually set? Date: Wed, 13 Jun 2012 11:18:28 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1339600817 12561 80.91.229.3 (13 Jun 2012 15:20:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jun 2012 15:20:17 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 13 17:20:16 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SepMl-0005VO-5l for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Jun 2012 17:20:15 +0200 Original-Received: from localhost ([::1]:36009 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SepMk-0004e2-Vl for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Jun 2012 11:20:14 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe21.iad.POSTED!00000000!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) Cancel-Lock: sha1:AHX33zeC67ijFNEwU2EnQBDO2f8= Original-Lines: 26 Original-X-Complaints-To: abuse@UsenetServer.com Original-NNTP-Posting-Date: Wed, 13 Jun 2012 15:18:29 UTC X-Received-Bytes: 1640 Original-Xref: usenet.stanford.edu gnu.emacs.help:192826 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85229 Archived-At: > Is this normal or is it a bug? It's normal: this is handled by jit-lock which adds the property on the fly before a chunk of text is displayed. > 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? Yes, you can use something like jit-lock-fontify-now. > 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 Rather than check the `face' property for `font-lock-comment-face' you should check the output of (syntax-ppss), which also has the advantage of not depending on highlighting (so you don't need to fiddle with jit-lock or worry about those users who disable font-lock). Stefan