all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Semantic completion of C++ class members
@ 2014-05-01 16:06 Jacob Gerlach
  2014-05-01 21:29 ` Emanuel Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Jacob Gerlach @ 2014-05-01 16:06 UTC (permalink / raw)
  To: help-gnu-emacs

My understanding of semantic mode is that it should offer completions based on class definitions.

For example, given

MyClass A;

A.-|-

C-c , <SPC> should offer the member functions of MyClass as completions.

I have opened MyClass.h and MyClass.cpp to make sure that semantic has parsed them, but attempting semantic-complete-analyze-inline returns "Cannot find types for `MyClass A'

Am I misunderstanding the process to get this type of completion?

Alternatively, I have not tried to use anything like CEDET, so if a better solution is "just use CEDET" (or whatever else), I'm open to anything.


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

* Re: Semantic completion of C++ class members
  2014-05-01 16:06 Semantic completion of C++ class members Jacob Gerlach
@ 2014-05-01 21:29 ` Emanuel Berg
  2014-05-04  0:44   ` Richard Riley
       [not found]   ` <mailman.619.1399164314.1147.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Emanuel Berg @ 2014-05-01 21:29 UTC (permalink / raw)
  To: help-gnu-emacs

Jacob Gerlach <jacobgerlach@gmail.com> writes:

> My understanding of semantic mode is that it should
> offer completions based on class definitions.

What does "semantic" mean in this context?

> For example, given
>
> MyClass A;
>
> A.-|-

"-|-"?

> Alternatively, I have not tried to use anything like
> CEDET, so if a better solution is "just use CEDET"
> (or whatever else), I'm open to anything.

Really? :) In that case, let me offer the same piece of
advice I always do in these matters.

1. If you cannot do it already, then learn to type -
preferable as fast as you can think. (When you get
close, those two activities will merge more or less.)

2. Always make an effort to use short names for
everything, names that are descriptive and easy to
spell (and type). Doing this over and over, it'll be
second nature and you can even relax your memory a bit
- just "name" the thing again, and the same thing will
pop up (that won't work every time, but often enough).

-- 
underground experts united:
http://user.it.uu.se/~embe8573


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

* Re: Semantic completion of C++ class members
  2014-05-01 21:29 ` Emanuel Berg
@ 2014-05-04  0:44   ` Richard Riley
       [not found]   ` <mailman.619.1399164314.1147.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Riley @ 2014-05-04  0:44 UTC (permalink / raw)
  To: help-gnu-emacs

Emanuel Berg <embe8573@student.uu.se> writes:

> Jacob Gerlach <jacobgerlach@gmail.com> writes:
>
>> My understanding of semantic mode is that it should
>> offer completions based on class definitions.
>
> What does "semantic" mean in this context?

Please reader to CEDET documentaton.

>
>> For example, given
>>
>> MyClass A;
>>
>> A.-|-
>
> "-|-"?
>
>> Alternatively, I have not tried to use anything like
>> CEDET, so if a better solution is "just use CEDET"
>> (or whatever else), I'm open to anything.
>
> Really? :) In that case, let me offer the same piece of
> advice I always do in these matters.
>
> 1. If you cannot do it already, then learn to type -

Typing quickly has nothing to do with context based completion of class
variables and functions.

> preferable as fast as you can think. (When you get
> close, those two activities will merge more or less.)
>
> 2. Always make an effort to use short names for
> everything, names that are descriptive and easy to
> spell (and type). Doing this over and over, it'll be
> second nature and you can even relax your memory a bit
> - just "name" the thing again, and the same thing will
> pop up (that won't work every time, but often enough).

I'm intrigued to hear what you think any of that has to do with CEDET
completion? C++ classes are frequently massive and complex and trying to
code or maintain any form of large library based code base without this
sort of semantic help/completion borders on crazy these days.

-- 
Sent using Emacs/Gnus from home ...




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

* Re: Semantic completion of C++ class members
       [not found]   ` <mailman.619.1399164314.1147.help-gnu-emacs@gnu.org>
@ 2014-05-04  0:54     ` Jacob Gerlach
  2014-05-04  7:11       ` Andreas Röhler
  0 siblings, 1 reply; 5+ messages in thread
From: Jacob Gerlach @ 2014-05-04  0:54 UTC (permalink / raw)
  To: help-gnu-emacs

> > "-|-"?
Maybe this was supposed to be -!-. I think it's something I've seen in the emacs documentation to show where point is.

> > 2. Always make an effort to use short names...
I am not a full time programmer and don't write a substantial amount of my own code. I do use many libraries written by others in the coding I do. Completion saves me the trouble of frequently referring back to the library source and/or documentation to check exactly what a function is called.


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

* Re: Semantic completion of C++ class members
  2014-05-04  0:54     ` Jacob Gerlach
@ 2014-05-04  7:11       ` Andreas Röhler
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Röhler @ 2014-05-04  7:11 UTC (permalink / raw)
  To: help-gnu-emacs

On 04.05.2014 02:54, Jacob Gerlach wrote:
>>> "-|-"?
> Maybe this was supposed to be -!-. I think it's something I've seen in the emacs documentation to show where point is.
>
>>> 2. Always make an effort to use short names...
> I am not a full time programmer and don't write a substantial amount of my own code. I do use many libraries written by others in the coding I do. Completion saves me the trouble of frequently referring back to the library source and/or documentation to check exactly what a function is called.
>

You may have a look here:

http://truongtx.me/2013/03/10/emacs-setting-up-perfect-environment-for-cc-programming/

BTW there was a discussion recently at emacs-devel WRT usage of clang-backed tools, which is referenced at several locations, see for example:

http://www.lunaryorn.com/2014/02/27/talking-straight-about-GNUs-goals.html



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

end of thread, other threads:[~2014-05-04  7:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-01 16:06 Semantic completion of C++ class members Jacob Gerlach
2014-05-01 21:29 ` Emanuel Berg
2014-05-04  0:44   ` Richard Riley
     [not found]   ` <mailman.619.1399164314.1147.help-gnu-emacs@gnu.org>
2014-05-04  0:54     ` Jacob Gerlach
2014-05-04  7:11       ` Andreas Röhler

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.