Re: [PATCH] tiny whitespace

2002-04-01 Thread Allan Rae

On Fri, 22 Mar 2002, Angus Leeming wrote:

  My emacs (20.7 --- bang up to date?) doesn't have them either.

Emacs-21.1 has them and a whole lot more in a whitespace.el file.
It seems to work okay with XEmacs-21.4.6 so there is some good news.

Allan. (ARRae)




Re: [PATCH] tiny whitespace

2002-04-01 Thread Allan Rae

On Fri, 22 Mar 2002, Angus Leeming wrote:

> > My emacs (20.7 --- bang up to date?) doesn't have them either.

Emacs-21.1 has them and a whole lot more in a whitespace.el file.
It seems to work okay with XEmacs-21.4.6 so there is some good news.

Allan. (ARRae)




Re: [PATCH] tiny whitespace

2002-03-22 Thread Angus Leeming

On Thursday 21 March 2002 8:16 am, Allan Rae wrote:
 On Wed, 20 Mar 2002, Lars Gullik Bjønnes wrote:
  What about:
   delete-trailing-whitespace
   whitespace-cleanup

 Actually XEmacs doesn't seem to have these (in either 21.1.14 or
 21.4.6).  Which emacs and is there a package to load first?

 I did find whitespace-mode which does a nice job of distinguishing
 spaces from tabs.  I might use it in future so silly lines which use
 spaces instead of tabs stand out.

 Allan. (ARRae)

My emacs (20.7 --- bang up to date?) doesn't have them either. However, 
google is a fabulous resourse:
gg:delete-trailing-whitespace
gives 
http://www.unixguide.net/unix/sedoneliner.shtml

# delete trailing whitespace (spaces, tabs) from end of each line 
sed 's/[ \t]*$//' # see note on '\t' at end of file

where \t is a tab.

and
gg:emacs delete-trailing-whitespace
gives
http://www.dotemacs.de/emacro/emacs/functions.html

which contains the magical expression.

So now my question becomes, how do I modify my .emacs to load this file in 
c-mode and in c++-mode and how do I follow Lars' example and have it on by 
default. Lars?

Angus



Re: [PATCH] tiny whitespace

2002-03-22 Thread Angus Leeming

On Friday 22 March 2002 6:55 pm, Angus Leeming wrote:
 On Thursday 21 March 2002 8:16 am, Allan Rae wrote:
  On Wed, 20 Mar 2002, Lars Gullik Bjønnes wrote:
   What about:
delete-trailing-whitespace
whitespace-cleanup
 
  Actually XEmacs doesn't seem to have these (in either 21.1.14 or
  21.4.6).  Which emacs and is there a package to load first?
 
  I did find whitespace-mode which does a nice job of distinguishing
  spaces from tabs.  I might use it in future so silly lines which use
  spaces instead of tabs stand out.
 
  Allan. (ARRae)

 My emacs (20.7 --- bang up to date?) doesn't have them either. However,
 google is a fabulous resourse:
   gg:delete-trailing-whitespace
 gives
   http://www.unixguide.net/unix/sedoneliner.shtml

   # delete trailing whitespace (spaces, tabs) from end of each line
   sed 's/[ \t]*$//' # see note on '\t' at end of file

 where \t is a tab.

 and
   gg:emacs delete-trailing-whitespace
 gives
   http://www.dotemacs.de/emacro/emacs/functions.html

 which contains the magical expression.

 So now my question becomes, how do I modify my .emacs to load this file in
 c-mode and in c++-mode and how do I follow Lars' example and have it on by
 default. Lars?

Partially answering my own question. To enable delete-trailing-whitespace I 
have this in my .emacs file. Note the (load functions).

That just leaves how do I turn it on by default?

;;; Common hook
(defun my-c-mode-common-hook ()
;; Enable delete-trailing-whitespace
(load functions)
;; Set return Style
(local-set-key [return] 'newline-and-indent)
(local-set-key [S-return] 'newline)
(c-set-style CC-MODE)
)
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)   

;; C++ mode hook
(defun my-c++-mode-hook ()
;; Style parameters
(setq c-basic-offset 8)
(c-set-offset 'innamespace 0)
(imenu-add-to-menubar Index)
(c-toggle-auto-state 0)
)
(add-hook 'c++-mode-hook 'my-c++-mode-hook)




Re: [PATCH] tiny whitespace

2002-03-22 Thread Angus Leeming

On Thursday 21 March 2002 8:16 am, Allan Rae wrote:
> On Wed, 20 Mar 2002, Lars Gullik Bjønnes wrote:
> > What about:
> >  delete-trailing-whitespace
> >  whitespace-cleanup
>
> Actually XEmacs doesn't seem to have these (in either 21.1.14 or
> 21.4.6).  Which emacs and is there a package to load first?
>
> I did find whitespace-mode which does a nice job of distinguishing
> spaces from tabs.  I might use it in future so silly lines which use
> spaces instead of tabs stand out.
>
> Allan. (ARRae)

My emacs (20.7 --- bang up to date?) doesn't have them either. However, 
google is a fabulous resourse:
gg:delete-trailing-whitespace
gives 
http://www.unixguide.net/unix/sedoneliner.shtml

# delete trailing whitespace (spaces, tabs) from end of each line 
sed 's/[ \t]*$//' # see note on '\t' at end of file

where \t is a tab.

and
gg:emacs delete-trailing-whitespace
gives
http://www.dotemacs.de/emacro/emacs/functions.html

which contains the magical expression.

So now my question becomes, how do I modify my .emacs to load this file in 
c-mode and in c++-mode and how do I follow Lars' example and have it on by 
default. Lars"?

Angus



Re: [PATCH] tiny whitespace

2002-03-22 Thread Angus Leeming

On Friday 22 March 2002 6:55 pm, Angus Leeming wrote:
> On Thursday 21 March 2002 8:16 am, Allan Rae wrote:
> > On Wed, 20 Mar 2002, Lars Gullik Bjønnes wrote:
> > > What about:
> > >  delete-trailing-whitespace
> > >  whitespace-cleanup
> >
> > Actually XEmacs doesn't seem to have these (in either 21.1.14 or
> > 21.4.6).  Which emacs and is there a package to load first?
> >
> > I did find whitespace-mode which does a nice job of distinguishing
> > spaces from tabs.  I might use it in future so silly lines which use
> > spaces instead of tabs stand out.
> >
> > Allan. (ARRae)
>
> My emacs (20.7 --- bang up to date?) doesn't have them either. However,
> google is a fabulous resourse:
>   gg:delete-trailing-whitespace
> gives
>   http://www.unixguide.net/unix/sedoneliner.shtml
>
>   # delete trailing whitespace (spaces, tabs) from end of each line
>   sed 's/[ \t]*$//' # see note on '\t' at end of file
>
> where \t is a tab.
>
> and
>   gg:emacs delete-trailing-whitespace
> gives
>   http://www.dotemacs.de/emacro/emacs/functions.html
>
> which contains the magical expression.
>
> So now my question becomes, how do I modify my .emacs to load this file in
> c-mode and in c++-mode and how do I follow Lars' example and have it on by
> default. Lars"?

