<-- back RSS Feed

Interacting with emacs from bash

I know many of you will recommend eshell for this however I prefer using a bash shell for a number of reasons including tmux, the use of TUI applications that don't play nice with eshell, and not loading up emacs whenever I want to use a terminal. Obviously all of these are dependent on you using emacs server.

Opening files

Opening files can be accomplished relatively simply. Just add an alias for emacsclient -n and add the filename at the end.

.

running other commands

For this you can use a small function that takes 1 argument and passes it to emacsclient -n -e.


function ems() {
    emacsclient -n -e \($1\) 
}