unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Snippets with imports
@ 2009-11-30 16:42 andrea crotti
  0 siblings, 0 replies; only message in thread
From: andrea crotti @ 2009-11-30 16:42 UTC (permalink / raw)
  To: help-gnu-emacs

I'm using a lot yasnippet and defining many snippets.
Now I was wondering what to do if some snippets needs function calls 
which are actually not in the base language, but need to be imported.

Firt option is just don't care about, I can add manually the import.

The second option is to check and add if needed and (for example in 
python) I see three alternatives:
1. I already have import X, where X is the module contaning my function Y
2. I already have from X import Z (Y != Z)
3. I already have from X import Y|* (not very likely)
4. I don't have anything

In case number 1 I probably want to use the
X.Y function call

In case 2 also have to add ", Y" after Z
In case 3 I'm fine already and in case 4 I can choose between importing 
the whole library or just one function.
In this case I think maybe I should prompt the user for what is best to do.


I'm I missing something?
Said that the actual snippet implementation is a bit harder, any advice 
on similar snippets which I can look for?





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-30 16:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-30 16:42 Snippets with imports andrea crotti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).