[Geany-Devel] Smart tabs

Lex Trotman elextr at xxxxx
Tue Jul 16 06:51:52 UTC 2013


On 16 July 2013 15:45, Thomas Martitz
<thomas.martitz at student.htw-berlin.de>wrote:

> Am 16.07.2013 03:02, schrieb Lex Trotman:
>
>
>>
>> 2) There has been much discussion on the ML and several actual prototypes
>> of improved indentation/alignment schemes that are flexible enough to
>> address many languages (even just many C style languages is a hard
>> problem).  None of them have been sufficiently correct, enough of the time,
>> to overcome the problems of being really annoying when they are incorrect.
>>  Therefore anything would have to be a plugin so that it can simply not be
>> loaded if the user didn't want it.  Also it would need to only operate when
>> the correct language was being edited.
>>
>
> Bah, this "everything must be a plugin" really annoys me. Indentation is
> really a core feature, whether smart or not, and is nowhere extra
> functionality provided by external code and authors.
>

> g-p has also shown that finding motivated plugin authors that maintain
> their stuff beyond the initial code drop is hard, so we should really not
> rely too much on plugins.
>

Plugins can be part of the main Geany distribution too, like splitwindow
and filebrowser, so thats not an argument against implementing in Geany or
in a plugin.  Implementing as a plugin also allows the use of languages
other than C eg Lua as Thrawn proposed.

Indentation schemes are very specific to languages and styles, it is not a
simple single capability that can be designed, coded and forgotten.

There have been several attempts at providing configurable approaches to
indentation, including one by Colomban.  But those could not cover even the
simple algorithm that Thrawn proposes.

A plugin for something like indentation allows people to replace it if they
don't like what is provided, using Lua or Python if they like, or in C/C++.
 Code inside Geany can't so easily be replaced.

The alternative is to hard code various schemes for each supported
language, but somebody has to do it, and, as you say, maintain it.


>
> What's wrong with you accepting new code in the core?
>

Nothing, but there are several reasons *not* to shove the first indentation
scheme that is coded into core.  Start with a plugin, if it produces a good
result then it can be included in core.

Cheers
Lex

PS @Thrawn, one thing that I neglected to mention was that you probably
noted that Emacs indentations depend on a syntactic evaluation of the code
to guide their operation.

See
http://www.gnu.org/software/emacs/manual/html_node/ccmode/Indentation-Engine-Basics.html#Indentation-Engine-Basics

Adding such analysis could be a big job but in my experience Emacs does
produce a reasonable result.


>
> Best regards.
>
> ______________________________**_________________
> Devel mailing list
> Devel at lists.geany.org
> https://lists.geany.org/cgi-**bin/mailman/listinfo/devel<https://lists.geany.org/cgi-bin/mailman/listinfo/devel>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20130716/288ceb8e/attachment-0001.html>


More information about the Devel mailing list