Partially answering my own question. To enable delete-trailing-whitespace I 
have this in my .emacs file. Note the (load "functions").

That just leaves how do I turn it on by default?

;;; Common hook
(defun my-c-mode-common-hook ()
;; Enable delete-trailing-whitespace
(load "functions")
;; Set return Style
(local-set-key [return] 'newline-and-indent)
(local-set-key [S-return] 'newline)
(c-set-style "CC-MODE")
)
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)   

;; C++ mode hook
(defun my-c++-mode-hook ()
;; Style parameters
(setq c-basic-offset 8)
(c-set-offset 'innamespace 0)
(imenu-add-to-menubar "Index")
(c-toggle-auto-state 0)
)
(add-hook 'c++-mode-hook 'my-c++-mode-hook)




Re: [PATCH] tiny whitespace

2002-03-21 Thread Allan Rae


All that wonderful whitespace pissing about missed out on several
tab-spaces or even spaces-tabs conversions inside comments.

Take a look at the copyright notice in just about any file you care to
name.  I've give you an example:
src/lyxfunc.C

There are three indented lines.  One of them has a single tab the
others have spaces.  The first indented line has an extra space making
for a misalignment.

More importantly, the whitespace pissing about didn't end up aligning
the switch statements in lyxfunc.C any better than they were before.
Take a look around line 414 for example:

case LFUN_RUNCHKTEX:
disable = lyxrc.chktex_command == none;
break;
case LFUN_BUILDPROG:
disable = !Exporter::IsExportable(buf, program);
break;

No extra whitespace between cases even though that is the standard
used throughout the rest of the file.  Although there are also weird
clusters of cases near this area.

How will we live with ourselves with all these hodge-podge
coding standards that last a few hundred lines in a file of several
thousand lines?

Allan. (ARRae)




Re: [PATCH] tiny whitespace

2002-03-21 Thread John Levon

On Fri, Mar 22, 2002 at 04:06:19PM +1000, Allan Rae wrote:

 Take a look at the copyright notice in just about any file you care to
 name.  I've give you an example:
   src/lyxfunc.C

Any way, the new style header is much better and should replace all
the old variants ...

 More importantly, the whitespace pissing about didn't end up aligning

I'm glad to see that's now its official name !

 coding standards that last a few hundred lines in a file of several
 thousand lines?

Don't have stupidly large files in the first place ?

john

-- 
Way back at the beginning of time around 1970 the first man page was
 handed down from on high. Every one since is an edited copy.
- John Hasler [EMAIL PROTECTED]



Re: [PATCH] tiny whitespace

2002-03-21 Thread Allan Rae


All that wonderful whitespace pissing about missed out on several
tab->spaces or even spaces->tabs conversions inside comments.

Take a look at the copyright notice in just about any file you care to
name.  I've give you an example:
src/lyxfunc.C

There are three indented lines.  One of them has a single tab the
others have spaces.  The first indented line has an extra space making
for a misalignment.

More importantly, the whitespace pissing about didn't end up aligning
the switch statements in lyxfunc.C any better than they were before.
Take a look around line 414 for example:

case LFUN_RUNCHKTEX:
disable = lyxrc.chktex_command == "none";
break;
case LFUN_BUILDPROG:
disable = !Exporter::IsExportable(buf, "program");
break;

No extra whitespace between cases even though that is the standard
used throughout the rest of the file.  Although there are also weird
clusters of cases near this area.

How will we live with ourselves with all these hodge-podge
coding "standards" that last a few hundred lines in a file of several
thousand lines?

Allan. (ARRae)




Re: [PATCH] tiny whitespace

2002-03-21 Thread John Levon

On Fri, Mar 22, 2002 at 04:06:19PM +1000, Allan Rae wrote:

> Take a look at the copyright notice in just about any file you care to
> name.  I've give you an example:
>   src/lyxfunc.C

Any way, the new style header is much better and should replace all
the old variants ...

> More importantly, the whitespace pissing about didn't end up aligning

I'm glad to see that's now its official name !

> coding "standards" that last a few hundred lines in a file of several
> thousand lines?

Don't have stupidly large files in the first place ?

john

-- 
"Way back at the beginning of time around 1970 the first man page was
 handed down from on high. Every one since is an edited copy."
- John Hasler <[EMAIL PROTECTED]>



Re: [PATCH] tiny whitespace

2002-03-20 Thread Juergen Vigna


On 20-Mar-2002 Allan Rae wrote:

 It's probably Jug's crazy 4 char tabs to 8 char tabs and few spaces
 conversion thing gone mad.

I don't think I wrote FormParagraph and anyway I indent with tabs!

Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Engineering meets art in the parking lot and things explode.
-- Garry Peterson, about Survival Research Labs




Re: [PATCH] tiny whitespace

2002-03-20 Thread Allan Rae

On Wed, 20 Mar 2002, Juergen Vigna wrote:

 On 20-Mar-2002 Allan Rae wrote:

  It's probably Jug's crazy 4 char tabs to 8 char tabs and few spaces
  conversion thing gone mad.

 I don't think I wrote FormParagraph and anyway I indent with tabs!

I never said you didn't.  I said you use 4 char tabs, as in, tabs that
are 4 characters wide instead of the more usual 8 char tabs.

Allan. (ARRae)  nearly there...




Re: [PATCH] tiny whitespace

2002-03-20 Thread Allan Rae

On Wed, 20 Mar 2002, Lars Gullik Bjønnes wrote:

 What about:
  delete-trailing-whitespace
  whitespace-cleanup

Actually XEmacs doesn't seem to have these (in either 21.1.14 or
21.4.6).  Which emacs and is there a package to load first?

I did find whitespace-mode which does a nice job of distinguishing
spaces from tabs.  I might use it in future so silly lines which use
spaces instead of tabs stand out.

Allan. (ARRae)




Re: [PATCH] tiny whitespace

2002-03-20 Thread Juergen Vigna


On 20-Mar-2002 Allan Rae wrote:

> It's probably Jug's crazy 4 char tabs to 8 char tabs and few spaces
> conversion thing gone mad.

I don't think I wrote FormParagraph and anyway I indent with tabs!

Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

"Engineering meets art in the parking lot and things explode."
-- Garry Peterson, about Survival Research Labs




Re: [PATCH] tiny whitespace

2002-03-20 Thread Allan Rae

On Wed, 20 Mar 2002, Juergen Vigna wrote:

> On 20-Mar-2002 Allan Rae wrote:
>
> > It's probably Jug's crazy 4 char tabs to 8 char tabs and few spaces
> > conversion thing gone mad.
>
> I don't think I wrote FormParagraph and anyway I indent with tabs!

I never said you didn't.  I said you use 4 char tabs, as in, tabs that
are 4 characters wide instead of the more usual 8 char tabs.

Allan. (ARRae)  nearly there...




Re: [PATCH] tiny whitespace

2002-03-20 Thread Allan Rae

On Wed, 20 Mar 2002, Lars Gullik Bjønnes wrote:

> What about:
>  delete-trailing-whitespace
>  whitespace-cleanup

Actually XEmacs doesn't seem to have these (in either 21.1.14 or
21.4.6).  Which emacs and is there a package to load first?

