[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: [patch] Ability to force indent with spaces in alignment from
From:       Leo Savernik <l.savernik () aon ! at>
Date:       2008-06-04 18:26:24
Message-ID: 200806042026.25541.l.savernik () aon ! at
[Download RAW message or body]

Am Dienstag, 3. Juni 2008 schrieb Robin Pedersen:
> > I don't see why mixed mode is needed at all. Plain text files are simply
> >   not meant to scale with different tab widths. If a document has been
> > written with a tab width of 8, it is expected that it will break when
> > viewed with a tab width of 4.
>
> Says who? That's just your opinion. I guess that's what to expect, after  
> what you have written earlier, I quote: "proper svn annotate is way more  
> useful than proper indentation."

It's not an opinion, my statement is based on years of experience with 
different plain text files, especially source code files. I don't say: 
"Nobody must use mixed mode". I just question whether it's worth the effort 
of supporting it. Please don't take it as a personal attack.
>
[...]
> Then why use tabs at all (aren't tabs enabled by default)? Compression?

Yes, I use tabs mainly for two reasons:
- Compression.
- Easy alignment of comments following the statement (happens rarely).
>
> I did a little experiment, [...]
> -rw-r--r-- 1 robin robin 303752 2008-06-03 21:38 gap.xml.orig
> -rw-r--r-- 1 robin robin 373844 2008-06-03 21:39 gap.xml.spaces
> [...]
> -rw-r--r-- 1 robin robin  45736 2008-06-03 21:38 gap.xml.orig.gz
> -rw-r--r-- 1 robin robin  47068 2008-06-03 21:39 gap.xml.spaces.gz
>
> I still don't see any other motivation for using tabs this way.
>
> > [...]
> >
> > So, for sake of keeping indent scripts simple and the entry barrier as  
> > low as
> > possible, I opt for keeping current behaviour which means returning the
> > number of characters to indent and letting the caller decide on how to  
> > format the actual indentation.
> >
> > mfg
> >       Leo
>
> I've always preferred not using tabs at all, and it seems to me like the  
> majority of development projects prefer spaces instead of tabs. However,  
> when thinking about it, it would actually be nice to use tabs, if used in  
> such a way that changing the width of a tab wouldn't break any formatting.
>   When using spaces (or tabs like it's currently implemented), everyone
> reading the file is forced to a certain indent width. If this was
> implemented. everyone could use their preferred indent without noticing
> that others where using a different setting.

The only safe option to preserve layout is refrain from using tabs. When using 
tabs, the author should be aware of the fact that different editors/viewers 
will display the tab width differently. In case of Kate/Kwrite (and other 
advanced editors like vim, Emacs, or development environments) we can store a 
notion of the tab width to make it display "as expected". However, if tab 
width is interpreted differently, content doesn't become inaccessible.

Therefore, I still think that the cosmetic gains do not warrant the additional 
effort that has to be spent for each indenter to handle mixed mode indenting.
>
>
> PS: You keep referring to this as "mixed mode". I've tried using "mixed  
> mode" in the KDE3 version of kate. I can't figure how it's supposed to  
> work, but certainly it didn't work like what I suggested here.

I can't figure it out either ;-) I just know about emacs mixed mode which 
works the way you described (iirc).

mfg
	Leo
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic