From kwrite-devel Fri Jun 24 04:46:34 2011 From: Christoph Cullmann Date: Fri, 24 Jun 2011 04:46:34 +0000 To: kwrite-devel Subject: Re: Automatic indentation-detection in Kate and KDevelop Message-Id: <201106240646.34754.cullmann () absint ! com> X-MARC-Message: https://marc.info/?l=kwrite-devel&m=130889082913610 On Friday 24 June 2011 01:20:40 Tirtha Chatterjee wrote: > On Fri, Jun 24, 2011 at 1:13 AM, Christoph Cullmann wrote: > > On Thursday 23 June 2011 17:53:37 Erlend Hamberg wrote: > >> So if a function in a script file could be run automatically when a > >> document is opened, a simple function could simply look at the first 100 > >> (or whatever) lines and then guess settings for indentation width, > >> whether to expand tabs to spaces and. If the results are too ambiguous > >> or the file is empty, the default values can be used. > > > > And then it needs to pass them over to the indenter, which either > > requires some key/value store or changing the per document settings via > > script, which I would be both fine with. > > Do you think it would be better as a C++ module or a js script run > before calling the indenters? If it is language dependent, I would go for scripts, perhaps just an extra function in the indenters. If it is very generic (like the vim stuff Erlend mailed), it may be just a 50 lines C++ function we invoke that changes document settings on load. Greetings Christoph _______________________________________________ KWrite-Devel mailing list KWrite-Devel@kde.org https://mail.kde.org/mailman/listinfo/kwrite-devel