New answers tagged

1

Running Emacs in server-mode, you can use emacsclient to execute lisp code in that Emacs process. This makes it relatively simple to find out the file name of the currently selected window: emacsclient -e '(buffer-file-name (window-buffer (selected-window)))' You may need to add some more logic to deal with the case where your active window isn't visiting ...


Top 50 recent answers are included