Run emacs lisp command from inferior shell Run emacs lisp command from inferior shell shell shell

Run emacs lisp command from inferior shell


It sounds like you are looking for M-x eval-expression, bound by default to M-: (Alt+Colon, i.e. Alt+Shift+semicolon). The expression is evaluated in whatever context you were in when eval-expression was invoked, so if the expression sets a buffer-local variable, it will be set for your current buffer.


You can use emacsclient to do it. You'll need to have started emacs as a server, either with (server-start) in your .emacs or by starting emacs as a background process with --daemon.

You can evaluate elisp code in your shell like this:

emacsclient --eval '(setq comint-input-autoexpand nil)'