Subject: CVS domivogt: * Fixed colourmap focus problem.

From: FVWM CVS <[email-masked]>
Date: Tue, 18 Jun 2002 05:52:27 -0500

CVSROOT:	/home/cvs/fvwm
Module name:	fvwm
Changes by:	domivogt	02/06/18 05:52:27

Modified files:
	.              : ChangeLog NEWS acconfig.h 
	bin            : fvwm-root.c 
	fvwm           : bindings.c bindings.h builtins.c builtins.h 
	                 colormaps.c colormaps.h colors.c colors.h 
	                 colorset.c colorset.h commands.h conditional.c 
	                 conditional.h cursor.c cursor.h decorations.h 
	                 events.c events.h ewmh.c ewmh.h ewmh_conf.c 
	                 ewmh_events.c ewmh_icons.c ewmh_intern.h 
	                 ewmh_names.c externs.h focus.c frame.c frame.h 
	                 functions.c functions.h fvwm.1 fvwm.c 
	                 geometry.c geometry.h gnome.c gnome.h icccm2.c 
	                 icccm2.h icons.c icons.h menucmd.c menudim.h 
	                 menuitem.c menuitem.h menus.c menus.h 
	                 menustyle.c menustyle.h misc.c misc.h modconf.c 
	                 modconf.h module_interface.h move_resize.c 
	                 move_resize.h placement.c placement.h read.c 
	                 repeat.c repeat.h schedule.c schedule.h 
	                 screen.h session.c session.h stack.c stack.h 
	                 style.c update.c update.h virtual.c virtual.h 
	                 windowlist.c windowlist.h 
	libs           : Bindings.c ClientMsg.c ClientMsg.h ColorUtils.c 
	                 Colorset.c Colorset.h Cursor.c Event.c FBidi.c 
	                 FBidi.h FRender.c FRender.h FRenderInit.c 
	                 FRenderInit.h FRenderInterface.h FScreen.c 
	                 FScreen.h FShape.c FShape.h Fft.c Fft.h 
	                 FftInterface.h Ficonv.c Ficonv.h Flocale.c 
	                 Flocale.h FlocaleCharset.c FlocaleCharset.h 
	                 Fpng.h Fxpm.h Grab.c Grab.h Graphics.c Module.c 
	                 Module.h Parse.c Parse.h Picture.c Picture.h 
	                 PictureBase.c PictureBase.h PictureGraphics.c 
	                 PictureGraphics.h PictureImageLoader.c 
	                 PictureImageLoader.h Pointer.c Strings.c 
	                 Strings.h System.c Target.c WinMagic.c XError.c 
	                 XResource.c alloca.c atexit.c debug.c 
	                 defaults.h envvar.c envvar.h fvwmlib.h 
	                 fvwmrect.c fvwmrect.h fvwmsignal.c fvwmsignal.h 
	                 gethostname.c gravity.h lang-strings.h queue.c 
	                 queue.h safemalloc.c safemalloc.h setpgrp.c 
	                 setpgrp.h strcasecmp.c strdup.c strerror.c 
	                 strncasecmp.c usleep.c vpacket.h wild.c wild.h 
	modules/FvwmAnimate: FvwmAnimate.c FvwmAnimate.h 
	modules/FvwmAuto: FvwmAuto.c 
	modules/FvwmBacker: FvwmBacker.c FvwmBacker.h root_bits.c 
	modules/FvwmBanner: FvwmBanner.c 
	modules/FvwmButtons: FvwmButtons.c FvwmButtons.h button.c 
	                     button.h draw.c draw.h icons.c icons.h 
	                     misc.c misc.h output.c parse.c parse.h 
	modules/FvwmCommand: FvwmCommand.c FvwmCommand.h FvwmCommandS.c 
	modules/FvwmConsole: FvwmConsole.c FvwmConsole.h FvwmConsoleC.c 
	                     getline.c 
	modules/FvwmCpp: FvwmCpp.c FvwmCpp.h 
	modules/FvwmDebug: FvwmDebug.c FvwmDebug.h 
	modules/FvwmDragWell: commonStuff.h cursorStuff.c cursorStuff.h 
	                      dragSource.h fvwmDragWell.c fvwmDragWell.h 
	                      xdndDragSource.c 
	modules/FvwmEvent: FvwmEvent.c 
	modules/FvwmForm: FvwmForm.c FvwmForm.h ParseCommand.c 
	                  ReadXServer.c 
	modules/FvwmGtk: FvwmGtk.c dialog.c expand.c expand.h 
	                 gtkpixmapmenuitem.c gtkpixmapmenuitem.h menu.c 
	                 menu.h windowlist.c windowlist.h 
	modules/FvwmIconBox: FvwmIconBox.c FvwmIconBox.h icons.c 
	modules/FvwmIconMan: FvwmIconMan.c FvwmIconMan.h debug.c debug.h 
	                     debuglevels.h functions.c fvwm.c globals.c 
	                     readconfig.c readconfig.h winlist.c x.c x.h 
	                     xmanager.c xmanager.h 
	modules/FvwmIdent: FvwmIdent.c FvwmIdent.h 
	modules/FvwmM4 : FvwmM4.c FvwmM4.h 
	modules/FvwmPager: FvwmPager.c FvwmPager.h x_pager.c 
	modules/FvwmRearrange: FvwmRearrange.c 
	modules/FvwmSave: FvwmSave.c FvwmSave.h 
	modules/FvwmSaveDesk: FvwmSaveDesk.c FvwmSaveDesk.h 
	modules/FvwmScript: FvwmScript.c Instructions.c scanner.c 
	                    script.c script.h types.h 
	modules/FvwmScript/Widgets: CheckBox.c HDipstick.c HScrollBar.c 
	                            ItemDraw.c List.c Menu.c 
	                            MiniScroll.c PopupMenu.c 
	                            PushButton.c RadioButton.c 
	                            Rectangle.c Swallow.c TextField.c 
	                            Tools.c Tools.h VDipstick.c 
	                            VScrollBar.c Widget.c 
	modules/FvwmScroll: FvwmScroll.c FvwmScroll.h GrabWindow.c 
	modules/FvwmTaskBar: ButtonArray.c ButtonArray.h Colors.c 
	                     Colors.h FvwmTaskBar.c FvwmTaskBar.h 
	                     Goodies.c Goodies.h List.c List.h Mallocs.c 
	                     Mallocs.h Start.c Start.h 
	modules/FvwmTheme: FvwmTheme.c 
	modules/FvwmWharf: FvwmWharf.c Wharf.h icons.c stepgfx.c 
	                   stepgfx.h 
	modules/FvwmWharf/ASSound: ASSound.c 
	modules/FvwmWharf/OffiX: DragAndDrop.h 
	modules/FvwmWinList: ButtonArray.c ButtonArray.h FvwmWinList.c 
	                     FvwmWinList.h List.c List.h Mallocs.c 
	                     Mallocs.h 
	tests/hints    : hints_test.c 
	utils          : xselection.c 
	vms            : config.h vms.c vms.h 

