Hello. I'm sure the people that set this up have a better understanding of things than I do, but I'm curious…
Why are all the functions listed in the "Completions" preferences and listed in the functions.txt file that's used by the "Completions for Word" command?
Couldn't the Completions preferences be changed to something like this:
{ completionCommand = 'cut -d % -f 1 "$TM_BUNDLE_SUPPORT"/ functions.txt | grep -i "^$TM_CURRENT_WORD"'; }
So the list of functions would only need to be maintained in one place?
FWIW, I tried the above, and `"$TM_BUNDLE_SUPPORT"/functions.txt` doesn't seem to be pointing the file. I got it to work by giving the explicit complete path to the file, but that's obviously not what we want stored in the preferences by default. Could it be that TM_CURRENT_WORD is defined in the Preferences context, but TM_BUNDLE_SUPPORT is not?
--- Rob McBroom http://www.skurfer.com/ I didn't "switch" to Apple... my OS did.
On Mar 30, 2007, at 3:03 PM, Rob McBroom wrote:
FWIW, I tried the above, and `"$TM_BUNDLE_SUPPORT"/functions.txt` doesn't seem to be pointing the file. I got it to work by giving the explicit complete path to the file, but that's obviously not what we want stored in the preferences by default. Could it be that TM_CURRENT_WORD is defined in the Preferences context, but TM_BUNDLE_SUPPORT is not?
I think this is exactly what is happening. That is why all the completion commands in the LaTeX bundle have had to be in the global support directory, because that can indeed be accessed, via TM_SUPPORT_PATH. So there we do use the same way for generating the list of commands. Perhaps the PHP bundle should be doing the same? Though the idea of every bundle doing that is probably not great, in which case we can hopefully convince Allan to provide us with TM_BUNDLE_SUPPORT for Preferences items as well, if it is not too difficult.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On 30. Mar 2007, at 23:32, Charilaos Skiadas wrote:
On Mar 30, 2007, at 3:03 PM, Rob McBroom wrote:
FWIW, I tried the above, and `"$TM_BUNDLE_SUPPORT"/functions.txt` doesn't seem to be pointing the file. I got it to work by giving the explicit complete path to the file, but that's obviously not what we want stored in the preferences by default. Could it be that TM_CURRENT_WORD is defined in the Preferences context, but TM_BUNDLE_SUPPORT is not?
I think this is exactly what is happening. That is why all the completion commands in the LaTeX bundle have had to be in the global support directory, because that can indeed be accessed, via TM_SUPPORT_PATH. So there we do use the same way for generating the list of commands. Perhaps the PHP bundle should be doing the same? Though the idea of every bundle doing that is probably not great, in which case we can hopefully convince Allan to provide us with TM_BUNDLE_SUPPORT for Preferences items as well, if it is not too difficult.
It is not really feasible to add for 1.x (the lack of the variable has to do with implementation details in the caching system to give decent performance for the scope specific preference lookups). But it will be there for 2.0.
On 30 Mar 2007, at 22:32, Charilaos Skiadas wrote:
On Mar 30, 2007, at 3:03 PM, Rob McBroom wrote:
FWIW, I tried the above, and `"$TM_BUNDLE_SUPPORT"/functions.txt` doesn't seem to be pointing the file. I got it to work by giving the explicit complete path to the file, but that's obviously not what we want stored in the preferences by default. Could it be that TM_CURRENT_WORD is defined in the Preferences context, but TM_BUNDLE_SUPPORT is not?
I think this is exactly what is happening. That is why all the completion commands in the LaTeX bundle have had to be in the global support directory, because that can indeed be accessed, via TM_SUPPORT_PATH. So there we do use the same way for generating the list of commands. Perhaps the PHP bundle should be doing the same? Though the idea of every bundle doing that is probably not great, in which case we can hopefully convince Allan to provide us with TM_BUNDLE_SUPPORT for Preferences items as well, if it is not too difficult.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
I was also making the assumption that using a list for ⎋ completion would be more efficient than using a shell command, although it could be the case that the difference isn't really noticeable. However, both the functions.txt and the completions preferences file are automatically generated from PHP source, so there is no issue with maintenance.
On Apr 1, 2007, at 1:56 PM, Ciarán Walsh wrote:
I was also making the assumption that using a list for ⎋ completion would be more efficient than using a shell command, although it could be the case that the difference isn't really noticeable.
Well, it's definitely faster using the list vs. the command, but the delay is completely acceptable and it only seems to affect the first match. Using ⎋ to go through subsequent matches seems to be instant (probably due to some clever caching TextMate is doing). My slowest machine is a dual G5 though, so perhaps it should be kept as a list to ensure that it works nicely for older hardware.
However, both the functions.txt and the completions preferences file are automatically generated from PHP source, so there is no issue with maintenance.
Good to know. With that and the above in mind, it sounds like the benefits of explicitly listing everything outweigh the costs.
--- Rob McBroom http://www.skurfer.com/ I didn't "switch" to Apple... my OS did.