Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Man tag concept #1497

Merged
merged 26 commits into from
Jul 12, 2017
Merged

Man tag concept #1497

merged 26 commits into from
Jul 12, 2017

Conversation

masatake
Copy link
Member

@masatake masatake commented Jun 29, 2017

I wrote my understanding about "tag", "kind", "field", "extra" and "role", the core concept of ctags.

I was attracted them 2 or 3 years ago. Since then I have tried to understand the meaning of them evenryday.

@k-takata, can I ask you to review the changes as usual?

Of couse, I'm happy if other people give me feed-back, especially who wants "releasing".

@masatake masatake requested a review from k-takata June 29, 2017 16:48
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0005%) to 85.112% when pulling 20a66ac on masatake:man--tag-concept into 53e7958 on universal-ctags:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 85.122% when pulling 8da96cd on masatake:man--tag-concept into 53e7958 on universal-ctags:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 85.122% when pulling 14f3a08 on masatake:man--tag-concept into 53e7958 on universal-ctags:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.008%) to 85.123% when pulling 4ccb0f3 on masatake:man--tag-concept into cd27b61 on universal-ctags:master.

man/Makefile Outdated
@@ -51,21 +51,24 @@ pdf_pages = $(addsuffix .pdf,$(man_pages))
#
# though rst2man doesn't accept it. docutils must be fixed.
#
all: $(man_pages) $(html_pages) # $(pdf_pages)
all: $(man_pages) $(html_pages) $(pdf_pages)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be out of scope of this PR, but how about adding man, html and pdf make targets?
Currently, it is not easy to make only man pages, html or pdf.

And, do you think pdf pages should be always built?
I wonder if I should include pdf files in Windows zip packages.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Out of scope comments are really welcome if you have time :-)

man/Makefile is for us, people who are writing the pages.
For users, targets for generating files are in Makefile.am of top level.
For Unix-like platform, I think providing .1 and .7 man pages is enough.
However, for Windows, I'm not sure. If man command is not avaiable, people may want alternatives.
Such platforms may have *.mak files. So we should add "pdf" or something other targets to the .mak files. Putting html files derived from ctags.1.rst.in is another issue.

About man/Makefile, change as you wants. There is not impact on our users.
About *.mak files for platforms other than Unix-like OS, change as you wants.
About Makefile.am, make a pull request or open an issue. I would like to work together.

Any way, adding more targets to man/Makfile is good idea. I will add them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, then I think html files are enough for Windows package.

Roles
~~~~~~

*Role* is newly introduced concept in Universal-ctags. Role is a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is an "a" needed before "newly"? Not sure.

``--alias-<LANG>=`` (done)


TAG ENTRY
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"ENTRY" or "ENTRIES"? Not sure.

Inquire the output of ``--list-extras`` option for the other minor
extras.

A name associated with an extra can be used as alternative to to a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to to -> to


As an example for the C language, in order to add prototypes and
external variable declarations to the default set of tag kinds,
but exclude macros, use "--c-kinds=+px-d"; to include only tags for
functions, use "--c-kinds=f".

A name associated with a kind can be used as alternative to to a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to to -> to

REFONLY
Whether the kind is specialized for reference tagging or not.
If the column is "yes", the kind is for reference tagging, and
it is never used for definition tagging. See also "TAG ENTRY".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you change above, you also need to change this "ENTRY" to "ENTRIES".

main/options.c Outdated
#endif
#ifdef HAVE_LIBXML
"xpath",
{"xpath", "linked with library for parsing xml input"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope of this PR, but I want to know why this is "xpath" not "xml".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...Good point.

Originally, I wanted to add --xpath-<LANG>=... option like --regex-<LANG>= option; I think it is useful feature that people can create a parser with specifying xpaths.
However, I have not implemented it yet because I cannot find how the option parameters should be.
What I have done is some libxml2 base parser. In the future, when I implement --xpath-<LANG> option, the feature "xpath" is the signed that a ctags binary can accept --xpath option.

@masatake
Copy link
Member Author

masatake commented Jul 3, 2017

Updated. Thank you very much.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.008%) to 85.123% when pulling a91c54f on masatake:man--tag-concept into cd27b61 on universal-ctags:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.008%) to 85.123% when pulling b6e5cdb on masatake:man--tag-concept into cd27b61 on universal-ctags:master.

@masatake
Copy link
Member Author

masatake commented Jul 4, 2017

I added one small change.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.008%) to 85.123% when pulling e290391 on masatake:man--tag-concept into cd27b61 on universal-ctags:master.

@masatake
Copy link
Member Author

masatake commented Jul 4, 2017

