Richard Cook recently posted code for a Spotlight plugin to index Lisp files. His plugin takes what's probably the absolute simplest approach: Indexing a Lisp source file as if it were plain text.
When I saw his post I played around with Spotlight a little. I noticed that at least some, but not all of my Lisp files were already being indexed. It turned out that the ones that were being indexed were some pretty old files, ones that I'd created or edited in MCL. They had an HFS+ file type attribute (yeah, file types and creator codes still exist in HFS+) of TEXT, which seemed to lead to their kMDItemContentType being com.apple.traditional-mac-plain-text, which meant that they get indexed by one of the standard Spotlight plugins.
It seemed like there must be some easy way to convince OS X that all files with a .lisp extension are text files that can be indexed like any other text file without going to the trouble of actually writing an indexing plugin, but Pierre Mai did some experiments along those lines that didn't pan out.
I'm not convinced that there isn't some tweaky little thing that might be preventing Pierre's attempt from succeeding, but who wants dumb plaintext indexing, anyway? We should be able to do better. Function definitions, class definitions, who-calls info, package definitions, ASDF or other system definitions—There should be a bunch of neat stuff we could index.
Jonathan Wight's Spotlight plugin for Python should be an inspiration.
http://toxicsoftware.com/blog/index.php/weblog/uttypes_graph/
Posted by jjwiseman at August 30, 2005 11:09 PM