* etags for C++
@ 2002-02-19 19:41 Tak Ota
2002-02-20 22:13 ` Richard Stallman
0 siblings, 1 reply; 17+ messages in thread
From: Tak Ota @ 2002-02-19 19:41 UTC (permalink / raw)
I always forget the find command syntax to create TAGS file and refer
to info page for etags. Following is the example in the info page
that I rely on. Many times, I struggle to incorporate C++ files.
find . -name "*.[chCH]" -print | etags -
I suppose use of C++ is very common these days. Can we modernize this
part of the document like this?
*** maintaining.texi.orig Wed Dec 26 13:49:41 2001
--- maintaining.texi Tue Feb 19 11:12:05 2002
***************
*** 441,447 ****
by typing a dash in place of the file names, like this:
@smallexample
! find . -name "*.[chCH]" -print | etags -
@end smallexample
Use the option @samp{--language=@var{name}} to specify the language
--- 441,447 ----
by typing a dash in place of the file names, like this:
@smallexample
! find . -iregex '.*\.\(c\|h\|cpp\|cc\)' -print | etags -
@end smallexample
Use the option @samp{--language=@var{name}} to specify the language
Or, is it worth introducing a new command in etags.el that runs find
and etags?
-Tak
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-19 19:41 etags for C++ Tak Ota
@ 2002-02-20 22:13 ` Richard Stallman
2002-02-21 6:47 ` Eli Zaretskii
0 siblings, 1 reply; 17+ messages in thread
From: Richard Stallman @ 2002-02-20 22:13 UTC (permalink / raw)
Cc: emacs-devel
find . -name "*.[chCH]" -print | etags -
I suppose use of C++ is very common these days.
.C and .H were used for C++ files. Has that convention changed?
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-20 22:13 ` Richard Stallman
@ 2002-02-21 6:47 ` Eli Zaretskii
2002-02-21 7:34 ` Tak Ota
0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2002-02-21 6:47 UTC (permalink / raw)
Cc: Takaaki.Ota, emacs-devel
On Wed, 20 Feb 2002, Richard Stallman wrote:
> find . -name "*.[chCH]" -print | etags -
>
> I suppose use of C++ is very common these days.
>
> .C and .H were used for C++ files. Has that convention changed?
No, it didn't change.
However, it's possible that capital .C and .H are not used on
case-insensitive filesystems such as on Windows.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-21 6:47 ` Eli Zaretskii
@ 2002-02-21 7:34 ` Tak Ota
2002-02-21 7:45 ` Tak Ota
0 siblings, 1 reply; 17+ messages in thread
From: Tak Ota @ 2002-02-21 7:34 UTC (permalink / raw)
Cc: rms, emacs-devel
Thu, 21 Feb 2002 08:47:11 +0200 (IST): Eli Zaretskii <eliz@is.elta.co.il> wrote:
>
> On Wed, 20 Feb 2002, Richard Stallman wrote:
>
> > find . -name "*.[chCH]" -print | etags -
> >
> > I suppose use of C++ is very common these days.
> >
> > .C and .H were used for C++ files. Has that convention changed?
>
> No, it didn't change.
>
> However, it's possible that capital .C and .H are not used on
> case-insensitive filesystems such as on Windows.
GNU make 3.79.1 knows .C, .cc and .cpp as the C++ files. And it seems
to treat .cc as the canonical one and consolidate .C and .cpp into
.cc.
-Tak
COMPILE.cpp = $(COMPILE.cc)
COMPILE.C = $(COMPILE.cc)
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
%.o: %.cc
# commands to execute (built-in):
$(COMPILE.cc) $(OUTPUT_OPTION) $<
%.o: %.C
# commands to execute (built-in):
$(COMPILE.C) $(OUTPUT_OPTION) $<
%.o: %.cpp
# commands to execute (built-in):
$(COMPILE.cpp) $(OUTPUT_OPTION) $<
.cc.o:
$(COMPILE.cc) $(OUTPUT_OPTION) $<
.C.o:
$(COMPILE.C) $(OUTPUT_OPTION) $<
.cpp.o:
$(COMPILE.cpp) $(OUTPUT_OPTION) $<
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-21 7:34 ` Tak Ota
@ 2002-02-21 7:45 ` Tak Ota
2002-02-21 10:59 ` Eli Zaretskii
0 siblings, 1 reply; 17+ messages in thread
From: Tak Ota @ 2002-02-21 7:45 UTC (permalink / raw)
Cc: rms, emacs-devel
Wed, 20 Feb 2002 23:34:36 -0800 (PST): Tak Ota <Takaaki.Ota@am.sony.com> wrote:
> Thu, 21 Feb 2002 08:47:11 +0200 (IST): Eli Zaretskii <eliz@is.elta.co.il> wrote:
>
> >
> > On Wed, 20 Feb 2002, Richard Stallman wrote:
> >
> > > find . -name "*.[chCH]" -print | etags -
> > >
> > > I suppose use of C++ is very common these days.
> > >
> > > .C and .H were used for C++ files. Has that convention changed?
> >
> > No, it didn't change.
> >
> > However, it's possible that capital .C and .H are not used on
> > case-insensitive filesystems such as on Windows.
>
> GNU make 3.79.1 knows .C, .cc and .cpp as the C++ files. And it seems
> to treat .cc as the canonical one and consolidate .C and .cpp into
> .cc.
Also the following is an excerpt from the info page of gcc version
2.96.
-Tak
For any given input file, the file name suffix determines what kind
of compilation is done:
....
`FILE.cc'
`FILE.cxx'
`FILE.cpp'
`FILE.C'
C++ source code which must be preprocessed. Note that in `.cxx',
the last two letters must both be literally `x'. Likewise, `.C'
refers to a literal capital C.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-21 7:45 ` Tak Ota
@ 2002-02-21 10:59 ` Eli Zaretskii
2002-02-21 16:19 ` Tak Ota
0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2002-02-21 10:59 UTC (permalink / raw)
Cc: rms, emacs-devel
On Wed, 20 Feb 2002, Tak Ota wrote:
> > GNU make 3.79.1 knows .C, .cc and .cpp as the C++ files. And it seems
> > to treat .cc as the canonical one and consolidate .C and .cpp into
> > .cc.
>
> Also the following is an excerpt from the info page of gcc version
> 2.96.
Sure, I know that: GNU Make and GCC are case-sensitive to file-name
extensions, even on DOS/Windows systems.
What I meant was that _users_ on those systems might use these extensions
less often than on Unix and GNU systems, since it's easier to get
confused by cas-insensitive tools. For example, try displaying such
names in the Windows Explorer.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-21 10:59 ` Eli Zaretskii
@ 2002-02-21 16:19 ` Tak Ota
2002-02-22 14:32 ` Francesco Potorti`
0 siblings, 1 reply; 17+ messages in thread
From: Tak Ota @ 2002-02-21 16:19 UTC (permalink / raw)
Cc: rms, emacs-devel
Thu, 21 Feb 2002 12:59:15 +0200 (IST): Eli Zaretskii <eliz@is.elta.co.il> wrote:
> What I meant was that _users_ on those systems might use these extensions
> less often than on Unix and GNU systems, since it's easier to get
> confused by cas-insensitive tools. For example, try displaying such
> names in the Windows Explorer.
Yes, you are right in this regard.
I had a bad experience when using cvs on Windows platform. One
directory contained two files with same name except their case.
Running "cvs co" overwrote one by the other.
BTW, what do you think about including .cc, .cpp and maybe .cxx also
to the example in the subject info page?
Also, how about adding a command to etags.el which generates a tag
file by running etags appropriately for the current buffer mode?
I did a little bit of research and found two incidents of having tag
file generation command in cperl-mode.el and idlwave.el. I wonder
which is better that individual language package to support its own
tag file generation command or etag.el to provide general tag
generation command for many different languages.
Any opinion?
-Tak
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-21 16:19 ` Tak Ota
@ 2002-02-22 14:32 ` Francesco Potorti`
2002-02-22 14:53 ` Tak Ota
0 siblings, 1 reply; 17+ messages in thread
From: Francesco Potorti` @ 2002-02-22 14:32 UTC (permalink / raw)
Cc: eliz, rms, emacs-devel
Tak Ota <Takaaki.Ota@am.sony.com> writes:
Also, how about adding a command to etags.el which generates a tag
file by running etags appropriately for the current buffer mode?
Sorry, I lost the start of the thread. Etags does autodetection of the
language, pricipally based on the file name, but with C++ it switches
from C to C++ whe it sees a `template' or `class' keyword. What are the
problems?
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-22 14:32 ` Francesco Potorti`
@ 2002-02-22 14:53 ` Tak Ota
2002-02-22 15:31 ` Andreas Schwab
2002-02-23 20:19 ` Richard Stallman
0 siblings, 2 replies; 17+ messages in thread
From: Tak Ota @ 2002-02-22 14:53 UTC (permalink / raw)
Cc: eliz, rms, emacs-devel
22 Feb 2002 15:32:50 +0100: Francesco Potorti` <pot@gnu.org> wrote:
> Tak Ota <Takaaki.Ota@am.sony.com> writes:
> Also, how about adding a command to etags.el which generates a tag
> file by running etags appropriately for the current buffer mode?
>
> Sorry, I lost the start of the thread. Etags does autodetection of the
> language, pricipally based on the file name, but with C++ it switches
> from C to C++ whe it sees a `template' or `class' keyword. What are the
> problems?
etags is OK. For practical use etags must run on all relevant source
files in the target project by something like this.
find . -name "*.[chCH]" -print | etags -
I am asking if we can provide easier way to perform above task. In
above syntax manipulating "*.[chCH]" to include .cc, .cpp and .cxx is
not trivial.
-Tak
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-22 14:53 ` Tak Ota
@ 2002-02-22 15:31 ` Andreas Schwab
2002-02-23 20:19 ` Richard Stallman
1 sibling, 0 replies; 17+ messages in thread
From: Andreas Schwab @ 2002-02-22 15:31 UTC (permalink / raw)
Cc: pot, eliz, rms, emacs-devel
Tak Ota <Takaaki.Ota@am.sony.com> writes:
|> etags is OK. For practical use etags must run on all relevant source
|> files in the target project by something like this.
|>
|> find . -name "*.[chCH]" -print | etags -
|>
|> I am asking if we can provide easier way to perform above task. In
|> above syntax manipulating "*.[chCH]" to include .cc, .cpp and .cxx is
|> not trivial.
What's wrong with this:
find . \( -name "*.[chCH]" -o -name "*.cc" -o -name "*.cpp" -o -name "*.cxx" \) -print
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-22 14:53 ` Tak Ota
2002-02-22 15:31 ` Andreas Schwab
@ 2002-02-23 20:19 ` Richard Stallman
2002-02-24 5:42 ` Tak Ota
1 sibling, 1 reply; 17+ messages in thread
From: Richard Stallman @ 2002-02-23 20:19 UTC (permalink / raw)
Cc: pot, eliz, emacs-devel
etags is OK. For practical use etags must run on all relevant source
files in the target project by something like this.
find . -name "*.[chCH]" -print | etags -
I am asking if we can provide easier way to perform above task. In
above syntax manipulating "*.[chCH]" to include .cc, .cpp and .cxx is
not trivial.
Now I see that we have been misunderstanding each other.
That example in the manual is meant to show how you can use
find to select the files to etags to operate on. You seem to want
an example showing how to find C and C++ files, but that isn't
what it is intended for.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-23 20:19 ` Richard Stallman
@ 2002-02-24 5:42 ` Tak Ota
2002-02-25 0:08 ` Richard Stallman
0 siblings, 1 reply; 17+ messages in thread
From: Tak Ota @ 2002-02-24 5:42 UTC (permalink / raw)
Cc: pot, eliz, emacs-devel
Sat, 23 Feb 2002 13:19:54 -0700 (MST): Richard Stallman <rms@gnu.org> wrote:
> etags is OK. For practical use etags must run on all relevant source
> files in the target project by something like this.
>
> find . -name "*.[chCH]" -print | etags -
>
> I am asking if we can provide easier way to perform above task. In
> above syntax manipulating "*.[chCH]" to include .cc, .cpp and .cxx is
> not trivial.
>
> Now I see that we have been misunderstanding each other.
> That example in the manual is meant to show how you can use
> find to select the files to etags to operate on. You seem to want
> an example showing how to find C and C++ files, but that isn't
> what it is intended for.
OK. I understand that intention. How about etags.el or other
language package like cc-mode.el to provide a command that runs find
and etags. For typical uses we can make the existence of etags
program invisible for ordinary users. I see this example in
cperl-mode.el and idlwave.el. Like hexl it is nicer that the external
command invokation is wrapped by lisp commands and is invisible from
novice users.
-Tak
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-24 5:42 ` Tak Ota
@ 2002-02-25 0:08 ` Richard Stallman
2002-02-25 6:40 ` Eli Zaretskii
0 siblings, 1 reply; 17+ messages in thread
From: Richard Stallman @ 2002-02-25 0:08 UTC (permalink / raw)
Cc: pot, eliz, emacs-devel
People usually write commands in Makefile to run etags.
I don't see that it is very useful to have Lisp programs
to run it.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-25 0:08 ` Richard Stallman
@ 2002-02-25 6:40 ` Eli Zaretskii
2002-02-25 8:27 ` Francesco Potorti`
2002-02-26 20:15 ` Richard Stallman
0 siblings, 2 replies; 17+ messages in thread
From: Eli Zaretskii @ 2002-02-25 6:40 UTC (permalink / raw)
Cc: Takaaki.Ota, pot, emacs-devel
On Sun, 24 Feb 2002, Richard Stallman wrote:
> People usually write commands in Makefile to run etags.
> I don't see that it is very useful to have Lisp programs
> to run it.
Putting on my Emacs Apostle hat, I find in my work with my colleagues
that they have difficulties in running etags. For a complex project, a
command such as this:
find /project/root -name '*.[ch]' | xargs -n 2000 etags
let alone the complications with additional file-name extensions like
.cpp etc., is typically beyond many users' knowledge. Since they don't
know what the command is, they can't put it into their Makefiles,
either. Non-Unix platforms introduce an additional complication into
this (no `find' installed etc.)
So perhaps it could be a good idea to have an Emacs command that would
accept a few inputs, like the top-level directory and whether to recurse
into its subdirectories, and will then run etags as appropriate.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-25 6:40 ` Eli Zaretskii
@ 2002-02-25 8:27 ` Francesco Potorti`
2002-02-25 16:30 ` Tak Ota
2002-02-26 20:15 ` Richard Stallman
1 sibling, 1 reply; 17+ messages in thread
From: Francesco Potorti` @ 2002-02-25 8:27 UTC (permalink / raw)
Cc: emacs-devel, Takaaki.Ota, Richard Stallman
find /project/root -name '*.[ch]' | xargs -n 2000 etags
This is easier:
find /project/root -name '*.[ch]'| etags -
So perhaps it could be a good idea to have an Emacs command that
would accept a few inputs, like the top-level directory and whether
to recurse into its subdirectories, and will then run etags as
appropriate.
Ok, will consider this. Part of my todo list.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-25 8:27 ` Francesco Potorti`
@ 2002-02-25 16:30 ` Tak Ota
0 siblings, 0 replies; 17+ messages in thread
From: Tak Ota @ 2002-02-25 16:30 UTC (permalink / raw)
Cc: eliz, emacs-devel, rms
Mon, 25 Feb 2002 09:27:04 +0100: Francesco Potorti` <pot@gnu.org> wrote:
> find /project/root -name '*.[ch]' | xargs -n 2000 etags
>
> This is easier:
>
> find /project/root -name '*.[ch]'| etags -
>
>
> So perhaps it could be a good idea to have an Emacs command that
> would accept a few inputs, like the top-level directory and whether
> to recurse into its subdirectories, and will then run etags as
> appropriate.
>
> Ok, will consider this. Part of my todo list.
Thank you. I think that will make use of etags more popular among
novice emacs users.
-Tak
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: etags for C++
2002-02-25 6:40 ` Eli Zaretskii
2002-02-25 8:27 ` Francesco Potorti`
@ 2002-02-26 20:15 ` Richard Stallman
1 sibling, 0 replies; 17+ messages in thread
From: Richard Stallman @ 2002-02-26 20:15 UTC (permalink / raw)
Cc: Takaaki.Ota, pot, emacs-devel
So perhaps it could be a good idea to have an Emacs command that would
accept a few inputs, like the top-level directory and whether to recurse
into its subdirectories, and will then run etags as appropriate.
Even better: it could write a shell command for you
and make it convenient to either run it or copy it into a makefile
and edit it.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2002-02-26 20:15 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-19 19:41 etags for C++ Tak Ota
2002-02-20 22:13 ` Richard Stallman
2002-02-21 6:47 ` Eli Zaretskii
2002-02-21 7:34 ` Tak Ota
2002-02-21 7:45 ` Tak Ota
2002-02-21 10:59 ` Eli Zaretskii
2002-02-21 16:19 ` Tak Ota
2002-02-22 14:32 ` Francesco Potorti`
2002-02-22 14:53 ` Tak Ota
2002-02-22 15:31 ` Andreas Schwab
2002-02-23 20:19 ` Richard Stallman
2002-02-24 5:42 ` Tak Ota
2002-02-25 0:08 ` Richard Stallman
2002-02-25 6:40 ` Eli Zaretskii
2002-02-25 8:27 ` Francesco Potorti`
2002-02-25 16:30 ` Tak Ota
2002-02-26 20:15 ` Richard Stallman
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.