Re: Menu Title patch

2006-02-15 Thread Dominik Vogt
On Tue, Feb 14, 2006 at 07:27:55PM +0100, Viktor Griph wrote:
 On Thu, 9 Feb 2006, Dominik Vogt wrote:
 I have applied the patch with some changes and bugfixes:
 
  * The text of the menuitem is always drawn in the given colour
set (this required a bugfix in the text drawing library).
 
 I don't think this should be done if no colorset is specified for the 
 title. In that case I belive it should use the color of the normal items, 
 or old configs using other color than black will get a black title color.

That's exactly what I said (or maybe wanted to say).  Currently:

  * No TitleColorset given - normal item colours are used.
  * TitleColorset given - foreground of cs is used.
  * TitleColorset and HilightTitleBack given - foreground and
background of cs ase used.

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [EMAIL PROTECTED]


signature.asc
Description: Digital signature


Re: Comments

2006-02-15 Thread Dominik Vogt
On Tue, Feb 14, 2006 at 09:10:09PM +0100, Viktor Griph wrote:
 Right now
 Style * Colorset 1 #, HilightColorset 2
 is the same as
 Style * Colorset 1, HilightColorset 2
 i.e. the # is simply ignored, which is somewhat correct according to the 
 man page.

In-line comments were never meant to work anyway.

 However most users familiar with shell-scripts and perl scripts 
 would think that the end of the first line is a comment, also the fact 
 that fvwm does not warn about ignoring unused arguments to style parts 
 makes it really hard to spot such a misstake in a config file. (I actually 
 didn't know that fvwm-comments had to start on the first character of a 
 line until I looked it up in the man page right now. (and the emacs mode 
 does not deal with that either ;)))

 However, it's not entierly sure that commetns only start on the beginning 
 of a line, but they can also be before any command in stacked commands.

No, not in the way you may think.  In that case they are taken as
part of the command and the '#' eventually becomes the first
character of a command line and is interpreted as a comment.  They
*do not* comment out the rest of the line in which they occured.

 This in all can confuse some users (me included) alot. I think it would be 
 good to think over the comment syntax, and maybe extend it to allow end of 
 line comments as well. Since this would beak config file compability (if 
 someone actually needs a '#' somewhere in the config file that is not on 
 the beginning of line (s)he would have to escape it) it will have to 
 wait until after 2.6 is realeased.

I don't think that's a good idea at all.  People who think that
fvwm syntax is shell syntax are going to have a problem anyway.
Fvwm's command line parser is undoubtedly strange, and I always
had a vague plan to clean up parsing and command syntax radically
in 3.0.  It would be nice to have a real parser, maybe leveraged
from zsh.  Worrying just about comment syntax won't take us
anywhere.

 Thoughts?
 
 One thing that probably can be done now, without to mush effort would be 
 to add a warning for unconsumed non-whitespace characters following style 
 options. It would also trap missing commas.

Yes, that wouldn't hurt.

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [EMAIL PROTECTED]


signature.asc
Description: Digital signature


Re: Menu Title patch

2006-02-15 Thread Viktor Griph

On Wed, 15 Feb 2006, Dominik Vogt wrote:


On Wed, Feb 15, 2006 at 09:25:11AM +0100, Viktor Griph wrote:

On Wed, 15 Feb 2006, Dominik Vogt wrote:


On Tue, Feb 14, 2006 at 07:27:55PM +0100, Viktor Griph wrote:

On Thu, 9 Feb 2006, Dominik Vogt wrote:

I have applied the patch with some changes and bugfixes:

* The text of the menuitem is always drawn in the given colour
 set (this required a bugfix in the text drawing library).


I don't think this should be done if no colorset is specified for the
title. In that case I belive it should use the color of the normal items,
or old configs using other color than black will get a black title color.


That's exactly what I said (or maybe wanted to say).  Currently:

* No TitleColorset given - normal item colours are used.
* TitleColorset given - foreground of cs is used.
* TitleColorset and HilightTitleBack given - foreground and
  background of cs ase used.


In that case it's not working, because I don't have a TitleColorset, and
my menu title is black, while the rest of the items are khaki.


Works perfectly for me.  Can you post an example config that shows
the problem?


Just the following is ennough:

