unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [bug] python-mode, jit-lock, syntax-pss during file load
@ 2004-06-11 15:16 Karl Chen
  2004-06-21 17:04 ` Dave Love
  0 siblings, 1 reply; 4+ messages in thread
From: Karl Chen @ 2004-06-11 15:16 UTC (permalink / raw)



(syntax-ppss) doesn't work correctly at file load when
font-lock-support-mode is 'jit-lock-mode.

Symptom: when (re)loading a python file whose initial contents
look like:

'''   ...  '
blah1:
  blah2

'''

If jit-lock-mode is on, then python-mode guesses python-indent of
2 because it thinks "blah1:" is not in a string.

If you evaluate (python-guess-indent) after the file has loaded,
it returns 4.  It only returns 2 while the file is loading.  (It
was annoying that python-guess-indent returns different results
when debugging is enabled!)

Other font lock support modes (or no font lock) might also have
problems.  I think the fix is to force syntaxification/
fontification before python-guess-indent is called.





-- 
Karl 2004-06-11 17:07

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [bug] python-mode, jit-lock, syntax-pss during file load
  2004-06-11 15:16 [bug] python-mode, jit-lock, syntax-pss during file load Karl Chen
@ 2004-06-21 17:04 ` Dave Love
  2004-06-22  8:43   ` another jit-lock bug Karl Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Love @ 2004-06-21 17:04 UTC (permalink / raw)
  Cc: Emacs Developement List

Karl Chen <quarl@hkn.eecs.berkeley.edu> writes:

> Other font lock support modes (or no font lock) might also have
> problems.

Proper handling of quotes definitely depends on font-lock
(unfortunately).

> I think the fix is to force syntaxification/
> fontification before python-guess-indent is called.

At that stage, I guess it's only necessary to
font-lock-fontify-syntactically-region up to the limit that it checks
for the indent.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* another jit-lock bug
  2004-06-21 17:04 ` Dave Love
@ 2004-06-22  8:43   ` Karl Chen
  2004-06-24  3:04     ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Karl Chen @ 2004-06-22  8:43 UTC (permalink / raw)



emacs -q

(global-set-key "\r" (lambda () (interactive) (newline) (indent-according-to-mode)))
(global-font-lock-mode)
(setq font-lock-support-mode 'jit-lock-mode)

C-x C-f /tmp/a.sh

if true ; then
    # when you press return here, auto indent succeeds
fi

case z in
    asdf)
# auto indent fails here only when font-lock-support-mode is
# jit-lock-mode, using (indent-according-to-mode) as part of an
# interactive key (if you manually evaluate
# (indent-according-to-mode) it works)




-- 
Karl 2004-06-22 01:39

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: another jit-lock bug
  2004-06-22  8:43   ` another jit-lock bug Karl Chen
@ 2004-06-24  3:04     ` Richard Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2004-06-24  3:04 UTC (permalink / raw)
  Cc: quarl+dated+1088325557.3e362f

Is anyone looking at this bug report?
I don't know the code in jit-lock at all.

Gerd, can you look at it?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-06-24  3:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-11 15:16 [bug] python-mode, jit-lock, syntax-pss during file load Karl Chen
2004-06-21 17:04 ` Dave Love
2004-06-22  8:43   ` another jit-lock bug Karl Chen
2004-06-24  3:04     ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).