diff --git a/dotfiles/lib/shellrc/emacs.sh b/dotfiles/lib/shellrc/emacs.sh index 34c35434..57b5f41f 100644 --- a/dotfiles/lib/shellrc/emacs.sh +++ b/dotfiles/lib/shellrc/emacs.sh @@ -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 }