Added emacs.py (for misc/py-connect.el).

posixpath.py: added undocumented expanndvars() (expands $VAR in string).
This commit is contained in:
Guido van Rossum 1992-08-09 13:54:50 +00:00
parent 21803b8a6f
commit 4732ccf642
2 changed files with 44 additions and 0 deletions

18
Lib/emacs.py Normal file
View file

@ -0,0 +1,18 @@
# Execute Emacs code from a Python interpreter.
# This code should be imported from a Python interpreter that is
# running as an inferior process of Emacs.
# See misc/py-connect.el for the companion Emacs lisp code.
# Author: Terrence M. Brannon.
start_marker = '+'
end_marker = '~'
def eval (string):
tmpstr = start_marker + '(' + string + ')' + end_marker
print tmpstr
def dired (directory):
eval( 'dired ' + '"' + directory + '"' )
def buffer_menu ():
eval( 'buffer-menu(buffer-list)' )