Log message:
* Fixed colourmap focus problem.
* MoveTo{Page,Desk} does not unstick.
* Tabified all sources and removed trailing spaces.

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Olivier Chapuis <[email-masked]>
Date: Wed, 19 Jun 2002 17:57:48 +0200

> * Tabified all sources and removed trailing spaces.

Dominik, do you use a tool to automatically reindent the code?
If yes, which one (with the version)?
Also we may try to all share a common (x)emacs config about
indentation. Some problems:
- the position of the args of a function when the function does
not fit on one line (80 column).
- To get the Tab key automatically indent lines I can have
tabs only at the beginning of a line. So I cannot have:
foo[] = {"abc",\t"xyz",\t"blabla"}
- Really I like tabs with a width of 8 spaces, but for the first tab.
I think that the first tab should be something like 2 or 3 spaces
(I think this is possible with (x)emacs).

Olivier

PS: my .emacs config for ccmode 5.25:

(add-hook 'c-mode-hook (lambda ()
	(setq c-indent-level 8)
	(setq c-basic-offset 8)
	(c-set-offset 'substatement-open 0)
	(setq c-brace-offset 0)
	(setq c-continued-brace-offset 0)
	(setq c-brace-imaginary-offset 0)
	(setq c-continued-statement-offset 0)
	(setq c-label-offset 0)
	(setq c-argdecl-indent 0)
	(setq c-auto-newline nil)
	(setq c-tab-always-indent t)
))

