git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] diff: chapter and part in funcname for tex
@ 2008-08-02  6:35 Giuseppe Bilotta
  2008-08-02 11:55 ` Giuseppe Bilotta
  0 siblings, 1 reply; 4+ messages in thread
From: Giuseppe Bilotta @ 2008-08-02  6:35 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Giuseppe Bilotta

This patch enhances the tex funcname by adding support for
chapter and part sectioning commands. It also matches
the starred version of the sectioning commands.
---

I know that technically speaking this should have been two
separate patches because they are two logically separate
changes, but they are really rather braindead so please
accept them as one :)

 diff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/diff.c b/diff.c
index c253015..776bce1 100644
--- a/diff.c
+++ b/diff.c
@@ -1380,7 +1380,7 @@ static struct builtin_funcname_pattern {
 			"^[ 	]*\\(\\([ 	]*"
 			"[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
 			"[ 	]*([^;]*\\)$" },
-	{ "tex", "^\\(\\\\\\(sub\\)*section{.*\\)$" },
+	{ "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\?{.*\\)$" },
 	{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
 };
 
-- 
1.5.6.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] diff: chapter and part in funcname for tex
  2008-08-02  6:35 [PATCH] diff: chapter and part in funcname for tex Giuseppe Bilotta
@ 2008-08-02 11:55 ` Giuseppe Bilotta
  2008-08-02 17:59   ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Giuseppe Bilotta @ 2008-08-02 11:55 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Giuseppe Bilotta

This patch enhances the tex funcname by adding support for
chapter and part sectioning commands. It also matches
the starred version of the sectioning commands.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>

---

Resend, with Signed-off-by: line

 diff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/diff.c b/diff.c
index c253015..776bce1 100644
--- a/diff.c
+++ b/diff.c
@@ -1380,7 +1380,7 @@ static struct builtin_funcname_pattern {
 			"^[ 	]*\\(\\([ 	]*"
 			"[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
 			"[ 	]*([^;]*\\)$" },
-	{ "tex", "^\\(\\\\\\(sub\\)*section{.*\\)$" },
+	{ "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\?{.*\\)$" },
 	{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
 };
 
-- 
1.5.6.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] diff: chapter and part in funcname for tex
  2008-08-02 11:55 ` Giuseppe Bilotta
@ 2008-08-02 17:59   ` Junio C Hamano
  2008-08-02 21:56     ` Giuseppe Bilotta
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2008-08-02 17:59 UTC (permalink / raw)
  To: Giuseppe Bilotta; +Cc: git

Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:

> This patch enhances the tex funcname by adding support for
> chapter and part sectioning commands. It also matches
> the starred version of the sectioning commands.
>
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
>
> ---
>
> Resend, with Signed-off-by: line
>
>  diff.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/diff.c b/diff.c
> index c253015..776bce1 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -1380,7 +1380,7 @@ static struct builtin_funcname_pattern {
>  			"^[ 	]*\\(\\([ 	]*"
>  			"[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
>  			"[ 	]*([^;]*\\)$" },
> -	{ "tex", "^\\(\\\\\\(sub\\)*section{.*\\)$" },
> +	{ "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\?{.*\\)$" },

Ok on idea, but NAK on implementation.

"A\?" to mean 0 or one "A" in BRE is GNU extention and we try to avoid it.
"A\{0,1\}" is equivalent and we already use the bound notation in "java"
section, so perhaps this is an Ok replacement?

	{ "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$" },

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] diff: chapter and part in funcname for tex
  2008-08-02 17:59   ` Junio C Hamano
@ 2008-08-02 21:56     ` Giuseppe Bilotta
  0 siblings, 0 replies; 4+ messages in thread
From: Giuseppe Bilotta @ 2008-08-02 21:56 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Giuseppe Bilotta

This patch enhances the tex funcname by adding support for
chapter and part sectioning commands. It also matches
the starred version of the sectioning commands.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---

As recommended by Junio, use \{0,1\} instead of \?

 diff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/diff.c b/diff.c
index c253015..776bce1 100644
--- a/diff.c
+++ b/diff.c
@@ -1380,7 +1380,7 @@ static struct builtin_funcname_pattern {
 			"^[ 	]*\\(\\([ 	]*"
 			"[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
 			"[ 	]*([^;]*\\)$" },
-	{ "tex", "^\\(\\\\\\(sub\\)*section{.*\\)$" },
+	{ "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$" },
 	{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
 };
 
-- 
1.5.6.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-08-02 21:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-02  6:35 [PATCH] diff: chapter and part in funcname for tex Giuseppe Bilotta
2008-08-02 11:55 ` Giuseppe Bilotta
2008-08-02 17:59   ` Junio C Hamano
2008-08-02 21:56     ` Giuseppe Bilotta

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 NNTP newsgroup(s).