From: Junio C Hamano Date: Tue, 28 Mar 2006 09:50:10 GMT Subject: Re: [PATCH] xdiff: Show function names in hunk headers. Message-ID: <7vvetykiel.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <7vfyl3m7vy.fsf@assigned-by-dhcp.cox.net> Junio C Hamano writes: > Mark Wooding writes: >... >> + (isalpha((unsigned char)*rec) || /* identifier? */ >> + *rec == '_' || /* also identifier? */ >> + *rec == '(' || /* lisp defun? */ >> + *rec == '#')) { /* #define? */ > > GNU diff -p does "^[[:alpha:]$_]"; personally I think any line > that does not begin with a whitespace is good enough. Obviously I was not thinking. That should at least be "any line that begins with a non-whitespace and has a few characters", to omit "{\n" and catch "int main()\n" in: int main() { printf("Hello, world.\n"); } ;-).