1 # DP: Use `command -v editor`, as an editor, if available.
3 --- bash/builtins/fc.def~ 2005-10-13 18:11:24.798452832 +0200
4 +++ bash/builtins/fc.def 2005-10-13 19:36:11.956087320 +0200
8 /* String to execute on a file that we want to edit. */
9 -#define FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-vi}}"
10 +#define FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-$(command -v editor || echo vi)}}"
11 #if defined (STRICT_POSIX)
12 # define POSIX_FC_EDIT_COMMAND "${FCEDIT:-ed}"
14 -# define POSIX_FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-ed}}"
15 +# define POSIX_FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-$(command -v editor || echo ed)}}"
19 --- bash/bashline.c~ 2005-10-13 18:11:24.827448424 +0200
20 +++ bash/bashline.c 2005-10-13 19:37:35.382404592 +0200
22 command being entered (if no explicit argument is given), otherwise on
23 a command from the history file. */
25 -#define VI_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-vi}}\""
26 -#define EMACS_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-emacs}}\""
27 +#define VI_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-$(command -v editor || echo vi)}}\""
28 +#define EMACS_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-$(command -v editor || echo emacs)}}\""
29 #define POSIX_VI_EDIT_COMMAND "fc -e vi"