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

I can only offer this kludge below, which binds C-c a to opening the corresponding xql file, C-c a the adp file and so on. Additions highly welcome.
;; define shortcuts to open the corresponding xql/tcl/whatever file to
;; the current open buffer.
(defun acs-find-file (fileext) "open acs buffer" (interactive "s")
  (find-file (concat (substring (buffer-file-name) 0 (string-match "(.tcl|.adp|-postgresql.xql|-oracle.xql|.xql)$" (buffer-file-name))) fileext)))


;; don't know how to bind functions with parameters to keystrokes, so
;; i have to define one function for each possible parameter value
(defun acs-find-file-adp () "" (interactive) (acs-find-file ".adp"))
(defun acs-find-file-tcl () "" (interactive) (acs-find-file ".tcl"))
(defun acs-find-file-postgresql () "" (interactive) (acs-find-file "-postgresql.xql"))
(defun acs-find-file-oracle () "" (interactive) (acs-find-file "-oracle.xql"))
(defun acs-find-file-xql () "" (interactive) (acs-find-file ".xql"))

(global-set-key "C-ca" 'acs-find-file-adp)
(global-set-key "C-ct" 'acs-find-file-tcl)
(global-set-key "C-cp" 'acs-find-file-postgresql)
(global-set-key "C-co" 'acs-find-file-oracle)
(global-set-key "C-cx" 'acs-find-file-xql)