I did find whitespace-mode which does a nice job of distinguishing
spaces from tabs.  I might use it in future so silly lines which use
spaces instead of tabs stand out.

Allan. (ARRae)




[PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

Please apply

-- 
André Pönitz .. [EMAIL PROTECTED]


Index: ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.634
diff -u -p -r1.634 ChangeLog
--- ChangeLog   19 Mar 2002 11:17:45 -  1.634
+++ ChangeLog   19 Mar 2002 11:40:22 -
@@ -1,3 +1,8 @@
+
+2002-03-19  André Pönitz [EMAIL PROTECTED]
+
+   * lyxfunc.C: tiny whitespace change
+
 2002-03-19  Jean-Marc Lasgouttes  [EMAIL PROTECTED]
 
* ToolbarDefaults.C (init): 
Index: lyxfunc.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.304
diff -u -p -r1.304 lyxfunc.C
--- lyxfunc.C   19 Mar 2002 11:17:46 -  1.304
+++ lyxfunc.C   19 Mar 2002 11:40:22 -
@@ -1102,8 +1102,8 @@ string const LyXFunc::dispatch(kb_action
case LFUN_PREVIEW:
Exporter::Preview(owner-buffer(), argument);
break;
-
-case LFUN_BUILDPROG:
+   
+   case LFUN_BUILDPROG:
Exporter::Export(owner-buffer(), program, true);
break;
 



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 03:48:55PM +0100, Jean-Marc Lasgouttes wrote:
 Does that fix a bug? Where is the Changelog?

Actually I thought I had written a Changelog entry...

Andre' 

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

 Andre == Andre Poenitz [EMAIL PROTECTED] writes:

Andre On Tue, Mar 19, 2002 at 03:48:55PM +0100, Jean-Marc Lasgouttes
Andre wrote:
 Does that fix a bug? Where is the Changelog?

Andre Actually I thought I had written a Changelog entry...

OK, you're right, I'll commit it :)

JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 05:24:40PM +0100, Jean-Marc Lasgouttes wrote:
 OK, you're right, I'll commit it :)

It's just to show that I can behave nicely when it does not matter...

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

 Andre == Andre Poenitz [EMAIL PROTECTED] writes:

Andre On Tue, Mar 19, 2002 at 05:24:40PM +0100, Jean-Marc Lasgouttes
Andre wrote:
 OK, you're right, I'll commit it :)

Andre It's just to show that I can behave nicely when it does not
Andre matter...

Except that your patch only applied from src/, that's why I got
rejects and lost the changelog.

JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 06:02:39PM +0100, Jean-Marc Lasgouttes wrote:
 Except that your patch only applied from src/, that's why I got
 rejects and lost the changelog.

Where am I supposed to call cvs diff? In ../lyx-devel/ ?

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [PATCH] tiny whitespace

2002-03-19 Thread John Levon

On Tue, Mar 19, 2002 at 05:02:48PM +0100, Andre Poenitz wrote:

 Where am I supposed to call cvs diff? In ../lyx-devel/ ?

yup. How much longer can this thread go on for :)

john

-- 
I am a complete moron for forgetting about endianness. May I be
forever marked as such.



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

 Andre == Andre Poenitz [EMAIL PROTECTED] writes:

Andre On Tue, Mar 19, 2002 at 06:02:39PM +0100, Jean-Marc Lasgouttes
Andre wrote:
 Except that your patch only applied from src/, that's why I got
 rejects and lost the changelog.

Andre Where am I supposed to call cvs diff? In ../lyx-devel/ ?

Yes, from lyx-devel/. I like to be able to apply patches from the root with
'patch -p0' without first inspecting it to see whether it will work.
You can do
cd lyx-devel
cvs diff src

JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 04:08:54PM +, John Levon wrote:
 yup. How much longer can this thread go on for :)

I don't know. But considering the importance of changing eight spaces
into a tab, it might last for while...

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [PATCH] tiny whitespace

2002-03-19 Thread John Levon

On Tue, Mar 19, 2002 at 05:14:02PM +0100, Andre Poenitz wrote:

 I don't know. But considering the importance of changing eight spaces
 into a tab, it might last for while...

Feel free to do your thing with FormParagraph.C

regards
john

-- 
I am a complete moron for forgetting about endianness. May I be
forever marked as such.



Re: [PATCH] tiny whitespace

2002-03-19 Thread Angus Leeming

On Tuesday 19 March 2002 4:16 pm, John Levon wrote:
 On Tue, Mar 19, 2002 at 05:14:02PM +0100, Andre Poenitz wrote:
  I don't know. But considering the importance of changing eight spaces
  into a tab, it might last for while...

 Feel free to do your thing with FormParagraph.C