---

From: Dominik Vogt <[email-masked]>
Date: Sun, 23 Jun 2002 19:37:50 +0200

> If yes, which one (with the version)?

Xemacs:

 - Go to beginning of file.
 - Set a mark.
 - Go to end of file.
 - M-x indent-region

This is eqivalent of pressing tab in each line.  Then I tabbified
all files:

 - Go to beginning of file.
 - Set a mark.
 - Go to end of file.
 - M-x tabify

> indentation.

I'd like to simply use the default config so I don't have to
change it for every project I'm working on.  I know that it's
theoretically possible to configure this differently for each
project, but I was never able to understand the way it works.

> not fit on one line (80 column).

I do the line breaks manually in this case.  With long function
names, beginning a new line right after the ofening parenthesis
saves a lot of space for on the line for the arguments.  E.g.

  blablabla_variablename = verlylongfunctionname(
          argument1, argument2, argument3);

or

  blablabla_variablename =
          verlylongfunctionname(argument1, argument2, argument3);

instead of

  blablabla_variablename = verlylongfunctionname(argument1,
                                                 argument2,
                                                 argument3);

I don't really care about which is chosen.  The code should just
be readable (the last version isn't if the argument list gets too
long; it also wastes a lot of space).  What exactly is the
problem?

> foo[] = {"abc",\t"xyz",\t"blabla"}

Huh?  Works like a charm for me.  What function is bound to your
tab key?  I have c-indent-command.

> (I think this is possible with (x)emacs).

I have recently adapted the Linux kernel coding conventions in all
the code I write (at work too).  I'm quite happy with it,
especially since I don't have to tinker with the xemacs default
configuration anymore.  Sure, it's not really important to have a
big indentation at the first position, just easier to configure.

I know it's often ugly to enforce these conventions on existing
files.  But in new code it's actually a good thing to have *less*
space on the line because it forces you to think more about the
way you write.

Mikhael, what do you think about this?

Bye

Dominik ^_^  ^_^

-- 
Dominik Vogt, email: [email-masked]
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Sun, 23 Jun 2002 20:50:20 +0000

On 23 Jun 2002 19:37:50 +0200, Dominik Vogt wrote:
> long; it also wastes a lot of space).

Not only this. When blablabla_variablename name is changed or
verlylongfunctionname name is changed and replaced everywhere, only the
first 2 syntaxes stay to be consistent, but not the last one.

I think Olivier may add (c-set-style "k&r") and avoid the last syntax.

> Mikhael, what do you think about this?

You would better not know what I think about this. :)

I don't use emacs or any other automatical indenter, only Enter and TAB.
In my projects (and in all fvwm perl programs) I use "one TAB for every
level" indentation, never spaces. I don't use TAB in the middle of line.
My code is always equally structured with any TAB size from 2 to 20.
I only see the first 80 chars of each line. For me number 80 is not
magical, lines may be longer in some cases (say for the large TAB size).
I myself use TAB size 3 or 8 (but any other value is good in my code).

At the end for C sources I adapt to your coding style without exceptions.

Regards,
Mikhael.

---

From: Olivier Chapuis <[email-masked]>
Date: Tue, 25 Jun 2002 16:49:59 +0200

On Sun, Jun 23, 2002 at 07:37:50PM +0200, Dominik Vogt wrote:
> ...

Thanks for all the explanation.

>  - Go to beginning of file.

Ooops this is a bit dangerous as in some strings which have to be
displayed in an X window spaces should not be replaced by a tab.

Olivier

---

From: Mikhael Goikhman <[email-masked]>
Date: Tue, 25 Jun 2002 19:29:14 +0000

On 25 Jun 2002 16:49:59 +0200, Olivier Chapuis wrote:
> > Then I tabbified all files:
> > 

It's not only strings; statements and comments are now full of TABs.
I would not use the emacs's tabify, TABs in the middle of line are bad.

Dominik, should I send you some lisp to insert TABs for indentation in the
fvwm dirs and spaces in other work projects, so you don't need to tabify
what you commited from the work?

