0

I am in bash and emacsclient is running. I would like to run a bash command to display a list of all open emacs buffers. The output of buffer-menu is fine. These commands do not work:

emacsclient -e "buffer-list"

ERROR: Symbol's value as variable is void: buffer-list

emacsclient -e "buffer-menu"

ERROR: Symbol's value as variable is void: buffer-menu

1
  • 2
    buffer-list and buffer-menu are functions. Function calls have the form (function args...), so you could use emacsclient -e "(buffer-list)".
    – JeanPierre
    Jun 15, 2016 at 19:06

1 Answer 1

3

Try this:

emacsclient -e '(buffer-list)'
2
  • 1
    Even better, try the following: emacsclient -e '(buffer-list)' | sed 's/>/>\n/g' | tee buffer-list.txt
    – ReneFroger
    Jun 15, 2016 at 19:56
  • Oh, yes. Pipe to whatever processing is needed outside emacs.
    – Emacs User
    Jun 15, 2016 at 21:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.