Created
September 25, 2019 17:04
-
-
Save fabiofortkamp/acb1d1d8c19c5a5537e90e64e772c815 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# function to close the buffer corresponding to a given file in emacs | |
# cf = close file | |
function cf() { | |
emacs -e "(if (get-buffer \"$1\") (kill-buffer \"$1\"))" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For some reason, this does not work when invoked as part of a prm stop script.
The
emacs
command is aliased toemacsclient -n
. When thecf
function is invoked inside prm, the Emacs client seems to not find an existing server, and opens up a new frame and fires up a new server --- but the buffer I want to close is naturally opened in an existing frame of a client attached to an existing server.