Re: elastic tabstops implemented for GTK
- From: "Nick Gravgaard" <me nickgravgaard com>
- To: gtk-devel-list gnome org
- Subject: Re: elastic tabstops implemented for GTK
- Date: Wed, 29 Aug 2007 18:20:20 +0200
On 29/08/2007, David Nečas (Yeti) <yeti physics muni cz> wrote:
> On Wed, Aug 29, 2007 at 01:38:36PM +0200, Nick Gravgaard wrote:
> > The problem is that indenting is already broken regardless of whether
> > you use tabs or spaces. Tabs are broken because if you don't get the
> > size right things won't line up ("appear all wrong"), and spaces are
> > broken because you're forcing everyone to use your indentation size.
> Please explain how spaces break compatibility with other
> editors (the original objection).
> Spaces are not broken. Granted, you get one particular
> indentation with spaces, but it is unambiguous and everyone
> can display this particular style right. The amount of
> indentation is a single coding style issue of many. Does it
> worth the ado if the rest is still present (`enforced' in
> your terms)?
But wouldn't it be nice to have the choice over how big your
indentation is without forcing it on anyone else? Wouldn't it be nice
if you never had to reindent things when you make a variable name or
whatever longer? Wouldn't it be nice if you could use proportional
fonts or even different sized fonts to make code more readable to you
without affecting anyone else?
> In addition, the most problematic part of identation is
> figuring out what to do with tabs -- incidentally the part
> you seem to intend to make *much harder*.
Not really. At the moment if you're converting tabs to spaces you need
to know how big the tab is supposed to be (ask the authors). Now you
just need to know that it was using elastic tabstops (and the solution
is the same - ask the authors). Also I've actually already coded a
solution that works - see the video.
> > My approach fixes these problems.
> To me it looks like an attempt to force everyone to use
> gedit (or whatever chosen editor) to display the text.
I have to start somewhere and I chose gedit and GTK. I intend to port
this to other platforms/editors - right now there are people on the
vim-dev list talking about it, and I've seen feature requests in
Eclipse's bugzilla as well as MS's Visual Studio dev team being asked
> Also please explain how another possible interpretation of
> tabs fixes anything instead of creating more mess.
> > If you look at the plugin I made for gedit (watch the video at the
> > link I mentioned above) you can see that it is possible to convert
> > between elastic tabstops and spaces. You lose some of the advantages
> > this way (you can't manipulate the files using tools like sed and
> > still have everything line up when you load it in the editor), but can
> > work on projects that mandate the use of spaces for
> > indenting/alignment.
> Manipluating the text with sed is a cool idea, but I guess
> most people would trade it for the ability to display the
> text as intended (which can be ensured only by expanding to
> The editor can present the text any way it wishes and let
> the user do any transforms on it. No problem with this.
> But changing the storage format and expecting everyone else
> to adapt? Have Microsoft arrived here?
If you don't want to save files with tabs in and be able to manipulate
your text outside the editor etc you can always just use elastic
tabstops in editors that support them and make sure they export files
using spaces. That way you can still benefit from some of their
advantages but work on projects that indent/align using spaces.
] [Thread Prev