linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* v flags/modifiers in scripts/tags.sh
@ 2014-08-15  4:43 Masatake YAMATO
  2014-08-16  5:30 ` Dirk Gouders
  0 siblings, 1 reply; 9+ messages in thread
From: Masatake YAMATO @ 2014-08-15  4:43 UTC (permalink / raw)
  To: linux-kbuild

Hi,

I have a question about v flags/modifiers in scripts/tags.sh.

quoted from scripts/tags.sh:

    exuberant()
    {
	    ...
	    --regex-c='/DEFINE_(MUTEX|SEMAPHORE|SPINLOCK)\((\w*)/\2/v/'	\
	    ...
    }

    emacs()
    {
	    ...
	    --regex='/DEFINE_HASHTABLE\((\w*)/\1/v/'
	    ...
    }


v is specified at the end of the regular expressions.

As far as I read the man pages of ctags and etags.  there is no such
flags/modifiers. What is v?

(I am a co-maintainer of fishman-ctags, a fork of exuberant-ctags.
 So I'm interested in implementing v flags in ctags if it is useful.)

Masatake YAMATO

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

* Re: v flags/modifiers in scripts/tags.sh
  2014-08-15  4:43 v flags/modifiers in scripts/tags.sh Masatake YAMATO
@ 2014-08-16  5:30 ` Dirk Gouders
  2014-08-16  5:56   ` [PATCH 0/3] scripts/tags.sh: some emacs fixes Dirk Gouders
  2014-08-17 15:05   ` v flags/modifiers in scripts/tags.sh Masatake YAMATO
  0 siblings, 2 replies; 9+ messages in thread
From: Dirk Gouders @ 2014-08-16  5:30 UTC (permalink / raw)
  To: Masatake YAMATO; +Cc: linux-kbuild

Masatake YAMATO <yamato@redhat.com> writes:

> Hi,
>
> I have a question about v flags/modifiers in scripts/tags.sh.
>
> quoted from scripts/tags.sh:
>
>     exuberant()
>     {
> 	    ...
> 	    --regex-c='/DEFINE_(MUTEX|SEMAPHORE|SPINLOCK)\((\w*)/\2/v/'	\
> 	    ...
>     }
>
>     emacs()
>     {
> 	    ...
> 	    --regex='/DEFINE_HASHTABLE\((\w*)/\1/v/'
> 	    ...
>     }
>
>
> v is specified at the end of the regular expressions.
>
> As far as I read the man pages of ctags and etags.  there is no such
> flags/modifiers. What is v?
>
> (I am a co-maintainer of fishman-ctags, a fork of exuberant-ctags.
>  So I'm interested in implementing v flags in ctags if it is useful.)

'v' is called a 'kind-spec' in exuberant ctags/etags; the emacs
incarnations don't know about it and actually produce warnings.

As you are co-maintaining a fork of exuberant-ctags, I wonder if your
fork probably already knows about kind-specs.

Anyway, because of your question, I noticed some more problems with the
emacs part of tags.sh; patches coming shortly.

Dirk

>
> Masatake YAMATO
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 0/3] scripts/tags.sh: some emacs fixes
  2014-08-16  5:30 ` Dirk Gouders
@ 2014-08-16  5:56   ` Dirk Gouders
  2014-08-16  5:56     ` [PATCH 1/3] scripts/tags.sh: Don't specify kind-spec for emacs' ctags/etags Dirk Gouders
                       ` (2 more replies)
  2014-08-17 15:05   ` v flags/modifiers in scripts/tags.sh Masatake YAMATO
  1 sibling, 3 replies; 9+ messages in thread
From: Dirk Gouders @ 2014-08-16  5:56 UTC (permalink / raw)
  To: Michal Marek; +Cc: Dirk Gouders, Masatake YAMATO, linux-kbuild

A question of Masatake Yamato made me notice some warnings when using
the emacs versions of ctags/etags.

I fixed them in three steps to highlight what the emacs versions of
the programs do not like; patch #2 basically extends another commit
that removed macros that regular expressions meant to match.

Dirk Gouders (3):
  scripts/tags.sh: Don't specify kind-spec for emacs' ctags/etags
  scripts/tags.sh: remove *PCGFLAGS regular expressions
  scripts/tags.sh: fix DEFINE_HASHTABLE in emacs case

 scripts/tags.sh | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

-- 
2.0.2


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

* [PATCH 1/3] scripts/tags.sh: Don't specify kind-spec for emacs' ctags/etags
  2014-08-16  5:56   ` [PATCH 0/3] scripts/tags.sh: some emacs fixes Dirk Gouders
