Hi there,
On 23 Apr 2019, at 12:01 AM, Dr Eberhard W Lisse el@lisse.na wrote:
Yes, and no.
I would like to know which (common) ones are possible, or how I can find that (which ones are installed/available) out, so that if I use "mate -" in a pipe I can "load" the required bundle and make use of its facilities without having to resort to selecting filetype with the mouse.
Probably something of use to others as well.
Maybe use something like this insane one-liner:
find ~/Library/Application\ Support/TextMate/Managed/Bundles -depth 1 -name '*.tmbundle' -exec bash -c 'tput bold; echo -n "$(defaults read "{}/info.plist" name): "; tput sgr0; echo $(if cd "{}/Syntaxes" 2>/dev/null; then for syntax in *.plist *.tmLanguage; do if [ -f "${syntax}" ]; then /usr/libexec/PlistBuddy -c "Print :fileTypes" "${syntax}" 2>/dev/null | grep -v "[{}]"; fi; done; fi)' ;
Actually, please don't try that. You've been warned! :-) But probably something like this could be done properly in a shell script. Just scan the available bundles and extract the required information directly. I'm not sure what "filetype" the mate command actually wants (maybe using the scopeName from the syntax file would be the right choice?).
Just providing some wild ideas…