emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master d3a0dde: Improve C and Elisp Git diff hunk headers


From: Basil L. Contovounesios
Subject: [Emacs-diffs] master d3a0dde: Improve C and Elisp Git diff hunk headers
Date: Mon, 20 May 2019 11:02:51 -0400 (EDT)

branch: master
commit d3a0ddedba53b9e2c99274c8ec125d53f991da5d
Author: Basil L. Contovounesios <address@hidden>
Commit: Basil L. Contovounesios <address@hidden>

    Improve C and Elisp Git diff hunk headers
    
    For discussion, see the following threads:
    https://lists.gnu.org/archive/html/emacs-devel/2019-03/msg00457.html
    https://lists.gnu.org/archive/html/emacs-devel/2019-05/msg00369.html
    
    * autogen.sh: Extend the built-in Git xfuncname pattern 'cpp' to
    match preprocessor and DEFUN macros, and the 'elisp' pattern to
    match cl-lib and other top-level defuns.
---
 autogen.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/autogen.sh b/autogen.sh
index f390b1a..d0f60dc 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -315,8 +315,16 @@ git_config transfer.fsckObjects true
 
 # 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 .*)'



reply via email to

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