Search code examples
emacselispeshell

Multi-line input in EShell


Is there a way for multi-line input in EShell? When I want to do a quick function definition at the commandline of EShell, it doesn't really work. I tried using explicit linebreaks (\n), as well as single-quotes ('') and double quotes (""), but with no success.

When I write a newline \n and press enter (point is at position *) I get an error message and a new eshell prompt.

$ (def foo (x y ) \n *)
Symbol's function definition is void: def

When I use C-q C-j and press Enter (point is at position *) I get the same error message and a new eshell prompt.

$ 
(def foo (x y) *)
Symbol's function definition is void: def

Solution

  • You have to leave a parenthesis open to prevent Eshell from evaluating the input prematurely. Also, as pointed out by phils, def is not defined in stock Elisp; you probably want defun.