Update on vim's fvwm syntax file

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Update on vim's fvwm syntax file

Thomas Adam
Hello, all -

I hope this is the correct list to send this to.  I've recently been
updating the syntax file for fvwm -- it was a little old, and hopefully
my changes to it have brought it in line with the current unstable
release of fvwm.

You can find it here:

http://edulinux.homeunix.org/fvwm.vim

If you'd prefer a patch, let me know.

-- Thomas Adam.


       
       
               
___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
Reply | Threaded
Open this post in threaded view
|

Re: Update on vim's fvwm syntax file

Haakon Riiser
Thomas,

> I hope this is the correct list to send this to.  I've recently been
> updating the syntax file for fvwm -- it was a little old, and hopefully
> my changes to it have brought it in line with the current unstable
> release of fvwm.
>
> You can find it here:
>
> http://edulinux.homeunix.org/fvwm.vim
>
> If you'd prefer a patch, let me know.

No, that's okay, in this case I actually prefer to get the
whole file.

I haven't looked at your changes in detail yet, but I noticed that
you highlight a couple of key names.  I don't want to do that,
because if you're going to highlight some syntax group, you should
highlight /all/ elements of that group.  (I find it confusing when
only some elements are highlighted.)  In this case, that could mean
parsing keysymdefs.h (like I do with colors and rgb.txt), but that
still won't be complete since it doesn't include "normal" keys like
letters and digits.  And if we were to do this, we shouldn't
highlight key names without looking at the context, since that would
clearly highlight a lot of things incorrectly as key names.

If you are up to the task, please go ahead and implement special
patterns for each command that takes key names as arguments, and
apply key highlighting to those arguments -- it would be a great
improvement.  I'd normally do this myself, but I don't feel like
putting that much work into highlighting something as volatile as a
configuration file language; it changes too often. :-/

Btw, one question:  Why have you included lines such as

  syn region fvwm
  syn keyword fvwmKeyword

?  There are no start/end patterns or keywords, so what do they do?

--
 Haakon
Reply | Threaded
Open this post in threaded view
|

Re: Update on vim's fvwm syntax file

Thomas Adam
--- Haakon Riiser <[hidden email]> wrote:

> I haven't looked at your changes in detail yet, but I noticed that
> you highlight a couple of key names.  I don't want to do that,
> because if you're going to highlight some syntax group, you should
> highlight /all/ elements of that group.  (I find it confusing when

Can you provide an example?


> only some elements are highlighted.)  In this case, that could mean
> parsing keysymdefs.h (like I do with colors and rgb.txt), but that

Yes, you're right when you say it won't be complete.  The Keysym
definitions were not my main concern -- but it was something that I
noticed was still missing.  You had "Left", "Right", "up", "Down"
hilighted along with that -- adding the F1-12 function keys didn't seem
that unreasonable, but it won't hilight other key definitions without
more complex matching patterns.

> still won't be complete since it doesn't include "normal" keys like
> letters and digits.  And if we were to do this, we shouldn't
> highlight key names without looking at the context, since that would
> clearly highlight a lot of things incorrectly as key names.

Yes.

> If you are up to the task, please go ahead and implement special
> patterns for each command that takes key names as arguments, and
> apply key highlighting to those arguments -- it would be a great
> improvement.  I'd normally do this myself, but I don't feel like
> putting that much work into highlighting something as volatile as a
> configuration file language; it changes too often. :-/

It doesn't change that often -- all that really happens is that new
Style keywords are added.  The big difference that's changed (and
hopefully added) was the batch of FP* commands.

> Btw, one question:  Why have you included lines such as
>
>   syn region fvwm
>   syn keyword fvwmKeyword

An oversight onmy part.  I will certainly look at hilighting key names
in a more comprehensive context.

-- Thomas Adam.


               
___________________________________________________________
How much free photo storage do you get? Store your holiday
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
Reply | Threaded
Open this post in threaded view
|

Re: Update on vim's fvwm syntax file

Haakon Riiser
Thomas,

>> I haven't looked at your changes in detail yet, but I noticed that
>> you highlight a couple of key names.  I don't want to do that,
>> because if you're going to highlight some syntax group, you should
>> highlight /all/ elements of that group.  (I find it confusing when
>
> Can you provide an example?

An example of what?  Of what might be confusing?  If so, it's very
easy to come up with an example -- take key names, as we are
discussing here.  Unless one knows that the syntax highlighting is
incomplete, having some keys highlighted, and others not, will often
confuse the user into thinking that the missing highlighting is
caused by an error on their part, and not an incomplete syntax file.

>> only some elements are highlighted.)  In this case, that could mean
>> parsing keysymdefs.h (like I do with colors and rgb.txt), but that
>
> Yes, you're right when you say it won't be complete.  The Keysym
> definitions were not my main concern -- but it was something that I
> noticed was still missing.  You had "Left", "Right", "up", "Down"
> hilighted along with that -- adding the F1-12 function keys didn't seem
> that unreasonable, but it won't hilight other key definitions without
> more complex matching patterns.

Left/Right/Up/Down are highlighted because they mean something else
in a different context.  Left/Right are used for button placement in
menus, but Up/Down do not seem to exist anymore in fvwm 2.4.
Again, it is a flaw to highlight these names without regard
for context, but as I said, I was too lazy to do it right. :-)

Fvwm.vim should really be rewritten from scratch -- many people
have mailed me regarding improvments, and a couple of people
offered to take over maintaining the file.  I gladly accepted, but
I never heard anything from them after, so I'm still maintaining
it.  (Although, the only thing I have done in the last four years
is to apply a patch from David Necas to make it work with 2.4.)

--
 Haakon