Colorset 0 fg khaki,bg rgb:dd/00/00
MenuStyle * MenuColorset 0


/Viktor



Re: Menu Title patch

2006-02-15 Thread Dominik Vogt
On Wed, Feb 15, 2006 at 09:46:45AM +0100, Viktor Griph wrote:
 On Wed, 15 Feb 2006, Dominik Vogt wrote:
 
 On Wed, Feb 15, 2006 at 09:25:11AM +0100, Viktor Griph wrote:
 On Wed, 15 Feb 2006, Dominik Vogt wrote:
 
 On Tue, Feb 14, 2006 at 07:27:55PM +0100, Viktor Griph wrote:
 On Thu, 9 Feb 2006, Dominik Vogt wrote:
 I have applied the patch with some changes and bugfixes:
 
 * The text of the menuitem is always drawn in the given colour
  set (this required a bugfix in the text drawing library).
 
 I don't think this should be done if no colorset is specified for the
 title. In that case I belive it should use the color of the normal 
 items,
 or old configs using other color than black will get a black title 
 color.
 
 That's exactly what I said (or maybe wanted to say).  Currently:
 
 * No TitleColorset given - normal item colours are used.
 * TitleColorset given - foreground of cs is used.
 * TitleColorset and HilightTitleBack given - foreground and
   background of cs ase used.
 
 In that case it's not working, because I don't have a TitleColorset, and
 my menu title is black, while the rest of the items are khaki.
 
 Works perfectly for me.  Can you post an example config that shows
 the problem?
 
 Just the following is ennough:
 
 Colorset 0 fg khaki,bg rgb:dd/00/00
 MenuStyle * MenuColorset 0


Fixed.

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [EMAIL PROTECTED]


signature.asc
Description: Digital signature


CVS griph: * warn on unconsumed arguments to style options

2006-02-15 Thread FVWM CVS
CVSROOT:/home/cvs/fvwm
Module name:fvwm
Changes by: griph   06/02/15 14:17:55

Modified files:
.  : ChangeLog NEWS 
fvwm   : style.c 

Log message:
* warn on unconsumed arguments to style options




Re: Comments

2006-02-15 Thread Viktor Griph

On Wed, 15 Feb 2006, Bert 'theBlackDragon' Geens wrote:


On 2/14/06, Viktor Griph [EMAIL PROTECTED] wrote:

(and the emacs mode
does not deal with that either ;)))


I don't know if you're using my emacs mode or the old one that's
floating about the web, but I've fixed mine so it only higlights start
of line comments. I'm not sure if it's allowed to have those preceded
by spaces though, so if somebody could tell me that I'd be very
grateful.


Comments are allowed to be preceded by spaces.


The mode I'm talking about is this one btw:
http://www.lair.be/projects_fvwm-mode.php

If you would know of a better or more up to date one, please do tell
me as I haven't manage to find any (only a very old one that I didn't
really like).

I've actually been using a havily modified version [1] of that old mode, 
but I tested your mode before stating that the emacs mode didn't hilight 
comments correctly (to be on the safe side ;)).


I've not posted it before since you posted your mode inbetween my start of
adopting it for 2.5 and it being in somewhat working mode. Also I hadn't 
done anything in emacs lisp prior to that, so it's not very well written 
(and it's possible to follow my own evolving in the knowledge of emacs 
lisp by looking through how the coding style evolves in that file.)


It only has support for config files, and not FvwmScript. It also can be a 
little slow sometimes since it's designed to be context sensitive for 
where keywords can be, and I really don't know the best way to optimize 
emacs lisp. (My brother asked me to do it for the reason that he always 
mixed up some keywords.)


The reason why I stick to this mode and don't move over to your is 
probably that I have quite a fast machine, so I don't notice slowdowns in 
the fontlocking, and more importantly: Your mode does not font-lock 
comments spanning multiple lines (with escaped newlines), which makes 
commenting out long commands highlight strangely.


The reason why I've never noticed that comments should be at start of 
commands is that I, normally always use it that way. It were just in a 
quick test I decided to try to disable the trail of a style command, and 
figured it didn't work.


/Viktor

[1] http://www.dd.chalmers.se/~griph/fvwm-mode.el.gz