fix change major mode on next-error-hook