utiliser vim ou EDITOR si emacs n'est pas installé
This commit is contained in:
parent
d86717bfd3
commit
c61126ec0b
24
em
24
em
|
@ -1,11 +1,23 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
||||
|
||||
GEOMETRY=150x50+0+67
|
||||
EMACS_GEOMETRY=150x50+0+67
|
||||
|
||||
emacs="`which emacs`"
|
||||
if [ -n "$DISPLAY" ]; then
|
||||
exec "$emacs" -g $GEOMETRY "$@" &
|
||||
else
|
||||
# Essayer avec emacs
|
||||
emacs="$(which emacs 2>/dev/null)"
|
||||
if [ -x "$emacs" ]; then
|
||||
if [ -n "$DISPLAY" ]; then
|
||||
exec "$emacs" -g "$EMACS_GEOMETRY" "$@" &
|
||||
else
|
||||
exec "$emacs" "$@"
|
||||
fi
|
||||
fi
|
||||
|
||||
# puis avec vim
|
||||
vim="$(which vim 2>/dev/null)"
|
||||
[ -x "$vim" ] && exec "$vim" "$@"
|
||||
|
||||
# puis avec $EDITOR
|
||||
[ -n "$EDITOR" ] && exec "$EDITOR"
|
||||
|
||||
exit 1
|
||||
|
|
Loading…
Reference in New Issue