Hi,
I'm experiencing some problems with b5 and the Services menu: TextMate doesn't seem to register itself in the menu and the contents of Services > Insert are greyed out when accessed from within TextMate. Any ideas? Known b5 problem?
Also I'd like to know if future TM version will let you, as an option, create new UTF-8 files with BOM? (I know it preserves existing BOMs ...)
Thanks in advance!
Kind regards
Christian
On Mar 10, 2005, at 12:52, Christian Bogen wrote:
I'm experiencing some problems with b5 and the Services menu: TextMate doesn't seem to register itself in the menu and the contents of Services > Insert are greyed out when accessed from within TextMate. Any ideas? Known b5 problem?
All the services I have work on selected text, which does work for TextMate. Could tell me which service inserts text?
Also I'd like to know if future TM version will let you, as an option, create new UTF-8 files with BOM? (I know it preserves existing BOMs ...)
Why do you need this?
Am 10.03.2005 um 22:20 schrieb Allan Odgaard:
All the services I have work on selected text, which does work for TextMate. Could tell me which service inserts text?
Well, I thought the »Insert« service was part of OS X. It inserts various date and time stamps. Right now Unicode Checker and DEVONtechnology's WordService are the only extra services I have installed (it could be part of WordService).
Also I'd like to know if future TM version will let you, as an option, create new UTF-8 files with BOM? (I know it preserves existing BOMs ...)
Why do you need this?
In the past I've had problems with UTF-8 being correctly recognized by various editors if the BOM is not set. Is there any potential harm in being able to (optionally) set the BOM? (Plus TextWrangler offers this ... ;-)
Christian
PS: Shouldn't TM register itself in the Service menu? It doesn't do that here ...
At 10:37 PM +0100 3/10/05, Christian Bogen wrote:
PS: Shouldn't TM register itself in the Service menu? It doesn't do that here ...
I have "Edit in Textmate" in my Services menu. It's not there for yours?
- Eric
********************************************************************* Quoting Eric Hsu on [Thursday, March 10, 2005, -0800]
I have "Edit in Textmate" in my Services menu. It's not there for yours?
Hum, I had it earlier, but after reinstalling my system and TextMate it seems to have dissappeared.
On Mar 10, 2005, at 22:37, Christian Bogen wrote:
Well, I thought the »Insert« service was part of OS X. It inserts various date and time stamps. Right now Unicode Checker and DEVONtechnology's WordService are the only extra services I have installed (it could be part of WordService).
I'll look into these... but I take it that the services you have which work on selected text are available for TextMate?
[...] create new UTF-8 files with BOM? [...]
Why do you need this?
[...] Is there any potential harm in being able to (optionally) set the BOM? [...]
Well, I'd add options to the GUI, which I try to keep to a minimum, I'd add code to my source base which adds complexity and requires maintenance/testing, and I'd send a signal that UTF-8 files can/should have BOM, which I really think they shouldn't.
PS: Shouldn't TM register itself in the Service menu? It doesn't do that here ...
No, it shouldn't. But there's an external service that gives you an “Edit in TextMate…” in the services menu, it can be downloaded here: http://macromates.com/textmate/files/TextMate.service.zip
Starting from next beta, I'll keep this service on the disk image, unfortunately I still haven't found a good way to actually incorporate it into TextMate.
And the service is btw at version 1.1: I updated it so that it should now be better at bringing the application to front after editing the text, and I renamed it to TextMate Service.service, to avoid problems with AppleScript.
Am 10.03.2005 um 23:09 schrieb Allan Odgaard:
I'll look into these... but I take it that the services you have which work on selected text are available for TextMate?
Yes, they work as expected!
Well, I'd add options to the GUI, which I try to keep to a minimum, I'd add code to my source base which adds complexity and requires maintenance/testing, and I'd send a signal that UTF-8 files can/should have BOM, which I really think they shouldn't.
Oh well, it's your baby! :-) Anyway, I'm no expert on whether UTF files should have BOM or not. I saw it first in TW 2.0 and thought it might come in handy to have the choice. I admit I have bit of a »Swiss-Army-knive-mentality« there.
(GUI-wise it could be solved quite simply by adding an extra encoding to the list (one UTF-8 encoding with and one without BOM). BTW, TW offers this for UTF-16, too, and generally seems to default to setting the BOM.)
But, like I said, whether the BOM is »good« or »bad« is to decide for the Unicode experts ...
PS: Shouldn't TM register itself in the Service menu? It doesn't do that here ...
No, it shouldn't. But there's an external service that gives you an “Edit in TextMate…” in the services menu, it can be downloaded here: http://macromates.com/textmate/files/TextMate.service.zip
Ah, thanks -- I didn't know that. (Did I overlook a hint to that effect somewhere?)
Starting from next beta, I'll keep this service on the disk image, unfortunately I still haven't found a good way to actually incorporate it into TextMate.
That's a good idea! (I just assumed there was some kind of »documented standard procedure« for OS X/Cocoa apps to offer functions via the Services menu, but I'm no programmer ...)
Again, thank you!
Christian
Am 10.03.2005 um 23:55 schrieb Christian Bogen:
Am 10.03.2005 um 23:09 schrieb Allan Odgaard:
Well, I'd add options to the GUI, which I try to keep to a minimum, I'd add code to my source base which adds complexity and requires maintenance/testing, and I'd send a signal that UTF-8 files can/should have BOM, which I really think they shouldn't.
I got curious and poked around a bit: It seems that in UTF-8 files the BOM can be harmfull (in a way) after all:
Q: Can a UTF-8 data stream contain the BOM character (in UTF-8 form)? If yes, then can I still assume the remaining UTF-8 bytes are in big-endian order?
A: Yes, UTF-8 can contain a BOM. However, it makes no difference as to the endianness of the byte stream. UTF-8 always has the same byte order. An initial BOM is only used as a signature — an indication that an otherwise unmarked text file is in UTF-8. Note that some recipients of UTF-8 encoded data do not expect a BOM. Where UTF-8 is used transparently in 8-bit environments, the use of a BOM will interfere with any protocol or file format that expects specific ASCII characters at the beginning, such as the use of "#!" of at the beginning of Unix shell scripts. [AF] & [MD]
http://www.unicode.org/faq/utf_bom.html#29
So I guess not setting it should remain the default, whether it's setting is available as an option or not. Of course allowing for manipulation of the BOM would also make it easier to remove it if necessary (in a more convenient way than transferring the file contents to a new empty file via copy & paste). But, admittedly, that's probably not an important feature ... ;-)
No, it shouldn't. But there's an external service that gives you an “Edit in TextMate…” in the services menu, it can be downloaded here: http://macromates.com/textmate/files/TextMate.service.zip
Just something that caught my attention while being happy about the TM.service: It's greyed out when I select text existing mails in Mail.app, seems to work only when composing new ones (ie. in the mail editor). Is that a bug or a feature? (I frequently grab text out of mails for further work in a text editor.)
Christian
On Mar 11, 2005, at 1:18, Christian Bogen wrote:
I got curious and poked around a bit: It seems that in UTF-8 files the BOM can be harmfull (in a way) after all: [...]
So I guess not setting it should remain the default, whether it's setting is available as an option or not.
Yes, the BOM in UTF-8 is redundant, can be harmful, and UTF-8 files can be recognized with 99.9% certainty w/o the signature. For UTF-16 OTOH it makes a lot of sense, and really should always be there -- and TM will indeed also put it there :)
Of course allowing for manipulation of the BOM would also make it easier to remove it if necessary
I added the preservation of BOM in UTF-8 files recently because of a request, but as expressed earlier, I really think TM should always just strip it from UTF-8 files (and I may revert to that if I'm not given persuasive evidence that current behavior is good).
Actually, I would like to remove all the options during save and always save as UTF-8 + LF endings, but that probably wouldn't go down so well ;)
[ TextMate service ]
[...] It's greyed out when I select text existing mails in Mail.app, seems to work only when composing new ones (ie. in the mail editor). Is that a bug or a feature?
The service offers to edit and return text, so it will not work for non-editable (but selected) text. Unfortunately as the system is currently made, I'd need to make a new service (i.e. entry in the services menu) if I were to also offer a 'new document with selected text' service.
Am 11.03.2005 um 01:36 schrieb Allan Odgaard:
Actually, I would like to remove all the options during save and always save as UTF-8 + LF endings, but that probably wouldn't go down so well ;)
Ahh, so you're actually trying to build the most »zen-like« editor for OS X, don't you? Just when I was going to ask for the support of more encodings ... <sigh> ... No, just kidding, don't worry (for now)! ;^)
Christian
On 11 mars 05, at 01:36, Allan Odgaard wrote:
On Mar 11, 2005, at 1:18, Christian Bogen wrote:
[ TextMate service ]
[...] It's greyed out when I select text existing mails in Mail.app, seems to work only when composing new ones (ie. in the mail editor). Is that a bug or a feature?
The service offers to edit and return text, so it will not work for non-editable (but selected) text. Unfortunately as the system is currently made, I'd need to make a new service (i.e. entry in the services menu) if I were to also offer a 'new document with selected text' service.
Two Contextual Menu commands I made can deal with this:
"Open text in Textmate" puts the selected or clipboard text in a temp file and opens it in TM. "New TextMate file here w/Clipboard" make a new file where you triggered it, lets you choose the name of the file and opens it in TM.
These commands (and others) are in the repository, instructions are in the readme.
http://macromates.com/svn/Bundles/trunk/Tools/CM
Unlike services, you can't have a KB shortcut to trigger CM, but you can make a droplet with it.
If it's only in Mail.app you can make an Applescript put it in "~/Library/Scripts/Mail Scripts" and assign a shortcut to it by adding something like "___ctl-Y.scpt" at the end of the script's name (This can be done only for Mail.app... weird).