Emacs Lisp is not a declarative language, of course, but this kind of declarative logic - regular expressions which parse shell command output and apply hidden text properties or keybindings - is common in Emacs. dired does it, as does magit, and all modes based on comint, as well as just normal M-x compile.