I have an HTML page with it turned on html-mode. I call a function sgml-validateto check for any markup errors. It is based on compilation-mode. I want to remove some warnings from compilation output, so I wrote a function and connected it to compilation-filter-hook(this variable is not documented, but compilation-filtercalls it). Everything is working. My problem is how can I ensure that the filter function is only called when the compilation process starts on an HTML page (via sgml-validate)?
html-mode
sgml-validate
compilation-mode
compilation-filter-hook
compilation-filter
I see two methods, but none of them worked:
major-mode
*compilation*
grep+
It looks like you can tell smgl-validate to have it filter before doing all the other operations. For example:
(defadvice sgml-validate (around fix-filtering command activate) (let ((return-value ad-do-it)) (filter-function return-value))))
, , compilation-start mode, . , compilation-mode, , .
compilation-start
mode
, sgml-validate mode compilation-start, .
(, ).