Bug 144354 - filetype is not stored
Summary: filetype is not stored
Status: RESOLVED INTENTIONAL
Alias: None
Product: kate
Classification: Applications
Component: part (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-17 19:51 UTC by Maciej Pilichowski
Modified: 2012-10-29 03:37 UTC (History)
2 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 Maciej Pilichowski 2007-04-17 19:51:52 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    SuSE RPMs

Actually this bug bites hard in KDevelop, not in Kate itself. I open some file, I set explicitly what type it is (it influences indentation for example), and when I quit Kdevelop and run it again -- I have to set it again.
Comment 1 Matthew Woehlke 2007-04-17 20:13:33 UTC
You can change the file type detection yourself: configure editor->file types. Do you have an example where the defaults are incorrect/broken, or where this is not working correctly?

I don't that we want to persist the file type between sessions; that's what file types and mode lines are for.
Comment 2 Maciej Pilichowski 2007-04-17 21:10:13 UTC
> You can change the file type detection yourself: configure editor->file
> types.

This report does not touch this issue. Whatever your definition is, if you change the filetype for one, given file, this information is not stored. And it should be. For example you have file x.cpp -- it is almost for 120% C++ file. But in some case you would like to treat it differently, not all x.cpp files, but one, specified.

> Do you have an example where the defaults are incorrect/broken,

Yes. 
https://bugs.kde.org/show_bug.cgi?id=144353

> I don't that we want to persist the file type between sessions; that's what
> file types and mode lines are for. 

I do not understand that sentence, you don't want the filetype to be persistent, because filetype are (by design?) not to be persistent?
But without remembering them you are forced to change the definitions -- not very useful (and time consuming). I would like that KDevelop remember that my.x is C++ file, it does not make sense to define type for it.
 

Comment 3 Maciej Pilichowski 2007-04-17 21:14:32 UTC
PS. Or in other words I would like to see that several attributes are "attached" to file in Kdevelop:
* highlighting
* indentation
* filetype
* encoding
* all those I don't remember now :-)

This way, when I close a project, and open it again, I am in _exactly_ the same place I finished last time. And this is good, filetype definition is system-wide, my files in project, are well, only those files, so it is fast&safe.
Comment 4 Anders Lund 2007-04-17 21:28:16 UTC
Setting the file type manually shouldn't be a normal usage. You should rather 
use the mimetype/filename patterns in the file type configuration to select 
the file type.
Comment 5 Maciej Pilichowski 2007-04-17 22:14:39 UTC
Wait, wait. We are going in wrong direction -- there are two issues
a) setting filetype manually
b) remembering what was being set

ad.a) I don't discuss that, but there is such feature, so I would like to use it

ad.b) since I manually set it it would be useful to store it

Please do not maneuver me :-))) into (a), I am just saying, if there is such thing as (a) (good or bad), it should not be lost (after all it is the whole point of setting something -- like encoding).
 
I hope this would not end up discussing removing (a) :-))).
Comment 6 Matthew Woehlke 2007-04-17 23:29:57 UTC
> PS. Or in other words I would like to see that several attributes are "attached"
> to file in Kdevelop:
> * highlighting
> * indentation
> * filetype
> * encoding

"that's what ... mode lines are for." :-)
http://kate-editor.org/article/katepart_modelines
Comment 7 Maciej Pilichowski 2007-04-18 15:52:54 UTC
Matthew thank you for the help, however... :-)

Note, that when somebody open a file in KDevelop and reset the encodings... well, it is all she/he has to know. 

I've just take a look at the doc you pointed out, and it appears that you have to notice that filetype storing does not work (and that's bad -- because you can lost some work, besides -- the principle of the least surprise should not be violated), you have to find the solution, you have to learn how to write a modeline spec...
Comparing it to encodings mentioned above it is quite a challenge, especially when you are close to your deadline with work.

Storing filetype in KDevelop seems to be quite natural feature -- KDevelop already stores a list of opened files and their attributes.
Comment 8 Anders Lund 2007-04-18 22:45:42 UTC
On Wednesday 18 April 2007, Maciej Pilichowski wrote:
> Note, that when somebody open a file in KDevelop


Cool, file a bug with KDevelop please.

In fact, Kate does have a system for saving 'meta data' like configuration 
between sessions. KDevelop should too, if that is a likely need of its users.
Comment 9 Matthew Woehlke 2007-04-18 23:48:56 UTC
...or we could re-assign this one?

Does Kate save meta-data between closing and re-opening a file?
Comment 10 Andreas Pakulat 2008-07-01 20:09:52 UTC
This belongs into the editor part, doing it in kdevelop doesn't make sense as it would've to be done in each other app as well.
Comment 11 Christoph Cullmann 2012-10-29 03:37:52 UTC
That is no Kate issue. If the Problem till ocurs for you in Kdevelop, please open a New bug for it er reopen this one and reassign.