emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Should diff.elisp.xfuncname match cl-lib macros?


From: Basil L. Contovounesios
Subject: Re: Should diff.elisp.xfuncname match cl-lib macros?
Date: Mon, 20 May 2019 16:03:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

"Basil L. Contovounesios" <address@hidden> writes:

> Juri Linkov <address@hidden> writes:
>
>> PS: Regarding the change in diff.elisp.xfuncname, can we also have
>> an appropriate regexp for diff.c.xfuncname as well, to find
>> DEFUN in C code?
>
> I'm not sure we need to define a new pattern for C files distinct from
> the built-in cpp pattern, but here's a patch extending the cpp and elisp
> patterns:
>
> 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 .*)'
>
> WDYT?

No further comments, so I pushed this to master[1].

[1: d3a0ddedba]: Improve C and Elisp Git diff hunk headers
  2019-05-20 16:02:11 +0100
  
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=d3a0ddedba53b9e2c99274c8ec125d53f991da5d

Thanks,

-- 
Basil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]