Hi all,
I'm a die-hard TextMate 1 user who upgraded to Catalina and am finally migrating to TextMate 2. That being said, I spent a lot of time in TextMate 1 on custom bundle snippets, themes, languages, macros, etc., so I'm hoping not to lose them.
Clicking on my original bundle brings up a TextMate 2 dialog box that asks if I want to install, but if I click "OK" it doesn't appear in the File menu, Bundle editor, or Preferences.
The TextMate wiki (https://github.com/textmate/textmate/wiki/FAQ), and past correspondence on this list, says this could be a problem with fs-events support, and suggests this fix:
rm ~/Library/Caches/com.macromates.TextMate/BundlesIndex.plist
Unfortunately there doesn't appear to be a plist in this directory--just BundlesIndex.binary. I tried deleting that to no effect.
After double clicking on my old personal bundle, a copy appears in ~/Library/Application Support/TextMate/Pristine Copy/Bundles. There is no error dialog box, and I see no errors or faults when I search for "textmate" in the Console after attempting the install.
Any help greatly appreciated!
jon
______________________________
Jon Ippolito
Professor of New Media
Co-director, Still Water
Director, Digital Curation graduate program
Does Anyone Actually Read These Titles
The University of Maine
1. open markdown document
2. select a word, say “multivariate”
2. Select Lookup Word / Selection on Wikipedia and link
EXPECTED: link to wikipedia wrapped about the selection
OBTAINED: Command error
/Users/tim/Library/Application Support/TextMate/Ruby/1.8.7/lib/ruby/1.8/net/http.rb:586:in `connect': SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: tlsv1 alert protocol version (OpenSSL::SSL::SSLError)
from /Users/tim/Library/Application Support/TextMate/Ruby/1.8.7/lib/ruby/1.8/net/http.rb:586:in `connect'
from /Users/tim/Library/Application Support/TextMate/Ruby/1.8.7/lib/ruby/1.8/net/http.rb:553:in `do_start'
from /Users/tim/Library/Application Support/TextMate/Ruby/1.8.7/lib/ruby/1.8/net/http.rb:542:in `start'
from /Users/tim/Library/Application Support/TextMate/Ruby/1.8.7/lib/ruby/1.8/open-uri.rb:242:in `open_http'
from /Users/tim/Library/Application Support/TextMate/Ruby/1.8.7/lib/ruby/1.8/open-uri.rb:616:in `buffer_open'
from /Users/tim/Library/Application Support/TextMate/Ruby/1.8.7/lib/ruby/1.8/open-uri.rb:164:in `open_loop'
from /Users/tim/Library/Application Support/TextMate/Ruby/1.8.7/lib/ruby/1.8/open-uri.rb:162:in `catch'
from /Users/tim/Library/Application Support/TextMate/Ruby/1.8.7/lib/ruby/1.8/open-uri.rb:162:in `open_loop'
from /Users/tim/Library/Application Support/TextMate/Ruby/1.8.7/lib/ruby/1.8/open-uri.rb:132:in `open_uri'
from /Users/tim/Library/Application Support/TextMate/Ruby/1.8.7/lib/ruby/1.8/open-uri.rb:518:in `open'
from /Users/tim/Library/Application Support/TextMate/Ruby/1.8.7/lib/ruby/1.8/open-uri.rb:30:in `open'
from Lookup Selection on Wikipedia and link:19:in `getWikiEntries'
from Lookup Selection on Wikipedia and link:31:in `getWikiDef'
from Lookup Selection on Wikipedia and link:37
The command is:
#!/usr/bin/env ruby18
require "#{ENV['TM_SUPPORT_PATH']}/lib/progress.rb"
require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes.rb"
require "#{ENV['TM_SUPPORT_PATH']}/lib/ui.rb"
require 'cgi'
require 'open-uri'
require 'erb'
require 'rexml/document'
def select_link(links)
linklist = links.map { |p| p['Text'] }
item = TextMate::UI.request_item :title => "Multiple Definitions", :prompt => "Please select a definition", :items => linklist
TextMate.exit_discard if item.nil?
return links[linklist.index(item)]
end # select_link
def getWikiEntries(phrase)
res = []
response = open("https://en.wikipedia.org/w/api.php?format=xml&action=opensearch&search=#{CG… <https://en.wikipedia.org/w/api.php?format=xml&action=opensearch&search=#{CG…>", "User-Agent" => "TextMate 2.0")
doc = REXML::Document.new(response.read)
doc.elements.each('SearchSuggestion/Section/Item') do |item|
hash = { }
%w[ Text Url Description ].each { |tag| item.elements.each(tag) { |inner| hash[tag] = inner.text } }
res << hash
end
res.sort { |a, b| a['Text'].downcase <=> b['Text'].downcase }
end
def getWikiDef(phrase)
entries = getWikiEntries(phrase)
TextMate.exit_show_tool_tip "No definition found" if entries.empty?
entry = entries.size > 1 ? select_link(entries) : entries.first
return entry['Url'], "Wikipedia Entry: #{entry['Text']}", phrase
end
url, title, input = getWikiDef(STDIN.read)
print ERB.new(ENV['TM_LINK_FORMAT']).result