[comp.emacs] interpreting keystrokes from emacs lisp

dld@theory.cs.cmu.edu.UUCP (06/11/87)

I would like to find out if is is possible in gnu emacs emacs lisp
call something with a string argument that will have the same effect
as if I had typed the string to the current environment.  If this is a
way to do this, could someone tell me about it?

Thanks,

Dave

nz@hotlg.ATT (Neal Ziring) (06/12/87)

In article <1054@theory.cs.cmu.edu> dld@theory.cs.cmu.edu.UUCP writes:
 > I would like to find out if is is possible in gnu emacs emacs lisp
 > call something with a string argument that will have the same effect
 > as if I had typed the string to the current environment.  If this is a
 > way to do this, could someone tell me about it?
 >
 > Dave

Yes, it is not only possible, but fairly easy.  For instance,
let's say that the variable just-built-cmd-string holds a sequence
of control, escape, and regular characters:

	(let (tempdef)
	   (fset tempdef just-build-cmd-string)
	   (execute-kbd-macro def))

This is the only way of doing that I know, from Elisp.  You could
define an Elisp function that accepts strings, processes them in some
way, then executes them using the fragment above.
-- 
...nz  (Neal Ziring  @  ATT-BL Holmdel, x2354, 3H-437)
	"You can fit an infinite number of wires into this junction box,
	but we usually don't go that far in practice."
					London Electric Co. Worker, 1880s