On 10/17/07, Pierre <[EMAIL PROTECTED]> wrote:
> I was wondering how to have my scripts preparsed: now i know. And i
> need to tell emacs that a .sage file needs to be treated like a .py
> file...

Put this in your .emacs file:

(setq auto-mode-alist (cons '("\\.sage\\'" . python-mode) auto-mode-alist))


> a problem with .sage files though is that the import command doesn't
> work with them (foo.sage is not found by either 'import foo' or
> 'import foo.sage'). I *know* there is the 'load' or the 'attach'
> command instead, but really i prefer import, because of what it does
> with namespaces: having 'foo.f()' is less likely to clash with f()...
> same with variables.

I understand.   It would indeed be god to have some sort of "preparse
then import" command.  Any suggestions for how it would work (i.e.,
from the user's point of view)?  Making
     import foo
work if foo.sage is there isn't really an option, since Python directly
does the import, and won't know to look for foo.sage.

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-forum
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to