No don't do that. The code in there is so crazy and horrible that I've 
concluded that there's some secret environment variable that must be set 
before changes to the code will work. I've also concluded through much 
experimentation that this environment variable is dependent on the use of 
tabs!

A



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

 Angus == Angus Leeming [EMAIL PROTECTED] writes:

Angus No don't do that. The code in there is so crazy and horrible
Angus that I've concluded that there's some secret environment
Angus variable that must be set before changes to the code will work.
Angus I've also concluded through much experimentation that this
Angus environment variable is dependent on the use of tabs!

A phase of the moon bug, maybe?

JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Angus Leeming

On Tuesday 19 March 2002 5:24 pm, Jean-Marc Lasgouttes wrote:
  Angus == Angus Leeming [EMAIL PROTECTED] writes:

 Angus No don't do that. The code in there is so crazy and horrible
 Angus that I've concluded that there's some secret environment
 Angus variable that must be set before changes to the code will work.
 Angus I've also concluded through much experimentation that this
 Angus environment variable is dependent on the use of tabs!

 A phase of the moon bug, maybe?

You mean whoever wrote it is a lunatic??? ;-)

A



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 04:20:41PM +, Angus Leeming wrote:
 No don't do that. The code in there is so crazy and horrible that I've 
 concluded that there's some secret environment variable that must be set 
 before changes to the code will work. I've also concluded through much 
 experimentation that this environment variable is dependent on the use of 
 tabs!

I don't believe so since the attached patch seems to work well for me.
Apart from that, that code certainly need some real brushing. There is lots
of duplicated stuff, even whole switches come in pairs ;-{

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]


Index: ./frontends/xforms/FormParagraph.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormParagraph.C,v
retrieving revision 1.58
diff -u -p -r1.58 FormParagraph.C
--- ./frontends/xforms/FormParagraph.C  12 Mar 2002 14:11:13 -  1.58
+++ ./frontends/xforms/FormParagraph.C  19 Mar 2002 16:37:01 -
@@ -100,469 +100,471 @@ void FormParagraph::redraw()
 
 FL_FORM * FormParagraph::form() const
 {
-if (dialog_.get()) return dialog_-form;
-return 0;
+   if (dialog_.get())
+   return dialog_-form;
+   return 0;
 }
 
 
 void FormParagraph::build()
 {
-// the tabbed folder
-dialog_.reset(build_paragraph());
+   // the tabbed folder
+   dialog_.reset(build_paragraph());
 
-fl_addto_choice(dialog_-choice_space_above,
-   _( None | Defskip | Smallskip 
- | Medskip | Bigskip | VFill | Length ));
-fl_addto_choice(dialog_-choice_space_below,
-   _( None | Defskip | Smallskip 
- | Medskip | Bigskip | VFill | Length )); 
-
-fl_addto_choice(dialog_-choice_linespacing,
-_( Default | Single | OneHalf | Double | Other ));
- 
-fl_set_input_return(dialog_-input_space_above, FL_RETURN_CHANGED);
-fl_set_input_return(dialog_-input_space_below, FL_RETURN_CHANGED);
-fl_set_input_return(dialog_-input_labelwidth, FL_RETURN_CHANGED);
-fl_set_input_return(dialog_-input_linespacing, FL_RETURN_CHANGED);
-fl_set_input_filter(dialog_-input_linespacing, fl_unsigned_float_filter);
-
-setPrehandler(dialog_-input_space_above);
-setPrehandler(dialog_-input_space_below);
-setPrehandler(dialog_-input_labelwidth);
-setPrehandler(dialog_-input_linespacing);
-
-// Create the contents of the unit choices
-// Don't include the % terms...
-vectorstring units_vec = getLatexUnits();
+   fl_addto_choice(dialog_-choice_space_above,
+   _( None | Defskip | Smallskip 
+   | Medskip | Bigskip | VFill | Length ));
+   fl_addto_choice(dialog_-choice_space_below,
+   _( None | Defskip | Smallskip 
+   | Medskip | Bigskip | VFill | Length )); 
+
+   fl_addto_choice(dialog_-choice_linespacing,
+   _( Default | Single | OneHalf | Double | Other ));
+
+   fl_set_input_return(dialog_-input_space_above, FL_RETURN_CHANGED);
+   fl_set_input_return(dialog_-input_space_below, FL_RETURN_CHANGED);
+   fl_set_input_return(dialog_-input_labelwidth, FL_RETURN_CHANGED);
+   fl_set_input_return(dialog_-input_linespacing, FL_RETURN_CHANGED);
+   fl_set_input_filter(dialog_-input_linespacing, fl_unsigned_float_filter);
+
+   setPrehandler(dialog_-input_space_above);
+   setPrehandler(dialog_-input_space_below);
+   setPrehandler(dialog_-input_labelwidth);
+   setPrehandler(dialog_-input_linespacing);
+
+   // Create the contents of the unit choices
+   // Don't include the % terms...
+   vectorstring units_vec = getLatexUnits();
 #if 0
-for (vectorstring::iterator it = units_vec.begin();
-   it != units_vec.end(); ++it) {
-   if (contains(*it, %))
-   it = units_vec.erase(it, it+1) - 1;
-}
+   for (vectorstring::iterator it = units_vec.begin();
+   it != units_vec.end(); ++it) {
+   if (contains(*it, %))
+   it = units_vec.erase(it, it+1) - 1;
+   }
 #else
-// Something similar to this is a better way to erase
-vectorstring::iterator del =
-   remove_if(units_vec.begin(), units_vec.end(),
- bind2nd(contains_functor(), %));
-units_vec.erase(del, units_vec.end());
+   // Something similar to this is a better way to erase
+   vectorstring::iterator del =
+   remove_if(units_vec.begin(), units_vec.end(),
+   bind2nd(contains_functor(), %));
+   units_vec.erase(del, units_vec.end());
 #endif
-
-string units = getStringFromVector(units_vec, |);
 
-fl_addto_choice(dialog_-choice_value_space_above,  units.c_str());
-fl_addto_choice(dialog_-choice_value_space_below, units.c_str());
+   string units = getStringFromVector(units_vec, |);
 
-// 

Re: [PATCH] tiny whitespace

2002-03-19 Thread Angus Leeming

On Tuesday 19 March 2002 4:43 pm, Andre Poenitz wrote:
 On Tue, Mar 19, 2002 at 04:20:41PM +, Angus Leeming wrote:
  No don't do that. The code in there is so crazy and horrible that I've
  concluded that there's some secret environment variable that must be set
  before changes to the code will work. I've also concluded through much
  experimentation that this environment variable is dependent on the use of
  tabs!

 I don't believe so since the attached patch seems to work well for me.
 Apart from that, that code certainly need some real brushing. There is lots
 of duplicated stuff, even whole switches come in pairs ;-{

 Andre'

André, do you have some tool to do the hard work of formatting for you?
Angus



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

 Angus == Angus Leeming [EMAIL PROTECTED] writes:

  A phase of the moon bug, maybe?

Angus You mean whoever wrote it is a lunatic??? ;-)

No, a real phase of the moon bug:
http://www.tuxedo.org/~esr/jargon/html/entry/phase-of-the-moon.html

Or look at the very end of this interview of RMS
  http://www.linuxcare.com/viewpoints/os-interviews/latest.epl
  
JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

 Angus == Angus Leeming [EMAIL PROTECTED] writes:

Angus André, do you have some tool to do the hard work of formatting
Angus for you? Angus

Emacs? 

JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 04:49:04PM +, Angus Leeming wrote:
 André, do you have some tool to do the hard work of formatting for you?

Does vi count as a tool?

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [PATCH] tiny whitespace

2002-03-19 Thread Angus Leeming

On Tuesday 19 March 2002 5:58 pm, Jean-Marc Lasgouttes wrote:
  Angus == Angus Leeming [EMAIL PROTECTED] writes:

 Angus André, do you have some tool to do the hard work of formatting
 Angus for you? Angus

 Emacs?

Ok. So do you hit tab on every line or is there a command to format the whole 
thing prettily?

A



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 06:58:39PM +0100, Jean-Marc Lasgouttes wrote:
 Angus André, do you have some tool to do the hard work of formatting
 Angus for you? Angus
 
 Emacs? 

Nah... I am running Linux.

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [PATCH] tiny whitespace

2002-03-19 Thread John Levon

On Tue, Mar 19, 2002 at 06:01:24PM +0100, Andre Poenitz wrote:

  Emacs? 
 
 Nah... I am running Linux.

:)

