>> Given after-context=3 it is expected to output at least 4 lines >> as documented, but adding max-count=1 makes it stop on the next >> matching line. Thanks for reporting this. Although grep's behavior is documented ("context does not include matching lines" in the node General Output Control) the documentation could be clearer and I installed the attached patch.