From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jack-mac Newsgroups: gmane.emacs.help Subject: Re: When are the face text properties actually set? Date: Thu, 14 Jun 2012 01:40:32 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1339663521 5550 80.91.229.3 (14 Jun 2012 08:45:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 14 Jun 2012 08:45:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 14 10:45:21 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 1Sf5g2-0003ep-2y for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Jun 2012 10:45:14 +0200 Original-Received: from localhost ([::1]:52041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sf5g1-00082w-SC for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Jun 2012 04:45:13 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!v9g2000vbc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 55 Original-NNTP-Posting-Host: 193.49.124.107 Original-X-Trace: posting.google.com 1339663341 17972 127.0.0.1 (14 Jun 2012 08:42:21 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 14 Jun 2012 08:42:21 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v9g2000vbc.googlegroups.com; posting-host=193.49.124.107; posting-account=OWLhBgoAAAD1H7ELDXVfr3-5BJaMOe1v User-Agent: G2/1.0 X-HTTP-Via: 1.1 miaouuuuuuu:3131 (squid/2.7.STABLE4) X-HTTP-UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:10.0) Gecko/20100101 Firefox/10.0,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:192834 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:85236 Archived-At: Oops! Sorry for the previous (possibly not deleted) post, sent before finished. I should not use emacs shortcuts inside firefox... Thanks a lot, Stefan, for your precious answers! On 13 juin, 17:18, Stefan Monnier wrote: > It's normal: this is handled by jit-lock which adds the property on > the fly before a chunk of text is displayed. I did not know jit-mode. Is it recent? Does it replace lazy-lock? When I start "emacs -Q .emacs", for example, I get the following: M-: jit-lock-mode => t M-: (memq 'jit-lock-mode minor-mode-list) => nil Can you tell me why jit-lock-mode does not appear in the list of minor modes? > > 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 Thanks! It's very simple and fast enough for my function, but... > 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). Well, to answer Eli's question (why do I need that), I would say that checking the text-properties was the solution I imagined to determine whether the point is inside a string or a comment, for example. Now, Stefan tells me there is an API to the syntactic parser. Woah! It's like opening a door to a rich and exciting new world! I took a look at syntax-ppss and parse-partial-sexp documentation. It says it parses *Lisp* syntax. Is it a bug in the documentation? Before I go any further in the tests and doc (which is far for being perfectly clear to me, at first glance!), can you tell me if I can use it in other modes than emacs-lisp, like C-like modes, for example? Actually, I'm currently working on shell scripts (in sh-mode[pdksh]). Does it handle the whole syntax: "..." '...' `...` {...} [...] [[...]] $(...) etc? Thanks in advance