@ 2014-08-16  5:56     ` Dirk Gouders
  2014-08-18  2:50       ` Masatake YAMATO
  2014-08-16  5:56     ` [PATCH 2/3] scripts/tags.sh: remove *PCGFLAGS regular expressions Dirk Gouders
  2014-08-16  5:56     ` [PATCH 3/3] scripts/tags.sh: fix DEFINE_HASHTABLE in emacs case Dirk Gouders
  2 siblings, 1 reply; 9+ messages in thread
From: Dirk Gouders @ 2014-08-16  5:56 UTC (permalink / raw)
  To: Michal Marek; +Cc: Dirk Gouders, Masatake YAMATO, linux-kbuild, Jianyu Zhan

Emacs' ctags/etags don't know about kind-spec in --regex and
produce warnings:

etags: invalid regexp modifier `v', ignoring
etags: invalid regexp modifier `/', ignoring

Fix it by removing kind-spec for the emacs case.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
Inspired-by: Masatake YAMATO <yamato@redhat.com>
---
 scripts/tags.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/tags.sh b/scripts/tags.sh
index cbfd269..7279897 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -263,7 +263,7 @@ emacs()
 	--regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/'		\
 	--regex='/PCI_OP_READ(\([a-z]*[a-z]\).*[1-4])/pci_bus_read_config_\1/' \
 	--regex='/PCI_OP_WRITE(\([a-z]*[a-z]\).*[1-4])/pci_bus_write_config_\1/'\
-	--regex='/DEFINE_HASHTABLE\((\w*)/\1/v/'
+	--regex='/DEFINE_HASHTABLE\((\w*)/\1/'
 
 	all_kconfigs | xargs $1 -a                              \
 	--regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'
-- 
2.0.2


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

* [PATCH 2/3] scripts/tags.sh: remove *PCGFLAGS regular expressions
  2014-08-16  5:56   ` [PATCH 0/3] scripts/tags.sh: some emacs fixes Dirk Gouders
  2014-08-16  5:56     ` [PATCH 1/3] scripts/tags.sh: Don't specify kind-spec for emacs' ctags/etags Dirk Gouders
@ 2014-08-16  5:56     ` Dirk Gouders
  2014-08-19 15:56       ` Johannes Weiner
  2014-08-16  5:56     ` [PATCH 3/3] scripts/tags.sh: fix DEFINE_HASHTABLE in emacs case Dirk Gouders
  2 siblings, 1 reply; 9+ messages in thread
From: Dirk Gouders @ 2014-08-16  5:56 UTC (permalink / raw)
  To: Michal Marek; +Cc: Dirk Gouders, Johannes Weiner, Masatake YAMATO, linux-kbuild

Commit 0a31bc97c80c3fa8 (mm: memcontrol: rewrite uncharge API)
removed the macros {TEST,SET,CLEAR,TESTCLEAR}PCFLAG.  Remove
corresponding entries from tags.sh -- in the emacs case they also
produced warnigs because of unmatched '\('.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
Inspired-by: Masatake YAMATO <yamato@redhat.com>
---
 scripts/tags.sh | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/scripts/tags.sh b/scripts/tags.sh
index 7279897..0f61bd7 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -193,10 +193,6 @@ exuberant()
 	--regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \
 	--regex-c++='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \
 	--regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/'		\
-	--regex-c++='/TESTPCGFLAG\(([^,)]*).*/PageCgroup\1/'		\
-	--regex-c++='/SETPCGFLAG\(([^,)]*).*/SetPageCgroup\1/'		\
-	--regex-c++='/CLEARPCGFLAG\(([^,)]*).*/ClearPageCgroup\1/'	\
-	--regex-c++='/TESTCLEARPCGFLAG\(([^,)]*).*/TestClearPageCgroup\1/' \
 	--regex-c='/PCI_OP_READ\((\w*).*[1-4]\)/pci_bus_read_config_\1/' \
 	--regex-c='/PCI_OP_WRITE\((\w*).*[1-4]\)/pci_bus_write_config_\1/' \
 	--regex-c='/DEFINE_(MUTEX|SEMAPHORE|SPINLOCK)\((\w*)/\2/v/'	\
@@ -256,10 +252,6 @@ emacs()
 	--regex='/__CLEARPAGEFLAG_NOOP(\([^,)]*\).*/__ClearPage\1/' \
 	--regex='/TESTCLEARFLAG_FALSE(\([^,)]*\).*/TestClearPage\1/' \
 	--regex='/__TESTCLEARFLAG_FALSE(\([^,)]*\).*/__TestClearPage\1/' \
-	--regex='/TESTPCGFLAG\(([^,)]*).*/PageCgroup\1/'	\
-	--regex='/SETPCGFLAG\(([^,)]*).*/SetPageCgroup\1/'	\
-	--regex='/CLEARPCGFLAG\(([^,)]*).*/ClearPageCgroup\1/'	\
-	--regex='/TESTCLEARPCGFLAG\(([^,)]*).*/TestClearPageCgroup\1/' \
 	--regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/'		\
 	--regex='/PCI_OP_READ(\([a-z]*[a-z]\).*[1-4])/pci_bus_read_config_\1/' \
 	--regex='/PCI_OP_WRITE(\([a-z]*[a-z]\).*[1-4])/pci_bus_write_config_\1/'\
-- 
2.0.2


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

* [PATCH 3/3] scripts/tags.sh: fix DEFINE_HASHTABLE in emacs case
  2014-08-16  5:56   ` [PATCH 0/3] scripts/tags.sh: some emacs fixes Dirk Gouders
  2014-08-16  5:56     ` [PATCH 1/3] scripts/tags.sh: Don't specify kind-spec for emacs' ctags/etags Dirk Gouders
  2014-08-16  5:56     ` [PATCH 2/3] scripts/tags.sh: remove *PCGFLAGS regular expressions Dirk Gouders
@ 2014-08-16  5:56     ` Dirk Gouders
  2 siblings, 0 replies; 9+ messages in thread
From: Dirk Gouders @ 2014-08-16  5:56 UTC (permalink / raw)
  To: Michal Marek; +Cc: Dirk Gouders, Masatake YAMATO, linux-kbuild, Jianyu Zhan

The emacs --regex for DEFINE_HASHTABLE produced a warning because of
an unmatched '\('.  Further, the whole entry did not work, because the
regex needs to match from the beginning of a line, including keywords
like 'static'.  Finally, '\w' should not be used, because it
stops at underscores which are often part of variable names in C,
resulting in wrong entries in the tags file.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
Inspired-by: Masatake YAMATO <yamato@redhat.com>
---
 scripts/tags.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/tags.sh b/scripts/tags.sh
index 0f61bd7..fd651f9 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -255,7 +255,7 @@ emacs()
 	--regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/'		\
 	--regex='/PCI_OP_READ(\([a-z]*[a-z]\).*[1-4])/pci_bus_read_config_\1/' \
 	--regex='/PCI_OP_WRITE(\([a-z]*[a-z]\).*[1-4])/pci_bus_write_config_\1/'\
-	--regex='/DEFINE_HASHTABLE\((\w*)/\1/'
+	--regex='/[^#]*DEFINE_HASHTABLE(\([^,)]*\)/\1/'
 
 	all_kconfigs | xargs $1 -a                              \
 	--regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'
-- 
2.0.2


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

* Re: v flags/modifiers in scripts/tags.sh
  2014-08-16  5:30 ` Dirk Gouders
  2014-08-16  5:56   ` [PATCH 0/3] scripts/tags.sh: some emacs fixes Dirk Gouders
@ 2014-08-17 15:05   ` Masatake YAMATO
  1 sibling, 0 replies; 9+ messages in thread
From: Masatake YAMATO @ 2014-08-17 15:05 UTC (permalink / raw)
  To: dirk; +Cc: linux-kbuild

On Sat, 16 Aug 2014 07:30:51 +0200, Dirk Gouders <dirk@gouders.net> wrote:
> Masatake YAMATO <yamato@redhat.com> writes:
> 
>> Hi,
>>
>> I have a question about v flags/modifiers in scripts/tags.sh.
>>
>> quoted from scripts/tags.sh:
>>
>>     exuberant()
>>     {
>> 	    ...
>> 	    --regex-c='/DEFINE_(MUTEX|SEMAPHORE|SPINLOCK)\((\w*)/\2/v/'	\
>> 	    ...
>>     }
>>
>>     emacs()
>>     {
>> 	    ...
>> 	    --regex='/DEFINE_HASHTABLE\((\w*)/\1/v/'
>> 	    ...
>>     }
>>
>>
>> v is specified at the end of the regular expressions.
>>
>> As far as I read the man pages of ctags and etags.  there is no such
>> flags/modifiers. What is v?
>>
>> (I am a co-maintainer of fishman-ctags, a fork of exuberant-ctags.
>>  So I'm interested in implementing v flags in ctags if it is useful.)
> 
> 'v' is called a 'kind-spec' in exuberant ctags/etags; the emacs
> incarnations don't know about it and actually produce warnings.
> 
> As you are co-maintaining a fork of exuberant-ctags, I wonder if your
> fork probably already knows about kind-specs.


man ctags:
       ...
       --regex-<LANG>=/regexp/replacement/[kind-spec/][flags]
            The /regexp/replacement/ pair define a regular expression replacement pattern, similar in style  to  sed
        ...

I misunderstood it as a flag. I now understood it means variable.
Sorry for making noise.

Masatake YAMATO

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

* Re: [PATCH 1/3] scripts/tags.sh: Don't specify kind-spec for emacs' ctags/etags
  2014-08-16  5:56     ` [PATCH 1/3] scripts/tags.sh: Don't specify kind-spec for emacs' ctags/etags Dirk Gouders
@ 2014-08-18  2:50       ` Masatake YAMATO
  0 siblings, 0 replies; 9+ messages in thread
From: Masatake YAMATO @ 2014-08-18  2:50 UTC (permalink / raw)
  To: dirk; +Cc: mmarek, linux-kbuild, nasa4836

Warnings are gone.

Tested-by: Masatake YAMATO <yamato@redhat.com>

On Sat, 16 Aug 2014 07:56:56 +0200, Dirk Gouders <dirk@gouders.net> wrote:
> Emacs' ctags/etags don't know about kind-spec in --regex and
> produce warnings:
> 
> etags: invalid regexp modifier `v', ignoring
> etags: invalid regexp modifier `/', ignoring
> 
> Fix it by removing kind-spec for the emacs case.
> 
> Signed-off-by: Dirk Gouders <dirk@gouders.net>
> Inspired-by: Masatake YAMATO <yamato@redhat.com>
> ---
>  scripts/tags.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/tags.sh b/scripts/tags.sh
> index cbfd269..7279897 100755
> --- a/scripts/tags.sh
> +++ b/scripts/tags.sh
> @@ -263,7 +263,7 @@ emacs()
>  	--regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/'		\
>  	--regex='/PCI_OP_READ(\([a-z]*[a-z]\).*[1-4])/pci_bus_read_config_\1/' \
>  	--regex='/PCI_OP_WRITE(\([a-z]*[a-z]\).*[1-4])/pci_bus_write_config_\1/'\
> -	--regex='/DEFINE_HASHTABLE\((\w*)/\1/v/'
> +	--regex='/DEFINE_HASHTABLE\((\w*)/\1/'
>  
>  	all_kconfigs | xargs $1 -a                              \
>  	--regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'
> -- 
> 2.0.2
> 



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

* Re: [PATCH 2/3] scripts/tags.sh: remove *PCGFLAGS regular expressions
  2014-08-16  5:56     ` [PATCH 2/3] scripts/tags.sh: remove *PCGFLAGS regular expressions Dirk Gouders
@ 2014-08-19 15:56       ` Johannes Weiner
  0 siblings, 0 replies; 9+ messages in thread
From: Johannes Weiner @ 2014-08-19 15:56 UTC (permalink / raw)
  To: Dirk Gouders; +Cc: Michal Marek, Masatake YAMATO, linux-kbuild

On Sat, Aug 16, 2014 at 07:56:57AM +0200, Dirk Gouders wrote:
> Commit 0a31bc97c80c3fa8 (mm: memcontrol: rewrite uncharge API)
> removed the macros {TEST,SET,CLEAR,TESTCLEAR}PCFLAG.  Remove
> corresponding entries from tags.sh -- in the emacs case they also
> produced warnigs because of unmatched '\('.
> 
> Signed-off-by: Dirk Gouders <dirk@gouders.net>
> Inspired-by: Masatake YAMATO <yamato@redhat.com>

Looks good, thanks.

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

end of thread, other threads:[~2014-08-19 16:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-15  4:43 v flags/modifiers in scripts/tags.sh Masatake YAMATO
2014-08-16  5:30 ` Dirk Gouders
2014-08-16  5:56   ` [PATCH 0/3] scripts/tags.sh: some emacs fixes Dirk Gouders
2014-08-16  5:56     ` [PATCH 1/3] scripts/tags.sh: Don't specify kind-spec for emacs' ctags/etags Dirk Gouders
2014-08-18  2:50       ` Masatake YAMATO
2014-08-16  5:56     ` [PATCH 2/3] scripts/tags.sh: remove *PCGFLAGS regular expressions Dirk Gouders
2014-08-19 15:56       ` Johannes Weiner
2014-08-16  5:56     ` [PATCH 3/3] scripts/tags.sh: fix DEFINE_HASHTABLE in emacs case Dirk Gouders
2014-08-17 15:05   ` v flags/modifiers in scripts/tags.sh Masatake YAMATO

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).