2015-03-06 18:00:57 +04:00
|
|
|
#!/bin/bash
|
2015-03-06 17:56:16 +04:00
|
|
|
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
|
|
|
|
2017-10-18 06:55:51 +04:00
|
|
|
: "${EM_GEOMETRY:=150x50+0+67}" "${EM_STDERR:=}"
|
2015-03-06 17:56:16 +04:00
|
|
|
|
2015-03-06 18:00:57 +04:00
|
|
|
# Essayer avec emacs
|
|
|
|
emacs="$(which emacs 2>/dev/null)"
|
|
|
|
if [ -x "$emacs" ]; then
|
|
|
|
if [ -n "$DISPLAY" ]; then
|
2017-10-18 06:55:51 +04:00
|
|
|
if [ -n "$EM_STDERR" ]; then
|
|
|
|
# ne pas supprimer la sortie erreur
|
|
|
|
exec "$emacs" -g "$EM_GEOMETRY" "$@" &
|
|
|
|
else
|
|
|
|
# supprimer la sortie d'erreur. les warnings de GTK sont horripilants
|
|
|
|
exec "$emacs" -g "$EM_GEOMETRY" "$@" 2>/dev/null &
|
|
|
|
fi
|
2015-03-06 18:04:36 +04:00
|
|
|
exit 0
|
2015-03-06 18:00:57 +04:00
|
|
|
else
|
2016-05-17 11:17:16 +04:00
|
|
|
exec "$emacs" -nw "$@"
|
2015-03-06 18:00:57 +04:00
|
|
|
fi
|
2015-03-06 17:56:16 +04:00
|
|
|
fi
|
2015-03-06 18:00:57 +04:00
|
|
|
|
|
|
|
# puis avec vim
|
|
|
|
vim="$(which vim 2>/dev/null)"
|
|
|
|
[ -x "$vim" ] && exec "$vim" "$@"
|
|
|
|
|
|
|
|
# puis avec $EDITOR
|
|
|
|
[ -n "$EDITOR" ] && exec "$EDITOR"
|
|
|
|
|
|
|
|
exit 1
|