you really are trying to extend this thread ...

john

-- 
I am a complete moron for forgetting about endianness. May I be
forever marked as such.



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

 Angus == Angus Leeming [EMAIL PROTECTED] writes:

Angus On Tuesday 19 March 2002 5:58 pm, Jean-Marc Lasgouttes wrote:
  Angus == Angus Leeming [EMAIL PROTECTED] writes:
 
Angus André, do you have some tool to do the hard work of formatting
Angus for you? Angus
  Emacs?

Angus Ok. So do you hit tab on every line or is there a command to
Angus format the whole thing prettily?

For a {} block, I put the cursor on the opening { and use M-C-q.

For a whole region, use the menu entry C++Indent line of region.

Difficult, isn't it?

JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 05:01:30PM +, Angus Leeming wrote:
 Ok. So do you hit tab on every line or is there a command to format the
 whole thing prettily?

I use  and  to indent blocks of lines.

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

 Angus == Angus Leeming [EMAIL PROTECTED] writes:

Angus Incidentally, highlighting a region and typing M-x
Angus indent-region works fine, but it doesn't remove whitespace from
Angus otherwise empty lines. Know the command for that?

I guess you have to set some magical variable from cc-mode.

JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Allan Rae

On Tue, 19 Mar 2002, Angus Leeming wrote:

 On Tuesday 19 March 2002 6:16 pm, Jean-Marc Lasgouttes wrote:
  Angus Ok. So do you hit tab on every line or is there a command to
  Angus format the whole thing prettily?
 
  For a {} block, I put the cursor on the opening { and use M-C-q.
 
  For a whole region, use the menu entry C++Indent line of region.
 
  Difficult, isn't it?

 If you don't know the command, yes...

 Incidentally, highlighting a region and typing M-x indent-region works fine,
 but it doesn't remove whitespace from otherwise empty lines. Know the command
 for that?

Have you tried M-x tabify? (you need to select a region first)

You might consider writing a macro that does something like:
mark-whole-buffer
tabify
mark-whole-buffer
indent-region

I think tabify also squashes spaces on an otherwise empty line but I
could be wrong.

Allan. (ARRae)




Re: [PATCH] tiny whitespace

2002-03-19 Thread Allan Rae

On Tue, 19 Mar 2002, Angus Leeming wrote:

 On Tuesday 19 March 2002 4:16 pm, John Levon wrote:
  On Tue, Mar 19, 2002 at 05:14:02PM +0100, Andre Poenitz wrote:
   I don't know. But considering the importance of changing eight spaces
   into a tab, it might last for while...
 
  Feel free to do your thing with FormParagraph.C

 No don't do that. The code in there is so crazy and horrible that I've
 concluded that there's some secret environment variable that must be set
 before changes to the code will work. I've also concluded through much
 experimentation that this environment variable is dependent on the use of
 tabs!

It's probably Jug's crazy 4 char tabs to 8 char tabs and few spaces
conversion thing gone mad.

Allan. (ARRae)




Re: [PATCH] tiny whitespace

2002-03-19 Thread Allan Rae

On 19 Mar 2002, Jean-Marc Lasgouttes wrote:

  Andre == Andre Poenitz [EMAIL PROTECTED] writes:

 Andre On Tue, Mar 19, 2002 at 03:48:55PM +0100, Jean-Marc Lasgouttes
 Andre wrote:
  Does that fix a bug? Where is the Changelog?

 Andre Actually I thought I had written a Changelog entry...

 OK, you're right, I'll commit it :)

I'm surprised you accepted this patch when there is another more
important whitespace problem involving the same LFUN_BUILDPROG earlier
in the same file.

Perhaps I should submit a patch for that?

It might help keep this thread alive until Friday ;-)

Allan. (ARRae)




Re: [PATCH] tiny whitespace

2002-03-19 Thread Lars Gullik Bjønnes

Allan Rae [EMAIL PROTECTED] writes:

