all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* showing argument list in mini-buffer of c/c++ func
@ 2004-04-25  0:25 axa
  0 siblings, 0 replies; 6+ messages in thread
From: axa @ 2004-04-25  0:25 UTC (permalink / raw)


Hi,

Ive switched from Win32 programming environment to Linux, and Ive had no
problems writing small programs in either emacs or vim (preferably
emacs) until now. But now, for a slightly bigger program, there are
some big unpleasantness regarding emacs and (as others told me) CEDET
(particularly semantic) package.
Im new in working with emacs, however I think that, things Im
trying to accomplish are not "so advanced and beyond new users need", and
really hope, that with you'll help me to solve these problems easily,
since I really don't feel like learning one programming language
(elisp) so I could do programming in c/c++, using one well featured tool
like emacs. So, to start.
First, Ive been trying to _somehow_ make emacs show automatically (or at
least one-shortcut_away) in mini-buffer, argument list of c/c++ function,
when I type name of function (in .c file) and open first brace, or
when cursor is over some c/c++ function name (but primarily first thing).
For example, if in one .c file I type:
printf(
/* then emacs would show in mini-buffer, its (printf) argument list,
   something like the following: */
printf(char*, ...)

Yes, maybe I get used to this feature in MSVC back when I was programming
in Win32 environment, but anyway this is really big convenience for me,
when writing more that 200 lines of code. I think many would agree to
this.
The second problem I have, which is slightly less important than first
problem, to me) is to somehow get list of structure members. For example,
if I have
something like this in one .c file:
struct timeval tv;
/* and I type */
tv.
/* then emacs in mini-buffer shows, something like the following
   comlpetition list */
time_t tv_sec;
suseconds_t tv_usec;

First I tried to solve this with with tags, but solution is not very
efficient and not automatic. Then, someone, recommended me to
download and install CEDET and ECB packages. Which I did but with no
expected result. I installed these packages (cedet-1.0beta2a and ecb-2.23)
just like INSTALL file suggests, that is, make (compile) and add some
lines in my ~/.emacs file. The packages resides in my home tree
(both cedet and ecb).
So my ~/.emacs file looks like the following (its short):
(setq-default transient-mark-mode t)
(setq-default case-fold-search t)
(setq c-default-style
      '((c-mode . "stroustrup") (c++-mode . "stroustrup") (other .
"gnu")))

setq c-indent-level 3)
(setq c-tab-always-indent nil)
(global-font-lock-mode t)
(setq font-lock-maximum-decoration
      '((c-mode . 2) (c++-mode . 2)))
(setq tags-table-list
      '("~/TAGS"))

(require 'eldoc)

;; Configuration variables here:
(setq semantic-load-turn-useful-things-on t)
;; Load CEDET
(load-file "~/test/emacs-tools/cedet-1.0beta2a/common/cedet.el")
(add-to-list 'load-path
             "~/test/emacs-tools/ecb-2.23")
(load-file "~/test/emacs-tools/cedet-1.0beta2a/semantic/semantic-load.el")
(require 'ecb)
(require 'semantic-sb)
#--- EOF ---

Ive also created TAGS file with the following command:
find /usr/include -name "*.[chCH]" -print | etags -

And later in emacs loaded it with 'M-x visit-tags-table', but after
all this done, when I position cursor over (for example) 'printf'
function name in some .c file, emacs doesn't show anything in
mini-buffer. And when I type:
printf

I get the following message:
Update Tag Table: main

And, again, when I open first brace after function name, like:
printf(

I get, message in mini-buffer, saying:
Buffer not currently parsable.


I really hope that you will help me to solve these problem(s), with
not too much effort from you.

Henceforth, thank you
Best regards, axa

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: showing argument list in mini-buffer of c/c++ func
@ 2004-04-25 20:28 axa
  0 siblings, 0 replies; 6+ messages in thread
From: axa @ 2004-04-25 20:28 UTC (permalink / raw)


On Sun, 25 Apr 2004, axa wrote:

>
> Henceforth, thank you
> Best regards, axa
>

Ok, since none respond to this question, and by the respond Ive got from
other people about this particular question, I guess it is hard to to this
(or even impossible) in emacs. So I created one script, which collected all
C prototypes and putted them in one file. The idea is, when open some .C
file in emacs, and when cursor is over some functions name, when I type
(some) short-cut, then emacs would _take_ that function name (under the
cursor), give it to the script, and then display result (from script,
which would be func prototype) in mini-buffer. But since, I do not know
"elisp" (I guess it is needed to write such function), can someone help me
with this, by writing me how to do this?
So, again that function in emacs, would take C function name under the
cursor (or in worst case, provide input in mini-buffer in which  C
function name would be explicitly given), then call some bash script
with that C func name (or even, itself calls grep for one file, with C
function name), and then finally display result back in mini-buffer.

Thanks.


Best regards, axa
---
The law will never make men free; it is men who have got to make the
law free.
		-- Henry David Thoreau

^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <mailman.1567.1082924943.1061.help-gnu-emacs@gnu.org>]
[parent not found: <mailman.1464.1082852746.1061.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2004-04-29  7:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-25  0:25 showing argument list in mini-buffer of c/c++ func axa
  -- strict thread matches above, loose matches on Subject: below --
2004-04-25 20:28 axa
     [not found] <mailman.1567.1082924943.1061.help-gnu-emacs@gnu.org>
2004-04-25 22:57 ` Stefan Monnier
2004-04-25 23:21   ` axa
     [not found]   ` <mailman.1579.1082935352.1061.help-gnu-emacs@gnu.org>
2004-04-29  7:38     ` Thorsten Bonow
     [not found] <mailman.1464.1082852746.1061.help-gnu-emacs@gnu.org>
2004-04-29  7:08 ` Kai Grossjohann

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.