Lisp HUG Maillist Archive

Syntax coloring - how to trigger a recalculate? (possibly Win32-specific)


I observe that the syntax coloring doesn't always recalculate when a
comment tag is put around code, or removed.  This IS recalculated when
you "space" or "Tab" the front of the line, or File->Save (from the
menu, not Emacs keys) the file after a modification is made.

Is there a command to trigger recalculation of the syntax highlighting? 
(Needing File-Save is cumbersome).  Should I ask for this to be looked
at as a bug?


Easy to test:  In a new buffer, save the buffer to SomeName.lisp  (.lisp
extension is important)

Type

(foo)

Notice color
Then comment it out with #|  |# comment

#|
(foo)
|#

Notice color.  Now on the top menu, File -> Save
Notice color
Type a space in front of the (foo).
Notice color

Now remove the comment markers:

(foo)

Notice color

On the top menu, File -> Save
Notice color
Type a #\space in front of the (foo) - notice the color.


At least some of this should show an uncommented form that is
comment-colored.


Thanks,
Matt


Re: Syntax coloring - how to trigger a recalculate? (possibly Win32-specific)

On Thu, Aug 5, 2010 at 10:01 PM, Matt Lamari <matt.lamari@gmail.com> wrote:
> I observe that the syntax coloring doesn't always recalculate when a
> comment tag is put around code, or removed.  This IS recalculated when
> you "space" or "Tab" the front of the line, or File->Save (from the
> menu, not Emacs keys) the file after a modification is made.

Tab doesn't always trigger recoloring either.  Try this:  open a new
file and enter several lines of text, e.g.,

this is
a multi-line
string

and then put double-quotes before and after it (in that order):

"this is
a multi-line
string"

The last line (i.e., "string\"") is colored as a string, but the first
two lines aren't, and hitting Tab at the beginning of those lines
doesn't recolor, but Space will.  I wouldn't be surprised if it's just
because Tab doesn't, in this situation, cause any of the text to
change position.

-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/


Re: Syntax coloring - how to trigger a recalculate? (possibly Win32-specific)

Hi.

The menu command Works | Refresh seems to recalculate the highlighting.

Simon


Matt Lamari wrote on 2010-08-06 03:01:
I observe that the syntax coloring doesn't always recalculate when a
comment tag is put around code, or removed.  This IS recalculated when
you "space" or "Tab" the front of the line, or File->Save (from the
menu, not Emacs keys) the file after a modification is made.

Is there a command to trigger recalculation of the syntax highlighting? 
(Needing File-Save is cumbersome).  Should I ask for this to be looked
at as a bug?


Easy to test:  In a new buffer, save the buffer to SomeName.lisp  (.lisp
extension is important)

Type

(foo)

Notice color
Then comment it out with #|  |# comment

#|
(foo)
|#

Notice color.  Now on the top menu, File -> Save
Notice color
Type a space in front of the (foo).
Notice color

Now remove the comment markers:

(foo)

Notice color

On the top menu, File -> Save
Notice color
Type a #\space in front of the (foo) - notice the color.


At least some of this should show an uncommented form that is
comment-colored.


Thanks,
Matt


  

Updated at: 2020-12-10 08:39 UTC