| On Tue, 19 Mar 2002, Angus Leeming wrote:

 On Tuesday 19 March 2002 6:16 pm, Jean-Marc Lasgouttes wrote:
  Angus Ok. So do you hit tab on every line or is there a command to
  Angus format the whole thing prettily?
 
  For a {} block, I put the cursor on the opening { and use M-C-q.
 
  For a whole region, use the menu entry C++Indent line of region.
 
  Difficult, isn't it?

 If you don't know the command, yes...

 Incidentally, highlighting a region and typing M-x indent-region works fine,
 but it doesn't remove whitespace from otherwise empty lines. Know the command
 for that?

| Have you tried M-x tabify? (you need to select a region first)

What about:
 delete-trailing-whitespace
 whitespace-cleanup
 
?

-- 
Lgb



Re: [PATCH] tiny whitespace

2002-03-19 Thread Allan Rae

On Wed, 20 Mar 2002, Lars Gullik Bjønnes wrote:
[...]
 What about:
  delete-trailing-whitespace
  whitespace-cleanup

Cool!  I learn something new everyday!

So now that I've learned that I can go home.  I don't want to risk
saturating my brain with new inputs.

Allan. (ARRae)




[PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

Please apply

-- 
André Pönitz .. [EMAIL PROTECTED]


Index: ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.634
diff -u -p -r1.634 ChangeLog
--- ChangeLog   19 Mar 2002 11:17:45 -  1.634
+++ ChangeLog   19 Mar 2002 11:40:22 -
@@ -1,3 +1,8 @@
+
+2002-03-19  André Pönitz <[EMAIL PROTECTED]>
+
+   * lyxfunc.C: tiny whitespace change
+
 2002-03-19  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
* ToolbarDefaults.C (init): 
Index: lyxfunc.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.304
diff -u -p -r1.304 lyxfunc.C
--- lyxfunc.C   19 Mar 2002 11:17:46 -  1.304
+++ lyxfunc.C   19 Mar 2002 11:40:22 -
@@ -1102,8 +1102,8 @@ string const LyXFunc::dispatch(kb_action
case LFUN_PREVIEW:
Exporter::Preview(owner->buffer(), argument);
break;
-
-case LFUN_BUILDPROG:
+   
+   case LFUN_BUILDPROG:
Exporter::Export(owner->buffer(), "program", true);
break;
 



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 03:48:55PM +0100, Jean-Marc Lasgouttes wrote:
> Does that fix a bug? Where is the Changelog?

Actually I thought I had written a Changelog entry...

Andre' 

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes:

Andre> On Tue, Mar 19, 2002 at 03:48:55PM +0100, Jean-Marc Lasgouttes
Andre> wrote:
>> Does that fix a bug? Where is the Changelog?

Andre> Actually I thought I had written a Changelog entry...

OK, you're right, I'll commit it :)

JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 05:24:40PM +0100, Jean-Marc Lasgouttes wrote:
> OK, you're right, I'll commit it :)

It's just to show that I can behave nicely when it does not matter...

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes:

Andre> On Tue, Mar 19, 2002 at 05:24:40PM +0100, Jean-Marc Lasgouttes
Andre> wrote:
>> OK, you're right, I'll commit it :)

Andre> It's just to show that I can behave nicely when it does not
Andre> matter...

Except that your patch only applied from src/, that's why I got
rejects and lost the changelog.

JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 06:02:39PM +0100, Jean-Marc Lasgouttes wrote:
> Except that your patch only applied from src/, that's why I got
> rejects and lost the changelog.

Where am I supposed to call cvs diff? In ../lyx-devel/ ?

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [PATCH] tiny whitespace

2002-03-19 Thread John Levon

On Tue, Mar 19, 2002 at 05:02:48PM +0100, Andre Poenitz wrote:

> Where am I supposed to call cvs diff? In ../lyx-devel/ ?

yup. How much longer can this thread go on for :)

john

-- 
I am a complete moron for forgetting about endianness. May I be
forever marked as such.



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes:

Andre> On Tue, Mar 19, 2002 at 06:02:39PM +0100, Jean-Marc Lasgouttes
Andre> wrote:
>> Except that your patch only applied from src/, that's why I got
>> rejects and lost the changelog.

Andre> Where am I supposed to call cvs diff? In ../lyx-devel/ ?

Yes, from lyx-devel/. I like to be able to apply patches from the root with
'patch -p0' without first inspecting it to see whether it will work.
You can do
cd lyx-devel
cvs diff src

JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 04:08:54PM +, John Levon wrote:
> yup. How much longer can this thread go on for :)

I don't know. But considering the importance of changing eight spaces
into a tab, it might last for while...

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [PATCH] tiny whitespace

2002-03-19 Thread John Levon

On Tue, Mar 19, 2002 at 05:14:02PM +0100, Andre Poenitz wrote:

> I don't know. But considering the importance of changing eight spaces
> into a tab, it might last for while...

Feel free to do your thing with FormParagraph.C

regards
john

-- 
I am a complete moron for forgetting about endianness. May I be
forever marked as such.



Re: [PATCH] tiny whitespace

2002-03-19 Thread Angus Leeming

On Tuesday 19 March 2002 4:16 pm, John Levon wrote:
> On Tue, Mar 19, 2002 at 05:14:02PM +0100, Andre Poenitz wrote:
> > I don't know. But considering the importance of changing eight spaces
> > into a tab, it might last for while...
>
> Feel free to do your thing with FormParagraph.C

No don't do that. The code in there is so crazy and horrible that I've 
concluded that there's some secret environment variable that must be set 
before changes to the code will work. I've also concluded through much 
experimentation that this environment variable is dependent on the use of 
tabs!

A



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> No don't do that. The code in there is so crazy and horrible
Angus> that I've concluded that there's some secret environment
Angus> variable that must be set before changes to the code will work.
Angus> I've also concluded through much experimentation that this
Angus> environment variable is dependent on the use of tabs!

A phase of the moon bug, maybe?

JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Angus Leeming

On Tuesday 19 March 2002 5:24 pm, Jean-Marc Lasgouttes wrote:
> > "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
>
> Angus> No don't do that. The code in there is so crazy and horrible
> Angus> that I've concluded that there's some secret environment
> Angus> variable that must be set before changes to the code will work.
> Angus> I've also concluded through much experimentation that this
> Angus> environment variable is dependent on the use of tabs!
>
> A phase of the moon bug, maybe?

