all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: jack-mac <duthen.mac@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: When are the face text properties actually set?
Date: Thu, 14 Jun 2012 01:40:32 -0700 (PDT)	[thread overview]
Message-ID: <efc290cc-262e-4abd-a37f-8ba8545dbd0c@v9g2000vbc.googlegroups.com> (raw)
In-Reply-To: jwvwr3b8cq1.fsf-monnier+gnu.emacs.help@gnu.org

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 <monn...@iro.umontreal.ca> 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


  parent reply	other threads:[~2012-06-14  8:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-13 14:32 When are the face text properties actually set? jack-mac
2012-06-13 15:18 ` Stefan Monnier
2012-06-14  7:43   ` jack-mac
2012-06-14  8:40   ` jack-mac [this message]
2012-06-14 19:16     ` Stefan Monnier
2012-06-18  9:17       ` jack-mac
2012-06-13 15:39 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=efc290cc-262e-4abd-a37f-8ba8545dbd0c@v9g2000vbc.googlegroups.com \
    --to=duthen.mac@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.