Bug 200121 - Per Project Formatting/Editor settings
Summary: Per Project Formatting/Editor settings
Status: CONFIRMED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: sourceformatter (show other bugs)
Version: unspecified
Platform: Mandriva RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
: 193007 206086 249194 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-07-14 03:05 UTC by Alan Jones
Modified: 2014-11-16 21:22 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Jones 2009-07-14 03:05:31 UTC
Version:           3.9.94 (using KDE 4.2.4)
Compiler:          gcc 4.3.2 
OS:                Linux
Installed from:    Mandriva RPMs

Hi All,

I find when working on different projects I often am giving requirements regarding formatting including tabs etc.

It would be great if a project could either override particular settings or if we could get per project settings related to formatting.

If you need any further details let me know.

Cheers,

Alan
Comment 1 Andreas Pakulat 2009-07-14 10:48:47 UTC
Project specific formatting settings for our formatter plugin are definetly on the 'todo' list, problem is creating a GUI that easily lets you move settings between global and project.

However, there's no way currently to do that for the embedded editor and the settings you see under Settings->Configure Editor. Reason is simple: Kate doesn't allow to read these settings on a per Document basis, it only allows to read them once from the global editor instance. And I don't think we should keep a separate editor instance for each project around.

Assigning to astyle for now, as we (AFAIK) already have a bugreport open for the general GUI/framework part in kdevplatform.
Comment 2 Milian Wolff 2009-07-14 16:10:46 UTC
Kate allows per-view and per-document settings. We could create a per-project setting which would just set per-document stuff for files in the project.
Comment 3 Andreas Pakulat 2009-07-14 17:25:09 UTC
(In reply to comment #2)
> Kate allows per-view and per-document settings. We could create a per-project
> setting which would just set per-document stuff for files in the project.

Are you talking about the SessionConfigInterface? Didn't see that one.
Comment 4 Milian Wolff 2009-07-14 17:48:32 UTC
I didn't have a look at the underlying interface structure, but just looked at kate itself:

- You have per-document stuff, i.e. via kate modelines or the kate config file (latter could be handy for projects maybe?). I think the interface for that was the VariableInterface or something like that
- Via the kate menu you can set most/all configurations on a per-view basis. I bet this is accessible via one interface or the other...
Comment 5 Andreas Pakulat 2009-07-14 18:04:38 UTC
(In reply to comment #4)
> I didn't have a look at the underlying interface structure, but just looked at
> kate itself:
> 
> - You have per-document stuff, i.e. via kate modelines

Those are read by katepart when opening a file, no public API for that.

> or the kate config file (latter could be handy for projects maybe?).

The problem is that, unless the SessionConfigInterface does cover all settings of kate, katepart might simply use KGlobal::config() which gives it the applications config file.

> I think the interface for that was
> the VariableInterface or something like that

Thats for querying variables only, not for setting them. There's the ConfigInterface on the view, but that would mean we'd have to search through kate's sources for the right config keys. Not an option IMHO.

> - Via the kate menu you can set most/all configurations on a per-view basis. I
> bet this is accessible via one interface or the other...

Those are all contributed by katepart itself to the menu and hence don't need public API accessible from somewhere else. And that public API really doesn't exist.

So our only bet is the SessionConfigInterface.
Comment 6 David Nolden 2009-07-14 18:53:08 UTC
For the kate part, one could just put a ".kateconfig" or similar file containing the modeline into the project directory (I think there is such a thing).

The important missing part is that we cannot yet do that for the real source formatters (astyle etc).
Comment 7 Andreas Pakulat 2009-09-03 13:39:20 UTC
*** Bug 206086 has been marked as a duplicate of this bug. ***
Comment 8 Niko Sams 2010-01-31 18:51:11 UTC
Would it make sense to store this configuration in the (public) project.kdev4 file for easy sharing with other developers?
Comment 9 Andreas Pakulat 2010-01-31 22:41:24 UTC
No, at least not by default - IMHO. In particular, I want to have my formatter settings global, I actually want them outside the session even as I share the settings among various sessions.

Basically this is among the same line as the other global and project settings. We need some way for th user to move settings around between global, session, project and developer.
Comment 10 Milian Wolff 2011-07-11 12:29:29 UTC
*** Bug 193007 has been marked as a duplicate of this bug. ***
Comment 11 Milian Wolff 2011-07-11 12:29:43 UTC
*** Bug 249194 has been marked as a duplicate of this bug. ***