bin/help: don't break the terminal with emacsclient

This commit is contained in:
xeruf 2022-08-30 11:52:55 +02:00
parent 0d871fd967
commit aa7a5573f0
2 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh
# Emacs in the terminal
pgrep --full "emacs --daemon" >/dev/null || emacs --daemon
emacsclient --create-frame --tty "$@"
emacsclient --create-frame --tty "$@"

View File

@ -9,7 +9,7 @@ test "$1" = "-d" && browse=1 && shift
showinfo() {
which info >/dev/null 2>&1 &&
case $EDITOR in
(*emacs*) $EDITOR --eval "(progn (info \"$1\") (if \"$2\" (Info-index \"$2\")) (delete-other-windows))";;
(*emacs*) info "$@" -w | grep -v "manpages" | grep -q . && $EDITOR --eval "(progn (info \"$1\") (if \"$2\" (Info-index \"$2\")) (delete-other-windows))";;
(*vim) info "$@" -w | grep -q . && $EDITOR -R -M -c "Info $1" +only;;
(*) info -f "$1" $(test "$2" && echo "--index-search=$2") 2>/dev/null;;
esac