unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: andrea crotti <andrea.crotti.0@gmai.com>
To: help-gnu-emacs@gnu.org
Subject: Snippets with imports
Date: Mon, 30 Nov 2009 17:42:08 +0100	[thread overview]
Message-ID: <hf0sl0$vke$1@ger.gmane.org> (raw)

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?





                 reply	other threads:[~2009-11-30 16:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='hf0sl0$vke$1@ger.gmane.org' \
    --to=andrea.crotti.0@gmai.com \
    --cc=andrea.crotti.0@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).