POSIXLY:
$ : "${editor:=$(command -v emacs)}" "${editor:=/usr/bin/vi}"
$ printf '%s\n' "$editor"
emacs
 You can't do nested parameter expansion in any Bourne-like shells but zsh:
$ editor=${$(whence -p emacs):-/usr/bin/vi}
$ print -rl -- $editor
/usr/bin/emacs
or:
editor=${commands[emacs]-$commands[vi]}