Hi,
I've been trying to make a TM command to convert text encodings (with a nice little tm_dialog that took a while to figure out but now works very well).
But for some reason, it won't read the file correctly using stdin.
So that this works: iconv -f $ENC -t UTF8 "$TM_FILEPATH"
But this does not (nor do other variations on the theme using stdin): iconv -f $ENC -t UTF8 < /dev/stdin
TM seems to do something to the text to change its encoding, so that iconv cannot convert properly.
Even stranger than that, some encodings trigger this error: /usr/bin/iconv: conversion from "SHIFT_JISX0213" unsupported /usr/bin/iconv: try '/usr/bin/iconv -l' to get the list of supported encodings
Does anyone have an idea about what's going on here?
Thanks, Alex
On 11.12.2007, at 20:45, Álex Bueno wrote:
I've been trying to make a TM command to convert text encodings (with a nice little tm_dialog that took a while to figure out but now works very well).
But for some reason, it won't read the file correctly using stdin.
So that this works: iconv -f $ENC -t UTF8 "$TM_FILEPATH"
But this does not (nor do other variations on the theme using stdin): iconv -f $ENC -t UTF8 < /dev/stdin
Please note that if you try to pipe a text from TM à la
echo "$TM_SELECTED_TEXT" | iconv -f $ENC -t UTF8
and the text was written in SJIS or what ever, that TM already read this text! That means you will loose the original coding if the encoding was not supported by TM. In your case – TM doesn't support SJIS ergo it tries to read the text as UTF-8 and the result is mojibake - cryptic things.
A way would be:
cat YOURFILE | iconv -f $ENC -t UTF8
and insert this output into TM.
TM seems to do something to the text to change its encoding, so that iconv cannot convert properly.
--Hans
Hey all, I'm just wondering about a question that seems pretty logical...
It was raised in the mailing list quite a while ago I think: http://lists.macromates.com/pipermail/textmate/2004-November/001522.html
Basically I was doing some css editing and i did a backgound-color and thought maybe there is a quicker way to select the HTML color...
The attachment discussed on the list seems to do exactly what I want (but for awk, if i understand correctly)...
But the functionality would be something like: - if color selected (rgb or #) replace color with new color else insert new color as #
I'm not a Textmate programmer (just user) so please forgive me if I don't offer to make the changes myself...
I would be happy to work with somebody to get it working though...
There is also another email just about having a color picker always available (a lá HTML editing in BBEdit): http://article.gmane.org/gmane.editors.textmate.general/21290
This would be a good start.
Cheers, -Adam
On 12 Dec 2007, at 07:27, Adam Salter wrote:
[...] the functionality would be something like:
- if color selected (rgb or #) replace color with new color
else insert new color as #
When in CSS, press ⇧⌘C for a color picker.
If the caret is already on a color, the color picker will initially show this one, and replace it when you okay the new selection.
Ok that sounds like exactly it ;)
... and now that you've told me, I've found the bundle item "Insert Color... – CSS"
Thanks again, -Adam
On 12/12/2007, at 7:35 PM, Allan Odgaard wrote:
On 12 Dec 2007, at 07:27, Adam Salter wrote:
[...] the functionality would be something like:
- if color selected (rgb or #) replace color with new color
else insert new color as #
When in CSS, press ⇧⌘C for a color picker.
If the caret is already on a color, the color picker will initially show this one, and replace it when you okay the new selection.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
that's absolutly amazing. I love this color picker. It is very well hidden, the menu description just says: "insert color" but shouldn't it be something revealing that there is actually a color picker popping up ?
and a little problem I experienced: pressing cancel at the color picker still inserts a color.
On Dec 12, 2007 9:49 AM, Adam Salter adam.q.salter@gmail.com wrote:
Ok that sounds like exactly it ;)
... and now that you've told me, I've found the bundle item "Insert Color... – CSS"
Thanks again, -Adam
On 12/12/2007, at 7:35 PM, Allan Odgaard wrote:
On 12 Dec 2007, at 07:27, Adam Salter wrote:
[...] the functionality would be something like:
- if color selected (rgb or #) replace color with new color
else insert new color as #
When in CSS, press ⇧⌘C for a color picker.
If the caret is already on a color, the color picker will initially show this one, and replace it when you okay the new selection.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 12 Dec 2007, at 14:42, Roberto Saccon wrote:
that's absolutly amazing. I love this color picker. It is very well hidden, the menu description just says: "insert color" but shouldn't it be something revealing that there is actually a color picker popping up ?
It says “Insert Color…”. The ellipsis means “a window will pop-up and ask you for more information”. So I think it is appropriately named, but you’re welcome to suggest a different title.
and a little problem I experienced: pressing cancel at the color picker still inserts a color.
Seems there was no cancel handling in the underlying function used. I have now added it and made use of it in the various color picker using commands.
On Dec 13, 2007, at 5:00 AM, Allan Odgaard wrote:
On 12 Dec 2007, at 14:42, Roberto Saccon wrote:
that's absolutly amazing. I love this color picker. It is very well hidden, the menu description just says: "insert color" but shouldn't it be something revealing that there is actually a color picker popping up ?
It says “Insert Color…”. The ellipsis means “a window will pop-up and ask you for more information”. So I think it is appropriately named, but you’re welcome to suggest a different title.
Maybe "Insert Color with Color Picker…" ?
—Thomas Aylott – subtleGradient—
On Dec 13, 2007, at 9:54 AM, Thomas Aylott - subtleGradient wrote:
Maybe "Insert Color with Color Picker…" ?
I think just "Color Picker…" would give you a pretty good idea what it does.
--- Rob McBroom http://www.skurfer.com/ I didn't "switch" to Apple... my OS did.
On 13 Dec 2007, at 16:23, Rob McBroom wrote:
On Dec 13, 2007, at 9:54 AM, Thomas Aylott - subtleGradient wrote:
Maybe "Insert Color with Color Picker…" ?
I think just "Color Picker…" would give you a pretty good idea what it does.
Should we also change “Open…” into “File Requester…” or maybe “Open File with File Requester…” ;)
I've lost track of this thread but the osx standard for opening this dialogue is "show colours."
(and when I say "standard" keep in mind I have never read the HIGs... it's just what shows up in the "Format" menu.)
j.
On 13-Dec-07, at 3:51 PM, Allan Odgaard wrote:
On 13 Dec 2007, at 16:23, Rob McBroom wrote:
On Dec 13, 2007, at 9:54 AM, Thomas Aylott - subtleGradient wrote:
Maybe "Insert Color with Color Picker…" ?
I think just "Color Picker…" would give you a pretty good idea what it does.
Should we also change “Open…” into “File Requester…” or maybe “Open File with File Requester…” ;)
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 13 Dec 2007, at 21:59, Jeff Newman wrote:
I've lost track of this thread but the osx standard for opening this dialogue is "show colours." [...]
There is a difference though, the Format → Show Colors opens the color picker to be used as a utility window / inspector.
I.e. it is meant to be kept open and it will reflect the “active” element and manipulate that element, when the user interacts with it.
This is also why the title has no ellipsis. I.e. it is not a one-shot thing as it is in TM.
On Dec 13, 2007, at 3:51 PM, Allan Odgaard wrote:
On 13 Dec 2007, at 16:23, Rob McBroom wrote:
On Dec 13, 2007, at 9:54 AM, Thomas Aylott - subtleGradient wrote:
Maybe "Insert Color with Color Picker…" ?
I think just "Color Picker…" would give you a pretty good idea what it does.
Should we also change “Open…” into “File Requester…” or maybe “Open File with File Requester…” ;)
I can understand why you prefer the "Insert Color..." version, it is more consistent with other such instances within TM, and it should be clear enough to anyone, and matching TextMate's "task-oriented" approach. That said, "color picker" is a common phrase describing exactly this kind of construct, and thus closer, in my opinion, to what the user would expect to find. I remember I was also looking for the words "color picker" when needing such a command. By contract, the Open/Save menus are not really referred by anyone as "File Requesters", at least not that I know of.
So I would tend slightly towards the "Color Picker..." variant.
On the other hand, if I were a user wanting to find how to work with colors, I would type: cmd-ctrl-T, followed by "color". This would lead me to the correct command in either case.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On Dec 13, 2007, at 4:11 PM, Charilaos Skiadas wrote:
On Dec 13, 2007, at 3:51 PM, Allan Odgaard wrote:
On 13 Dec 2007, at 16:23, Rob McBroom wrote:
On Dec 13, 2007, at 9:54 AM, Thomas Aylott - subtleGradient wrote:
Maybe "Insert Color with Color Picker…" ?
I think just "Color Picker…" would give you a pretty good idea what it does.
Should we also change “Open…” into “File Requester…” or maybe “Open File with File Requester…” ;)
I can understand why you prefer the "Insert Color..." version, it is more consistent with other such instances within TM, and it should be clear enough to anyone, and matching TextMate's "task-oriented" approach. That said, "color picker" is a common phrase describing exactly this kind of construct, and thus closer, in my opinion, to what the user would expect to find. I remember I was also looking for the words "color picker" when needing such a command. By contract, the Open/Save menus are not really referred by anyone as "File Requesters", at least not that I know of.
So I would tend slightly towards the "Color Picker..." variant.
On the other hand, if I were a user wanting to find how to work with colors, I would type: cmd-ctrl-T, followed by "color". This would lead me to the correct command in either case.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
I think this just gets into the basic discoverability of the app. There's really no way to know what exactly will happen half the time. People get used to bundle items simply inserting snippets of text, or displaying information. The concept that a command is going to open an actual color picker for them to choose a color isn't obvious.
I certainly don't have a solution to the problem. But I would like to see more UI based stuff in the future. With toolbars or palettes that are customized for the current scope.
I guess I could finally do that with TMTOOLS now. If only it didn't crash TextMate half the time ;)
—Thomas Aylott – subtleGradient—
On 2007-Dec-13, at 3:51 PM, Allan Odgaard wrote:
On 13 Dec 2007, at 16:23, Rob McBroom wrote:
On Dec 13, 2007, at 9:54 AM, Thomas Aylott - subtleGradient wrote:
Maybe "Insert Color with Color Picker…" ?
I think just "Color Picker…" would give you a pretty good idea what it does.
Should we also change “Open…” into “File Requester…” or maybe “Open File with File Requester…” ;)
Ha. OK, I see what you're getting at. Let me put it this way. I wanted this very feature the other day when messing with some CSS, but didn't "discover" it (to use Thomas's word). I only know about it because of this thread. I ended up using Xylescope or something to get the right color. If it had been labeled "Color Picker…", I would have instead said "Oh, cool. It *is* there."
Of course, when *I'm* the one developing an application, I expect the users to adapt to the correct terminology, rather than me doing something incorrectly to meet expectations. :)
"Show Colors…" (*with* the ellipsis) is better than what we've got, but it still would leave me wondering if it was going to be a drop- down full of hexadecimal numbers or what. I guess some people would say the same about "color picker" though. How about "Open a Graphical Color Selection Panel in a Separate Window That Will Insert a Hexadecimal Representation of the Selected Color when Closed…"?
--- Rob McBroom http://www.skurfer.com/
On 14.12.2007, at 05:42, Rob McBroom wrote:
On 2007-Dec-13, at 3:51 PM, Allan Odgaard wrote:
On 13 Dec 2007, at 16:23, Rob McBroom wrote:
On Dec 13, 2007, at 9:54 AM, Thomas Aylott - subtleGradient wrote:
Maybe "Insert Color with Color Picker…" ?
I think just "Color Picker…" would give you a pretty good idea what it does.
Should we also change “Open…” into “File Requester…” or maybe “Open File with File Requester…” ;)
"Show Colors…" (*with* the ellipsis) is better than what we've got, [...] same about "color picker" though. How about "Open a Graphical Color Selection Panel in a Separate Window That Will Insert a Hexadecimal Representation of the Selected Color when Closed…"?
If the naming of commands is really an issue I'd suggest for TM 3.0 to allow to have two names for a command:
short form as menu item name "Insert #COLOUR…"
and (optional)
a long form as Tooltip/extra optional column (which should also be searchable) "Open a Graphical Color Selection Panel in a Separate Window That Will Insert a Hexadecimal Representation of the Selected Color when Closed if TextMate – while inserting – is not crashing and one understands the inserted string as a sequence characters not as fundamental particle of the Theory of Everything…"
--Hans
I think "Insert Color..." is a good name. And to find some command within TM bundles you can use Quicksilver. Turn on User Interface Access plugin and do "Current Application..." -> "Show Menu Items" (i setup it as Option+Space trigger - its pefect!). For now you can search trough current application menu items by name.
BTW I hear that Leo have Help menu item that can search trough menu items... Still on Tiger so can't check it.
P.S. "Select Bundle Items..." works too but QS just works better ;) One example: i need to create new blog post (Markdown). "Select Bundle Item..." can't help just becouse this command isnt' within bundle. So i press Option+Space and type 'bmark' and QS finds Blog Post (Markdown) command. All i need to do - press Return.
I consider "Show" to be passive. That is, any information displayed will no be editable.
In this case, I want to "Select," or "Choose," or "Specify," or "Define," or... whatEVER, a color.
I want to be able to enter/add a color value by way of the process of visually referencing a color. While I want to SEE a representation of the color I'm choosing, simply "Showing" a color it is not what I want to do.
eo
On Dec 13, 2007, at 8:42 PM, Rob McBroom wrote:
On 2007-Dec-13, at 3:51 PM, Allan Odgaard wrote:
On 13 Dec 2007, at 16:23, Rob McBroom wrote:
On Dec 13, 2007, at 9:54 AM, Thomas Aylott - subtleGradient wrote:
Maybe "Insert Color with Color Picker…" ?
I think just "Color Picker…" would give you a pretty good idea what it does.
Should we also change “Open…” into “File Requester…” or maybe “Open File with File Requester…” ;)
Ha. OK, I see what you're getting at. Let me put it this way. I wanted this very feature the other day when messing with some CSS, but didn't "discover" it (to use Thomas's word). I only know about it because of this thread. I ended up using Xylescope or something to get the right color. If it had been labeled "Color Picker…", I would have instead said "Oh, cool. It *is* there."
Of course, when *I'm* the one developing an application, I expect the users to adapt to the correct terminology, rather than me doing something incorrectly to meet expectations. :)
"Show Colors…" (*with* the ellipsis) is better than what we've got, but it still would leave me wondering if it was going to be a drop- down full of hexadecimal numbers or what. I guess some people would say the same about "color picker" though. How about "Open a Graphical Color Selection Panel in a Separate Window That Will Insert a Hexadecimal Representation of the Selected Color when Closed…"?
Rob McBroom http://www.skurfer.com/