jed-users mailing list

[2005 Date Index] [2005 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: highlight rule in every mode


On 16.08.05, Dave Kuhlman wrote:
> On Tue, Aug 16, 2005 at 05:08:56PM +0000, Joerg Sommer wrote:
> > "John E. Davis" <davis@xxxxxxxxxxxxx> wrote:
> > > Joerg Sommer <joerg@xxxxxxxxxxxx> wrote:
> > >>is it possible to have an highlighting rule in every mode? I would like
> > >>to see trailing whitespaces everywhere. Do I need to patch every mode to
> > >>support trailing_whitespace?
> > >
> > > Using:
> > >
> > >    Highlight_Trailing_Whitespace = 1;
> > >
> > > in your .jedrc file should have this effect.
> > 
> > Does this work with dfa highlighting? I think no. If I enable dfa systax
> > highlighting, the trailing whitespaces aren't marked.

So it seems like you have to patch all (relevant) modes that use DFA
highlighting by adding a "trailing whitespace rule" (get them e.g. with
grep use_dfa_syntax `locate *.sl`).
 
> This leads to yet more questions:
> 
> 1. Should I be using dfa syntax/highlighting?  Why?   Jörg seems to
>    be right.  I called "use_dfa_syntax(1);", and trailing spaces
>    are no longer highlighted.  I thought I was using dfa syntax
>    highlighting.  Should I have it turned on my default? Why?  How
>    do I do that?
> 
>    I don't see any option in the ./configure file or any default
>    in the sample jedrc.

You can (must?) turn dfa highlighting on/off separately for every mode.
DFA has more powers but some pitfalls, your mileage may vary. Normally,
the default set by the mode's author should be best but can be overridden
in a mode_hook. 
 
> 3. How do I generate the DFA syntax table for a single file.  I'd
>    like to do this for a .sl file in my personal jed directory.

Normally, this is not necessary, the syntax table is cached when the file
is evaluated the first time, if it contains a line like

   dfa_enable_highlight_cache("ch_table.dfa", mode);

.

I am not sure, whether the caching mechanism is "intelligent" (i.e.
knows whether a file has changed more recently than the cache like the
.sl/.slc byte compiling mechanism with evalfile()). 

I suppose you have to delete outdated cache files by hand. (Find them in
the directories given in Jed_Highlight_Cache_Path). Also make sure you
have writing permission to Jed_Highlight_Cache_Dir.

 
> 4. I notice that when I run "jed -batch -n -l preparse" in my
>    jed/lib directory, it generates .dfa files for some modes
>    listed in preparse.sl, but not for others.  For example, it
>    generates pymode.dfa, but not perl.dfa, even though perl.sl
>    and other files listed in preparse.sl) seems to have code for
>    syntax tables.  Why is that?

preparse.sl does some checks on the files before attempting to (re)create
the dfa cache file. perl.sl doesnot pass these tests, as the dfa seems
currently out of use.

Guenter

-- 
G.Milde web.de

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2005 date index] [2005 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]