switch reattach to user namespace to as current user in emacs.sh.

This commit is contained in:
Ivan Malison 2014-10-27 21:30:32 -07:00
parent b7639346e1
commit 1936f63f3a

View File

@ -10,11 +10,11 @@ function _emacs {
echo "Starting emacs with server name '$server_name'"
\emacs --daemon="$server_name"
fi
emacsclient $* --server-file="$server_name"
if hash reattach-to-user-namespace 2> /dev/null; then
reattach-to-user-namespace emacsclient $* --server-file=$server_name
local command="emacsclient $* --server-file=$server_name"
if is_osx; then
as_current_user $command
else
emacsclient $* --server-file=$server_name
$command
fi
}