diff --git a/autogen.sh b/autogen.sh index 40d0c37b11..b5722bdb12 100755 --- a/autogen.sh +++ b/autogen.sh @@ -316,8 +316,16 @@ hooks= # Configure 'git diff' hunk header format. +# This xfuncname is based on Git's built-in 'cpp' pattern. +# The first line rejects jump targets and access declarations. +# The second line matches top-level functions and methods. +# The third line matches preprocessor and DEFUN macros. +git_config diff.cpp.xfuncname \ +'!^[ \t]*[A-Za-z_][A-Za-z_0-9]*:[[:space:]]*($|/[/*]) +^((::[[:space:]]*)?[A-Za-z_][A-Za-z_0-9]*[[:space:]]*\(.*)$ +^((#define[[:space:]]|DEFUN).*)$' git_config diff.elisp.xfuncname \ - '^\(def[^[:space:]]+[[:space:]]+([^()[:space:]]+)' + '^\([^[:space:]]*def[^[:space:]]+[[:space:]]+([^()[:space:]]+)' git_config 'diff.m4.xfuncname' '^((m4_)?define|A._DEFUN(_ONCE)?)\([^),]*' git_config 'diff.make.xfuncname' \ '^([$.[:alnum:]_].*:|[[:alnum:]_]+[[:space:]]*([*:+]?[:?]?|!?)=|define .*)'