I am running emacs v26
daemon on the background and using a single terminal. Usually I open files using emacsclient -qt
and close them using C-x C-s
and C-x C-c
to get back to terminal run the script and afterwards re-open another file.
I wanted to make this operation faster where when I run emacsclient -qt -e '(progn (find-file "file.py"))'
seems like it opens the files much faster than emacsclient -qt file.py
(this may lag to show previous buffers for a second).
But now, when I run emacsclient -qt -e '(progn (find-file "file.py"))'
I keep seeing When done with this frame, type C-x 5 0
message in the minibuffer.
=> How can I suppress this warning message? and also safe to open files this way?
Not perfect but the script I come up with:
#!/bin/bash
open_emacs() {
FILE=$1
if [[ -d $FILE ]]; then
echo "Folder path is provided, please provide a file"
return
fi
if [ ! -f "$FILE" ]; then
echo "$FILE does not exist."
return
fi
if [ "$#" -ge 1 ]; then
emacsclient -qt -e '(progn (find-file "'$FILE'"))'
if [ $? -eq 0 ]; then
true
else
emacsclient -qt -e '(progn (find-file "'$FILE'"))'
fi
else
echo "## Please provide a file"
fi
}
open_emacs file.py