Diff with each change in the whole "function"
I found that diff has an option "--show-function-line=regexp" that "finds the nearest unchanged line that precedes each hunk of differences and matches the given regular expression. Then it adds that line to the end of the line of asterisks in the context format".
This is nice but what I'd like is different: I'd like the context for each hunk of differences to include from the nearest line that precedes it and matches the given regular expression, until the line before the nearest line that follows that hunk of differences and matches the same regular expression, so that the whole "function" is visible.
Also, when there are multiple changes in the same function, I'd like not to duplicate the entire function for each change, but have those changes together in one common context of that whole "function". I am using quotation marks because I want a regexp which is not for an actual programming language but some for kind of text header.
Does anyone know some way to do that from diff or a similar existing tool or combination of tools?

