Fix emacs_open for osx, will be broken in linux.

This commit is contained in:
2014-12-10 08:18:28 -08:00
parent 9f756c17d9
commit ed708fc875
3 changed files with 8 additions and 2 deletions

View File

@@ -22,4 +22,6 @@ skewer-cache
.org-id-locations
jabber-avatar-cache
this-machine.el
recentf
recentf
persp-confs/
.tern-port

View File

@@ -57,7 +57,7 @@ function focus_emacs {
}
function emacs_get_running_instances {
pgrep emacs | xargs ps -o command -p | egrep -o " --daemon=(.*)" | awk -F= '{print $2}' | sed 's/\^J3,4\^J//'
pgrep -i emacs | xargs ps -o command -p | egrep -o " --daemon=(.*)" | awk -F= '{print $2}' | sed 's/\^J3,4\^J//'
}
function emacs_open {
@@ -66,6 +66,7 @@ function emacs_open {
fi
local server_file="$(emacs_get_running_instances | head -n1)"
emacs_make_frame_if_none_exists $server_file
echo "$server_file"
[ ! -z "$*" ] && emacsclient "$@" --server-file="$server_file"
focus_emacs
}