You mean whoever wrote it is a lunatic??? ;-)

A



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 04:20:41PM +, Angus Leeming wrote:
> No don't do that. The code in there is so crazy and horrible that I've 
> concluded that there's some secret environment variable that must be set 
> before changes to the code will work. I've also concluded through much 
> experimentation that this environment variable is dependent on the use of 
> tabs!

I don't believe so since the attached patch seems to work well for me.
Apart from that, that code certainly need some real brushing. There is lots
of duplicated stuff, even whole switches come in pairs ;-{

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]


Index: ./frontends/xforms/FormParagraph.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormParagraph.C,v
retrieving revision 1.58
diff -u -p -r1.58 FormParagraph.C
--- ./frontends/xforms/FormParagraph.C  12 Mar 2002 14:11:13 -  1.58
+++ ./frontends/xforms/FormParagraph.C  19 Mar 2002 16:37:01 -
@@ -100,469 +100,471 @@ void FormParagraph::redraw()
 
 FL_FORM * FormParagraph::form() const
 {
-if (dialog_.get()) return dialog_->form;
-return 0;
+   if (dialog_.get())
+   return dialog_->form;
+   return 0;
 }
 
 
 void FormParagraph::build()
 {
-// the tabbed folder
-dialog_.reset(build_paragraph());
+   // the tabbed folder
+   dialog_.reset(build_paragraph());
 
-fl_addto_choice(dialog_->choice_space_above,
-   _(" None | Defskip | Smallskip "
- "| Medskip | Bigskip | VFill | Length "));
-fl_addto_choice(dialog_->choice_space_below,
-   _(" None | Defskip | Smallskip "
- "| Medskip | Bigskip | VFill | Length ")); 
-
-fl_addto_choice(dialog_->choice_linespacing,
-_(" Default | Single | OneHalf | Double | Other "));
- 
-fl_set_input_return(dialog_->input_space_above, FL_RETURN_CHANGED);
-fl_set_input_return(dialog_->input_space_below, FL_RETURN_CHANGED);
-fl_set_input_return(dialog_->input_labelwidth, FL_RETURN_CHANGED);
-fl_set_input_return(dialog_->input_linespacing, FL_RETURN_CHANGED);
-fl_set_input_filter(dialog_->input_linespacing, fl_unsigned_float_filter);
-
-setPrehandler(dialog_->input_space_above);
-setPrehandler(dialog_->input_space_below);
-setPrehandler(dialog_->input_labelwidth);
-setPrehandler(dialog_->input_linespacing);
-
-// Create the contents of the unit choices
-// Don't include the "%" terms...
-vector units_vec = getLatexUnits();
+   fl_addto_choice(dialog_->choice_space_above,
+   _(" None | Defskip | Smallskip "
+   "| Medskip | Bigskip | VFill | Length "));
+   fl_addto_choice(dialog_->choice_space_below,
+   _(" None | Defskip | Smallskip "
+   "| Medskip | Bigskip | VFill | Length ")); 
+
+   fl_addto_choice(dialog_->choice_linespacing,
+   _(" Default | Single | OneHalf | Double | Other "));
+
+   fl_set_input_return(dialog_->input_space_above, FL_RETURN_CHANGED);
+   fl_set_input_return(dialog_->input_space_below, FL_RETURN_CHANGED);
+   fl_set_input_return(dialog_->input_labelwidth, FL_RETURN_CHANGED);
+   fl_set_input_return(dialog_->input_linespacing, FL_RETURN_CHANGED);
+   fl_set_input_filter(dialog_->input_linespacing, fl_unsigned_float_filter);
+
+   setPrehandler(dialog_->input_space_above);
+   setPrehandler(dialog_->input_space_below);
+   setPrehandler(dialog_->input_labelwidth);
+   setPrehandler(dialog_->input_linespacing);
+
+   // Create the contents of the unit choices
+   // Don't include the "%" terms...
+   vector units_vec = getLatexUnits();
 #if 0
-for (vector::iterator it = units_vec.begin();
-   it != units_vec.end(); ++it) {
-   if (contains(*it, "%"))
-   it = units_vec.erase(it, it+1) - 1;
-}
+   for (vector::iterator it = units_vec.begin();
+   it != units_vec.end(); ++it) {
+   if (contains(*it, "%"))
+   it = units_vec.erase(it, it+1) - 1;
+   }
 #else
-// Something similar to this is a better way to erase
-vector::iterator del =
-   remove_if(units_vec.begin(), units_vec.end(),
- bind2nd(contains_functor(), "%"));
-units_vec.erase(del, units_vec.end());
+   // Something similar to this is a better way to erase
+   vector::iterator del =
+   remove_if(units_vec.begin(), units_vec.end(),
+   bind2nd(contains_functor(), "%"));
+   units_vec.erase(del, units_vec.end());
 #endif
-
-string units = getStringFromVector(units_vec, "|");
 
-fl_addto_choice(dialog_->choice_value_space_above,  units.c_str());
-fl_addto_choice(dialog_->choice_value_space_below, units.c_str());
+   string units = 

Re: [PATCH] tiny whitespace

2002-03-19 Thread Angus Leeming

On Tuesday 19 March 2002 4:43 pm, Andre Poenitz wrote:
> On Tue, Mar 19, 2002 at 04:20:41PM +, Angus Leeming wrote:
> > No don't do that. The code in there is so crazy and horrible that I've
> > concluded that there's some secret environment variable that must be set
> > before changes to the code will work. I've also concluded through much
> > experimentation that this environment variable is dependent on the use of
> > tabs!
>
> I don't believe so since the attached patch seems to work well for me.
> Apart from that, that code certainly need some real brushing. There is lots
> of duplicated stuff, even whole switches come in pairs ;-{
>
> Andre'

André, do you have some tool to do the hard work of formatting for you?
Angus



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

>>  A phase of the moon bug, maybe?

Angus> You mean whoever wrote it is a lunatic??? ;-)

No, a real phase of the moon bug:
http://www.tuxedo.org/~esr/jargon/html/entry/phase-of-the-moon.html

Or look at the very end of this interview of RMS
  http://www.linuxcare.com/viewpoints/os-interviews/latest.epl
  
JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> André, do you have some tool to do the hard work of formatting
Angus> for you? Angus

Emacs? 

JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 04:49:04PM +, Angus Leeming wrote:
> André, do you have some tool to do the hard work of formatting for you?

Does vi count as a tool?

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [PATCH] tiny whitespace

2002-03-19 Thread Angus Leeming

On Tuesday 19 March 2002 5:58 pm, Jean-Marc Lasgouttes wrote:
> > "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
>
> Angus> André, do you have some tool to do the hard work of formatting
> Angus> for you? Angus
>
> Emacs?

Ok. So do you hit tab on every line or is there a command to format the whole 
thing prettily?

A



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 06:58:39PM +0100, Jean-Marc Lasgouttes wrote:
> Angus> André, do you have some tool to do the hard work of formatting
> Angus> for you? Angus
> 
> Emacs? 

Nah... I am running Linux.

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [PATCH] tiny whitespace

2002-03-19 Thread John Levon

On Tue, Mar 19, 2002 at 06:01:24PM +0100, Andre Poenitz wrote:

> > Emacs? 
> 
> Nah... I am running Linux.

:)

