On 22.08.2012, at 21:00, textmate-request@lists.macromates.com wrote:
On Aug 14, 2012, at 5:47 AM, Yuan Jiang sleetdrop@gmail.com wrote:
[?] I want Textmate to show current file's encoding in the status bar
This one I don?t really like. Everybody should be using UTF-8 so for most users adding encoding to the status bar is IMO just adding noise.
It's not about (your?) personal preference, it's about what you're confronted with in real-world usage.
Not everyone (you work with) uses UTF8, sometimes people you work with save files in the wrong encoding and you have trouble down the line with your project because of that.
Am 22.08.2012 um 14:09 schrieb Max Lein:
On 22.08.2012, at 21:00, textmate-request@lists.macromates.com wrote:
On Aug 14, 2012, at 5:47 AM, Yuan Jiang sleetdrop@gmail.com wrote:
[?] I want Textmate to show current file's encoding in the status bar
This one I don?t really like. Everybody should be using UTF-8 so for most users adding encoding to the status bar is IMO just adding noise.
It's not about (your?) personal preference, it's about what you're confronted with in real-world usage.
Not everyone (you work with) uses UTF8, sometimes people you work with save files in the wrong encoding and you have trouble down the line with your project because of that.
I totally agree with that. Arguing what one *should* be using, we could also remove the language selector (because "one should know what programming language he is looking at") or the tab size selector (because "one should not care because TM will always do it right") from the status bar ;-)
However, back with TM1 there was the "File -> Re-open with encoding" menu item which was very useful to me in the kind of situation that you describe. Getting this menu item back in TM2 would IMO serve the purpose and spare precious space on the status bar.
Cheers, Henning Holtschneider -- LocaNet oHG - http://www.loca.net Baroper Straße 239 b, D-44227 Dortmund tel +49 231 91596-25, fax +49 231 91596-55 sip 25@voip.loca.net
Registergericht Amtsgericht Dortmund HRA 14208 Geschäftsführer Sven Haufe, Henning Holtschneider
On Aug 22, 2012, at 3:32 PM, Henning Holtschneider henning@loca.net wrote:
Not everyone (you work with) uses UTF8, sometimes people you work with save files in the wrong encoding and you have trouble down the line with your project because of that.
Which is why TextMate 2 throws up a dialog each time you open a non-UTF-8 file so you are made aware of it.
However, back with TM1 there was the "File -> Re-open with encoding" menu item which was very useful to me in the kind of situation that you describe. Getting this menu item back in TM2 would IMO serve the purpose and spare precious space on the status bar.
This menu item was required in 1.x because it would take a guess at your encoding and sometimes get it wrong.
TextMate 2 does not do this, it forces you to tell what encoding the file is using (if it is not UTF-8 and encoding has not been set for the file via extended attributes or .tm_properties) — I have previously mentioned how I think this can be improved by not using a modal dialog, but instead show a top bar with the encoding guessed at and a pop-down to change it — this would pretty much serve the same functionality.
Not everyone (you work with) uses UTF8, sometimes people you work with save files in the wrong encoding and you have trouble down the line with your project because of that.
Why not just create .tm_properties variable i.e. $TM_ENCODING that can be assigned to windowTitle, similar to $TM_SCM_BRANCH?
Cheers,
This idea is acceptable.
On Mon, Aug 27, 2012 at 1:57 AM, Adam Strzelecki ono@java.pl wrote:
Not everyone (you work with) uses UTF8, sometimes people you work with save files in the wrong encoding and you have trouble down the line with your project because of that.
Why not just create .tm_properties variable i.e. $TM_ENCODING that can be assigned to windowTitle, similar to $TM_SCM_BRANCH?
Cheers,
Adam Strzelecki
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On Aug 26, 2012, at 7:57 PM, Adam Strzelecki ono@java.pl wrote:
Not everyone (you work with) uses UTF8, sometimes people you work with save files in the wrong encoding and you have trouble down the line with your project because of that.
Why not just create .tm_properties variable i.e. $TM_ENCODING that can be assigned to windowTitle, similar to $TM_SCM_BRANCH?
That might work as a poor man’s solution. I’m still not really sure I follow the reasoning behind the request though, let me explain…
When you open a file in TextMate it does the following:
1. Does the file have a byte order mark (UTF-8, UTF-16, or UTF-32)? → file is UTF-nn
2. Does file have the com.apple.TextEncoding extended attribute set? → read encoding from this attribute and try use that
3. Is the file valid UTF-8? → file is UTF-8 (with 99.9999999% certainty)
4. Does we have an ‘encoding’ setting for the current file (via .tm_properties)? → try use that encoding setting
5. Ask user what the encoding is.
The request is to show the outcome from the above in the title bar. Why?
There should be little reason to second guess 1-3. Item 4 is 100% under the user’s control, require explicit action to setup, and he can inspect it. Item 5 will visually open a list of encodings and ask the user to check one.
Additionally, if you hit ⇧⌘S then up comes a panel with line endings, encoding, and byte order mark controls. The default values of these controls are based on what was obtained during load.
On 2012-08-27 08:10, Allan Odgaard wrote:
The request is to show the outcome from the above in the title bar. Why?
There should be little reason to second guess 1-3. Item 4 is 100% under the user’s control, require explicit action to setup, and he can inspect it. Item 5 will visually open a list of encodings and ask the user to check one.
My only experience is dealing with different line ending conventions, but sometimes it's nice to know what the editor's guess was. Even when it's correct I've found it nice to know that a file had CRLF vs LF line endings. Maybe especially when the editor's guess is correct. "Now why the heck is the compiler choking on that file? It looks perfectly fine to me... Oh, crap, someone saved it with CRLF newlines." (*)
Anyway, just a way I've used the information in other editors. Yes, there are other ways to get it, but having it in the status bar or some such can be convenient. It's not something that comes up often enough these days for me to worry about, but I can see where a more heterogeneous shop might often deal with different endings and encodings.
(*)Yes, ideally the compiler would give a better error. In practice, though, tools which can recognize different line endings tend to handle them gracefully. The ones which can't tend to throw generic syntax errors whenever the input file isn't perfectly well-formed.
On Wed, Aug 22, 2012 at 9:09 AM, Max Lein realoreocookie@gmx.de wrote:
On 22.08.2012, at 21:00, textmate-request@lists.macromates.com wrote:
On Aug 14, 2012, at 5:47 AM, Yuan Jiang sleetdrop@gmail.com wrote:
[?] I want Textmate to show current file's encoding in the status bar
This one I don?t really like. Everybody should be using UTF-8 so for most users adding encoding to the status bar is IMO just adding noise.
It's not about (your?) personal preference, it's about what you're confronted with in real-world usage.
Maybe only show the encoding in the status bar if it's not UTF-8?
Not everyone (you work with) uses UTF8, sometimes people you work with save files in the wrong encoding and you have trouble down the line with your project because of that.
Isn't the output from the file command good enough? If so, you can use the bundle editor to create a simple command that runs file "$TM_FILEPATH" and shows its output in a tooltip. Oh, and add a nice keyboard shortcut too :)
-- :: dip --