restoring grep-mode + EMMS commentaries
checking that variables exist before using them