you really are trying to extend this thread ...

john

-- 
I am a complete moron for forgetting about endianness. May I be
forever marked as such.



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> On Tuesday 19 March 2002 5:58 pm, Jean-Marc Lasgouttes wrote:
>> > "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
>> 
Angus> André, do you have some tool to do the hard work of formatting
Angus> for you? Angus
>>  Emacs?

Angus> Ok. So do you hit tab on every line or is there a command to
Angus> format the whole thing prettily?

For a {} block, I put the cursor on the opening { and use M-C-q.

For a whole region, use the menu entry C++>Indent line of region.

Difficult, isn't it?

JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Andre Poenitz

On Tue, Mar 19, 2002 at 05:01:30PM +, Angus Leeming wrote:
> Ok. So do you hit tab on every line or is there a command to format the
> whole thing prettily?

I use << and >> to indent blocks of lines.

Andre'

-- 
André Pönitz .. [EMAIL PROTECTED]



Re: [PATCH] tiny whitespace

2002-03-19 Thread Jean-Marc Lasgouttes

> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> Incidentally, highlighting a region and typing M-x
Angus> indent-region works fine, but it doesn't remove whitespace from
Angus> otherwise empty lines. Know the command for that?

I guess you have to set some magical variable from cc-mode.

JMarc



Re: [PATCH] tiny whitespace

2002-03-19 Thread Allan Rae

On Tue, 19 Mar 2002, Angus Leeming wrote:

> On Tuesday 19 March 2002 6:16 pm, Jean-Marc Lasgouttes wrote:
> > Angus> Ok. So do you hit tab on every line or is there a command to
> > Angus> format the whole thing prettily?
> >
> > For a {} block, I put the cursor on the opening { and use M-C-q.
> >
> > For a whole region, use the menu entry C++>Indent line of region.
> >
> > Difficult, isn't it?
>
> If you don't know the command, yes...
>
> Incidentally, highlighting a region and typing M-x indent-region works fine,
> but it doesn't remove whitespace from otherwise empty lines. Know the command
> for that?

Have you tried M-x tabify? (you need to select a region first)

You might consider writing a macro that does something like:
mark-whole-buffer
tabify
mark-whole-buffer
indent-region

I think tabify also squashes spaces on an otherwise empty line but I
could be wrong.

Allan. (ARRae)




Re: [PATCH] tiny whitespace

2002-03-19 Thread Allan Rae

On Tue, 19 Mar 2002, Angus Leeming wrote:

> On Tuesday 19 March 2002 4:16 pm, John Levon wrote:
> > On Tue, Mar 19, 2002 at 05:14:02PM +0100, Andre Poenitz wrote:
> > > I don't know. But considering the importance of changing eight spaces
> > > into a tab, it might last for while...
> >
> > Feel free to do your thing with FormParagraph.C
>
> No don't do that. The code in there is so crazy and horrible that I've
> concluded that there's some secret environment variable that must be set
> before changes to the code will work. I've also concluded through much
> experimentation that this environment variable is dependent on the use of
> tabs!

It's probably Jug's crazy 4 char tabs to 8 char tabs and few spaces
conversion thing gone mad.

Allan. (ARRae)




Re: [PATCH] tiny whitespace

2002-03-19 Thread Allan Rae

On 19 Mar 2002, Jean-Marc Lasgouttes wrote:

> > "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes:
>
> Andre> On Tue, Mar 19, 2002 at 03:48:55PM +0100, Jean-Marc Lasgouttes
> Andre> wrote:
> >> Does that fix a bug? Where is the Changelog?
>
> Andre> Actually I thought I had written a Changelog entry...
>
> OK, you're right, I'll commit it :)

I'm surprised you accepted this patch when there is another more
important whitespace problem involving the same LFUN_BUILDPROG earlier
in the same file.

Perhaps I should submit a patch for that?

It might help keep this thread alive until Friday ;-)

Allan. (ARRae)




Re: [PATCH] tiny whitespace

2002-03-19 Thread Lars Gullik Bjønnes

Allan Rae <[EMAIL PROTECTED]> writes:

| On Tue, 19 Mar 2002, Angus Leeming wrote:
>
>> On Tuesday 19 March 2002 6:16 pm, Jean-Marc Lasgouttes wrote:
>> > Angus> Ok. So do you hit tab on every line or is there a command to
>> > Angus> format the whole thing prettily?
>> >
>> > For a {} block, I put the cursor on the opening { and use M-C-q.
>> >
>> > For a whole region, use the menu entry C++>Indent line of region.
>> >
>> > Difficult, isn't it?
>>
>> If you don't know the command, yes...
>>
>> Incidentally, highlighting a region and typing M-x indent-region works fine,
>> but it doesn't remove whitespace from otherwise empty lines. Know the command
>> for that?
>
| Have you tried M-x tabify? (you need to select a region first)

What about:
 delete-trailing-whitespace
 whitespace-cleanup
 
?

-- 
Lgb



Re: [PATCH] tiny whitespace

2002-03-19 Thread Allan Rae

On Wed, 20 Mar 2002, Lars Gullik Bjønnes wrote:
[...]
> What about:
>  delete-trailing-whitespace
>  whitespace-cleanup

Cool!  I learn something new everyday!

So now that I've learned that I can go home.  I don't want to risk
saturating my brain with new inputs.

Allan. (ARRae)