[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:       "Robin Pedersen" <robinpeder () gmail ! com>
Date:       2008-06-03 20:28:43
Message-ID: op.ub6wh5bz9lgty9 () lenobin
[Download RAW message or body]

On Tue, 03 Jun 2008 20:46:51 +0200, Leo Savernik <l.savernik@aon.at> wrote:

> Am Freitag, 30. Mai 2008 schrieb Jakob Petsovits:
>> > The real question in this thread is whether to implement the  
>> alignment   
>> > feature at all. What is your opion on that?
>>
>> Hm, that's a good point... alignment with tabs enabled certainly doesn't
>> make any sense without mixed mode, it will break in the worst possible
>> ways. I'm curious what the more involved people think about this :)
>
> 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."

> The compiler won't care and for development projects there should be a
> proper .kateconfig file or modelines defining the tab width.

(The python interpreter will care.)

Then why use tabs at all (aren't tabs enabled by default)? Compression?

I did a little experiment, using the largest of all the xml syntax files  
in current svn. It contains 23364 tabs. I converted all those to four  
spaces and compared file sizes. The file size was increased by 70092 bytes  
(a 23 % increase). This was as expected, because this number is equal to  
the number of tabs times three.

-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

Compressed with gzip, the file with spaces was 1332 bytes larger (a 2.9 %  
increase). The extra bytes added by using spaces instead of tabs was  
compressed 52 times (98 %).

-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.


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.

-- 
Robin Pedersen
_______________________________________________
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