Open
Description
I work on a system with an extended version of the SQL language, and I'd like to be able to teach sql-indent to understand this system. There's no way to provide an external language definition, though, as one can with cc-mode. For example, we have functions that look like this. (Docstring snipped for concision.)
(defun sqlind-beginning-of-directive ()
(let ((rx (cl-case (and (boundp 'sql-product) sql-product)
(ms sqlind-ms-directive)
(sqlite sqlind-sqlite-directive)
(oracle sqlind-sqlplus-directive)
(t nil))))
(when rx
(save-excursion
(when (re-search-backward rx nil 'noerror)
(forward-line 1)
(point))))))
IMHO, it'd be better to just dispatch on the product somehow (with defgeneric, a function table, o something) instead of hardcoding the case here. This way, it'd be possible to much more easily customize the system.