Subject: CVS migo: * tabify only the leading spaces, untabify the middle of line

From: FVWM CVS <[email-masked]>
Date: Wed, 26 Jun 2002 08:42:53 -0500

CVSROOT:	/home/cvs/fvwm
Module name:	fvwm
Changes by:	migo	02/06/26 08:42:53

Modified files:
	.              : ChangeLog acconfig.h 
	fvwm           : add_window.c add_window.h bindings.c bindings.h 
	                 borders.c borders.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.c 
	                 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 expand.c externs.h 
	                 focus.c focus.h frame.c frame.h functable.c 
	                 functable.h functions.c functions.h fvwm.c 
	                 fvwm.h geometry.c geometry.h gnome.c gnome.h 
	                 icccm2.c icccm2.h icons.c icons.h menucmd.c 
	                 menudim.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.c 
	                 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 
	                 style.h template.c template.h update.c update.h 
	                 virtual.c virtual.h window_flags.h windowlist.c 
	                 windowlist.h windowshade.c 
	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.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 DragAndDropTypes.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:
* tabify only the leading spaces, untabify the middle of line

--
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: Wed, 26 Jun 2002 14:00:06 +0000

> * tabify only the leading spaces, untabify the middle of line

I used these 2 commands:

  # untabify all first
  % perl -pi -e 'while (s/\t+/" " x (length($&)*8 - length($`)%8)/e) {}' `find . -name '*.[ch]'`

  # tabify only leading spaces
  % perl -pi -e 'while (s#^ {8,}#("\t" x (length($&)/8)) . (" " x (length($&)%8))#e) {}' `find . -name '*.[ch]'`

As usual doing such automatical replacement may cause some problems,
but at least the code now should be more correct than before this commit.

Regards,
Mikhael.