dotfiles/bin/emacs_env

17 lines
371 B
Plaintext
Raw Normal View History

2020-06-03 14:31:58 +00:00
#!/usr/bin/env bash
function export-emacs {
if [ "$(emacsclient -e t)" != 't' ]; then
return 1
fi
for name in "${@}"; do
value=$(eval echo \"\$${name}\")
emacsclient -e "(setenv \"${name}\" \"${value}\")" >/dev/null
done
}
for i in $(python -c $"import os; [print(k) for k in os.environ.keys()]"); do
export-emacs "$i"
done