[Lazarus] Elastic Tabstops: benefits or not

Martin lazarus at mfriebe.de
Fri Nov 6 16:45:17 CET 2009


Graeme Geldenhuys wrote:
> Again in the attached image, Tab characters are shown as pink dots.
>
> Martin wrote:
>   
>> That is not equivalent with better portability.
>>     
>
> Portability is achieved if your company decides that all source code
> files contain tabs and uses elastic tabstops feature. Is like example
> the same as if your company decides on a specific code formatting style.
>   
The same portability is archived if the company decides to use tabs of a 
specific width (e.g 4)

Again:
- Normal tabs do not have the features you show in your pics (aligning 
params in a table like way)
- I am not denying that elastic tabstops add new (useful) features. and 
those new useful features are portable.

Looking at the features old tabs actually have: Their portability is not 
increased by using elastic tabs.

Using a new feature that is only present in a certain set of editors 
actually reduces portability, because you *limit* yourself to this set 
of editors.

>> I thought elastic would apply to tabs that are "not leading" that is 
>> tabs that are in the middle of text.
>>     
>
> No, leading tabs act like normal tabs. Jump a set number of pixels (or
> characters), depending on the ET implementation. One difference being
> that if alignment was used (non-leading tabs) in previous line of code,
> then alignment occurs and the tabwidth is different to a standard tab.
>
> Line 2 in ex3.png shows that.
>   

what about my example?
  if a then begin <TAB> // some comment
  <TAB> writeln()

versus
  procedure( <TAB> param1
  <TAB> param2


How do elastic tabs know, if they should indent the tab in line2  by the 
fixed offset for leading tabs, OR the elastic alignment ?

>> If it applies to tabs that are at the very start of line: How do you 
>> indent after a  "begin"? Because the indent should not  depend on the 
>> previous line?
>>     
>
> It depends in which "tab block/cell" it falls into. The ET website
> explains tab blocks/cells with a image.
>
> See lines 15 vs lines 18 in image ex3.png. Elastic tabstops wants to
> align content with tabs. On line 15 there is no point in adding the
> second tab before the comments. Because what do you want to align the
> comments with? Nothing, so use a space to separate the comment from the
> code, as is done on line 18.
>   
ok, so in this case the indented statement is aligned in a none ideal way?

Question solved




More information about the Lazarus mailing list