[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: |
Sat, 16 Mar 2019 15:30:22 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>> Given the increasing presence of cl-defuns, cl-defgenerics, etc. in the
>> emacs.git sources, would it be welcome to additionally match cl-lib
>> macros?
>
> Yes, please,
I can think of three ways to achieve this given the lack of shy groups
in EREs:
0. Match "def" anywhere within the form's name:
diff --git a/autogen.sh b/autogen.sh
index 40d0c37b11..c931103249 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -317,7 +317,7 @@ hooks=
# Configure 'git diff' hunk header format.
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 .*)'
1. Match any column 0 form:
diff --git a/autogen.sh b/autogen.sh
index 40d0c37b11..860d980c95 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -317,7 +317,7 @@ hooks=
# Configure 'git diff' hunk header format.
git_config diff.elisp.xfuncname \
- '^\(def[^[:space:]]+[[:space:]]+([^()[:space:]]+)'
+ '^\([^[:space:]]+[[:space:]]+([^()[:space:]]+)'
git_config 'diff.m4.xfuncname' '^((m4_)?define|A._DEFUN(_ONCE)?)\([^),]*'
git_config 'diff.make.xfuncname' \
'^([$.[:alnum:]_].*:|[[:alnum:]_]+[[:space:]]*([*:+]?[:?]?|!?)=|define .*)'
1. Capture the whole header line, including the form:
diff --git a/autogen.sh b/autogen.sh
index 40d0c37b11..c28c8928ed 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -317,7 +317,7 @@ hooks=
# Configure 'git diff' hunk header format.
git_config diff.elisp.xfuncname \
- '^\(def[^[:space:]]+[[:space:]]+([^()[:space:]]+)'
+ '^(\((cl-)?def[^[:space:]]+[[:space:]]+[^()[:space:]]+)'
git_config 'diff.m4.xfuncname' '^((m4_)?define|A._DEFUN(_ONCE)?)\([^),]*'
git_config 'diff.make.xfuncname' \
'^([$.[:alnum:]_].*:|[[:alnum:]_]+[[:space:]]*([*:+]?[:?]?|!?)=|define .*)'
Which is preferred? Is there a better way?
Thanks,
--
Basil
- Should diff.elisp.xfuncname match cl-lib macros?, Basil L. Contovounesios, 2019/03/15
- Re: Should diff.elisp.xfuncname match cl-lib macros?, Stefan Monnier, 2019/03/15
- Re: Should diff.elisp.xfuncname match cl-lib macros?,
Basil L. Contovounesios <=
- Re: Should diff.elisp.xfuncname match cl-lib macros?, Eli Zaretskii, 2019/03/16
- Re: Should diff.elisp.xfuncname match cl-lib macros?, Stefan Monnier, 2019/03/16
- Re: Should diff.elisp.xfuncname match cl-lib macros?, Eli Zaretskii, 2019/03/16
- Re: Should diff.elisp.xfuncname match cl-lib macros?, Stefan Monnier, 2019/03/16
- Re: Should diff.elisp.xfuncname match cl-lib macros?, Basil L. Contovounesios, 2019/03/16
- Re: Should diff.elisp.xfuncname match cl-lib macros?, Basil L. Contovounesios, 2019/03/16
- Re: Should diff.elisp.xfuncname match cl-lib macros?, Eli Zaretskii, 2019/03/16
- Re: Should diff.elisp.xfuncname match cl-lib macros?, Andreas Schwab, 2019/03/17
- Re: Should diff.elisp.xfuncname match cl-lib macros?, Basil L. Contovounesios, 2019/03/17
- Re: Should diff.elisp.xfuncname match cl-lib macros?, Juri Linkov, 2019/03/17