all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Auto-Insertion of C/C++ #include-statements upon use of their symbols
@ 2008-09-17 15:04 Nordlöw
  2008-09-17 16:18 ` David
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Nordlöw @ 2008-09-17 15:04 UTC (permalink / raw)
  To: help-gnu-emacs

I am currently writing some logic for automatically looking up a
required header file when the programmer completes the use of a symbol
defined in this header file. This to relieve especially C/C++
programmers from the cumbersome process of doing for example "man
memcpy" to figure out that we need to "include <string.h>" before
calling memcpy().

In C++ this shall also work for Standard Template Library (STL)
Headers, that is "#include <vector>" is auto-(query-)included when the
user completes the expression "std::vector<int>".

The logic for these lookups and insertions already exists. What now
remains is the logic for sensing when this is needed.

My suggestion is to make Emacs call a function each time a character
is inserted into buffer and then check if we are currently standing
behind such a use pattern. I believe looking-back() is usable here.

We also need to check that the cursor is *NOT* currently standing
inside a comment or string; How do I query such a context?

If any one is interested in using this add-ons I will gladly send it
to you.


Many Thanks in advance,
Nordlöw


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

end of thread, other threads:[~2008-09-19 16:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-17 15:04 Auto-Insertion of C/C++ #include-statements upon use of their symbols Nordlöw
2008-09-17 16:18 ` David
     [not found] ` <mailman.19414.1221668342.18990.help-gnu-emacs@gnu.org>
2008-09-17 18:39   ` Chetan
2008-09-17 21:17     ` Peter Milliken
2008-09-17 21:54     ` David
2008-09-19 16:13 ` Nikolaj Schumacher

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.