I also added description about --list-{kinds,extras,fields,roles}, --kinds=, --extras=, --fields=, and --roles.

@masatake
Copy link
Member Author

masatake commented Jul 4, 2017

I will write ctags-optlib.5 next.

@masatake
Copy link
Member Author

masatake commented Jul 4, 2017

I'm sorry disturbing the branch under your reviewing. It seems that I injected something wrong change in the branch.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 85.339% when pulling 8eb82fb on masatake:man--tag-concept into 0645b2c on universal-ctags:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 85.339% when pulling 730e4b4 on masatake:man--tag-concept into 0645b2c on universal-ctags:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 85.339% when pulling b5678e3 on masatake:man--tag-concept into 0645b2c on universal-ctags:master.

@masatake masatake force-pushed the man--tag-concept branch 2 times, most recently from e39c849 to 509f7da Compare July 5, 2017 02:41
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 85.339% when pulling 509f7da on masatake:man--tag-concept into 0645b2c on universal-ctags:master.

@masatake
Copy link
Member Author

masatake commented Jul 5, 2017

@KazuakiM, I have a question about the behavior of sed on MacOSX.

In my test harness for ctags, I used following code to report the result of testing:

cat "$f" | sed -e 's|.*|	\0|'

Here $f is a diff file generated by a test case. My intention is that adding a tab character as prefix for printing each line of $f.

This works well on my GNU/Linux:

[jet@localhost]~/var/ctags% cat FOO
abc
efg
[jet@localhost]~/var/ctags% f=FOO; cat $f | sed -e 's|.*|       \0|'
	abc
	efg

However, I cannot get the same expected result on MacOSX running on Travis-CI.
Do you have any idea for making the result on MacOSX as same as that on GNU/Linux?

@KazuakiM
Copy link
Member

KazuakiM commented Jul 5, 2017

I tried the following case. Both tabs were set to prefix.

$ cat FOO
abc
efg

-- case :  \t
$ f=FOO; cat "$f" | sed -e 's|.*|\t\0|'
        abc
        efg

-- case : tab character
$ f=FOO; cat "$f" | sed -e 's|.*|        \0|'
        abc
        efg

@masatake
Copy link
Member Author

masatake commented Jul 5, 2017

@KazuakiM, thank you. Surprisingly, the command line including sed on MacOSX works well as same as hat on GNU/Linux...It seems that there is something special in MacOSX instance running at Travis-CI...

@KazuakiM
Copy link
Member

KazuakiM commented Jul 5, 2017

@masatake
I'm sorry. I overlooked important things.
I installed gnu-sed at homebrew.
Results of running on sed of Mac are as follows.

$ f=FOO; cat "$f" | sed -e 's|.*|\t\0|'
t0
t0
mabuchikazuaki $ f=FOO; cat "$f" | sed -e 's|.*|        \0|'
        0
        0

@KazuakiM
Copy link
Member

KazuakiM commented Jul 5, 2017

@masatake
And I set PATH

gnu_sed_prefix=`brew --prefix gnu-sed`
export PATH="$gnu_sed_prefix/libexec/gnubin:$PATH"

@masatake
Copy link
Member Author

masatake commented Jul 6, 2017

@KazuakiM, thank you.

Introducing gnu-sed is one of the solution but I would like to understand what happens to
avoid potential mistakes I will take in the future.

How about using & instead of \0?

$ f=FOO; cat "$f" | sed -e 's|.*|        &|'

I would like to try the above command line with the original(build-in?) sed of MacOSX.

@masatake
Copy link
Member Author

masatake commented Jul 6, 2017

@k-takata, I'm sorry but could you suspend your reviewing I asked?
This pull request includes code changes and manual-page changes.
If they are a few changes, I think it is o.k. However, now they are many.
So I will split this pull request into two: one for code and another for manual-page.
I already open #1504 as for code. After merging it, I will push --force the change for manual-page parts here.

@masatake
Copy link
Member Author

masatake commented Jul 6, 2017

@KazuakiM , I tried & as the replacement of \0 in 19b63ab.

& works well as I expected. Thank you for the cooperation.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…ANG>-kinds

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…ras-<LANG>

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Suggested by @k-takata.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…r subsection

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…and line

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
@masatake
Copy link
Member Author

masatake commented Jul 6, 2017

@k-takata, the most of all code changes are removed from this pull request.
Could you review the changes when you have time?

Thanks in advance.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 85.339% when pulling 4264660 on masatake:man--tag-concept into b5c9b76 on universal-ctags:master.

@masatake
Copy link
Member Author

@k-takata, thank you very much.

@masatake masatake merged commit 4d14afc into universal-ctags:master Jul 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants