Forum OpenACS Development: Response to duplicate queries in .tcl, .xql, -oracle.xql, -postgresql.xql

I use ctags/etags to index the .xql and -postgresql.xql files so that in Emacs M-. can find a named query in the XQL files. This approach is not 100% fool proof as M-. finds the FIRST query by that name. This could be in a file that doesn't correspond to the .tcl file containing the named query.

Nevertheless, I find it useful in most cases. Here's the command line to add queries to the Emacs TAGS file:

find . -type f -name "*.xql" -and ! -name "*-oracle.xql" -exec etags --append -o TAGS --lang=none
      --regex='/[     ]*<(partial)?(full)?query name="([^     ]+)">//' {} ; -print

Please note that this command does NOT index the oracle files. This is because I work predominantly with PostgreSQL.