Regards,
Mikhael.

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 26 Jun 2002 12:18:19 +0200

> > displayed in an X window spaces should not be replaced by a tab.

I hope we have none such strings.

> It's not only strings; statements and comments are now full of TABs.

Hm, statements and comments?  They shouldn't have more than a
single space anywhere.  When I come across any in-line formatting
I remove that anyway.  The way I format code, tabifying it is
completely safe.

> what you commited from the work?

Don't worry, it's the last day in this company anyway.

Bye

Dominik ^_^  ^_^

---

From: Dan Espen <[email-masked]>
Date: Wed, 26 Jun 2002 08:17:42 -0400

Olivier Chapuis <[email-masked]> writes:
> ... we may try to all share a common (x)emacs config about
> indentation.
...
> 	(setq c-tab-always-indent t)

Heres one way to set up emacs to work one way for FVWM and
another way for other projects:

(add-hook 'c-mode-hook 'my-c-mode-hook t)
(defun my-c-mode-hook ()
  (if (string-match "fvwm" buffer-file-name) ;fvwm project settings:
      (progn
	(setq
	 c-indent-level 8
	 c-basic-offset 8
	 c-brace-offset 0
	 c-continued-brace-offset 0
	 c-brace-imaginary-offset 0
	 c-continued-statement-offset 0
	 c-label-offset 0
	 c-argdecl-indent 0
	 c-auto-newline nil
	 c-tab-always-indent t
	 indent-tabs-mode t
	 (c-set-offset 'substatement-open 0)))
    ;; Local site default settings
    (setq 
     c-indent-level 2 ; Indent inside block
     c-basic-offset 2
     c-brace-offset 0 ; for braces, compared with other text in same context
     c-continued-brace-offset 0 ; Extra for substatements start with open-braces
     c-brace-imaginary-offset 0
     c-continued-statement-offset 2 ; For lines not starting new statements
     c-label-offset -2 ; Offset of label, case relative to usual indentation
     c-argdecl-indent 0 ; Indentation level of C function arguments
     c-auto-newline nil ; Non-nil automatically newline before and after braces
     c-tab-always-indent t
     indent-tabs-mode nil
     comment-column 40)))

This assumes that the directory you have fvwm in has the word
"fvwm" somewhere in the name.

I doubt the list of variables being set is complete,
(note a few discrepancies toward the end), and I'm not sure
the FVWM values match up to what Dominik is using.

-- 
Dan Espen                           E-mail: [email-masked]
444 Hoes Lane  Room RRC 1C-214      Phone: (732) 699-5570
Piscataway, NJ 08854
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 26 Jun 2002 14:45:55 +0200

> the FVWM values match up to what Dominik is using.

Ah, I never thought about writing conditional code in the hook.  I
tried to modify one of the "alist"s that seem to be there for that
specific purpose, but failed utterly.

Bye

Dominik ^_^  ^_^

---

From: Mikhael Goikhman <[email-masked]>
Date: Wed, 26 Jun 2002 13:29:39 +0000

> I hope we have none such strings.

Sorry, but we have a lot of such strings. XError.c, ewmh.c, fvwm.c,
session.c, stack.c, FvwmIdent.c and so on.

> I remove that anyway.  The way I format code, tabifying it is

Every GPL header now contains 2 TABs. Take a look at your paragraph above,
3 double spaces. tabify would replace some of them with TAB, then adding
"> " prefix would make the quote strewn. Diffs (with a leading "+" prefix)
look strewn on lines with TAB in the middle.

Unless tabify may be configured to only handle leading spaces, it is not
suitable for an automatic replacement.

> > I would not use the emacs's tabify, TABs in the middle of line are bad.

I will fix this in several minutes.

Regards,
Mikhael.

---

From: Dominik Vogt <[email-masked]>
Date: Sat, 29 Jun 2002 22:08:52 +0200

> I will fix this in several minutes.

Okay, thanks.  I should really have been more careful.  Just
because I can safely do that with the code I write does not mean
it's safe on all existing code, strings, comments etc.  Hm, I once
played with "indent", but it lacked the flexibity I needed.  It
would still be good to have a program that re-indents our sources
properly.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]