From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Should diff.elisp.xfuncname match cl-lib macros?
Date: Sat, 16 Mar 2019 15:30:22 +0000 [thread overview]
Message-ID: <87a7hug7ld.fsf@tcd.ie> (raw)
In-Reply-To: <jwvy35g80dt.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 15 Mar 2019 14:21:14 -0400")
[-- Attachment #1: Type: text/plain, Size: 356 bytes --]
Stefan Monnier <monnier@iro.umontreal.ca> 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:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: prefix.patch --]
[-- Type: text/x-diff, Size: 539 bytes --]
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 .*)'
[-- Attachment #3: Type: text/plain, Size: 30 bytes --]
1. Match any column 0 form:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: any.patch --]
[-- Type: text/x-diff, Size: 523 bytes --]
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 .*)'
[-- Attachment #5: Type: text/plain, Size: 56 bytes --]
1. Capture the whole header line, including the form:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: whole.patch --]
[-- Type: text/x-diff, Size: 532 bytes --]
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 .*)'
[-- Attachment #7: Type: text/plain, Size: 65 bytes --]
Which is preferred? Is there a better way?
Thanks,
--
Basil
next prev parent reply other threads:[~2019-03-16 15:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-15 16:42 Should diff.elisp.xfuncname match cl-lib macros? Basil L. Contovounesios
2019-03-15 18:21 ` Stefan Monnier
2019-03-16 3:56 ` Richard Stallman
2019-03-16 15:33 ` cl-defun vs defun (was: Should diff.elisp.xfuncname match cl-lib macros?) Basil L. Contovounesios
2019-03-17 2:41 ` Richard Stallman
2019-03-16 15:30 ` Basil L. Contovounesios [this message]
2019-03-16 16:42 ` Should diff.elisp.xfuncname match cl-lib macros? Eli Zaretskii
2019-03-16 17:12 ` Stefan Monnier
2019-03-16 17:33 ` Eli Zaretskii
2019-03-16 18:14 ` Stefan Monnier
2019-03-16 21:55 ` Basil L. Contovounesios
2019-03-16 21:54 ` Basil L. Contovounesios
2019-03-17 3:37 ` Eli Zaretskii
2019-03-17 8:14 ` Andreas Schwab
2019-03-17 15:22 ` Basil L. Contovounesios
2019-03-17 21:33 ` Juri Linkov
2019-03-18 1:14 ` Stefan Monnier
2019-03-18 21:02 ` Juri Linkov
2019-05-13 1:40 ` Basil L. Contovounesios
2019-05-20 15:03 ` Basil L. Contovounesios
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a7hug7ld.fsf@tcd.ie \
--to=contovob@tcd.ie \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).