commit - aecdde273e74130898dd4bb95ee6eef8ec212aa9
commit + 7e346d82461441d5461dd82322e24f0e79905197
blob - f8eca103140c852b1ec527dacb142f12b26b1726
blob + 6e380701ea980479acc9001ab62c34dc5808ba29
--- README.md
+++ README.md
- `--with-libbsd`: link with [libbsd][libbsd]
- `--with-libimsg`: link with the [imsg-compat][imsg-compat] library
+The default-editor can be changed at build-time with the following option:
+
+ - `--with-default-editor`: defaults to `ed(1)`
+
+This is useful for distributions such as Debian, which prefers
+`sensible-editor(1)` as a wrapper.
+
+This feature is mostly useful with the `mini-edit-external` command in
+`telescope`.
+
[libbsd]: https://libbsd.freedesktop.org
[imsg-compat]: https://github.com/bsd-ac/imsg-compat
[libgrapheme]: https://libs.suckless.org/libgrapheme/
blob - e97e25722132465c874f58a2eb73ac925dd3096f
blob + f066a7dfe8d7f1a37a121607a0423f7763892af9
--- configure.ac
+++ configure.ac
AC_ARG_WITH([libbsd],
AS_HELP_STRING([--with-libbsd],
[Build with libbsd library (default: disabled)]))
+
+AC_ARG_WITH([default-editor],
+ AS_HELP_STRING([--with-default-editor],
+ [Set the default editor to use (default: ed)]),
+ [DEFAULT_EDITOR=$withval],
+ [DEFAULT_EDITOR=ed])
+AC_MSG_NOTICE([Using default-editor: $DEFAULT_EDITOR])
+AC_DEFINE_UNQUOTED([DEFAULT_EDITOR], ["$DEFAULT_EDITOR"], [The default editor])
AS_IF([test "x$with_libbsd" = "xyes"], [
PKG_CHECK_MODULES([libbsd], [libbsd-overlay libbsd-ctor], [
blob - 71c965a058610a3336b04486dc8ae9bd97771eea
blob + 5ba371c90bbcb942f30d8400444939be9917d8c2
--- ui.c
+++ ui.c
if ((editor = getenv("VISUAL")) == NULL &&
(editor = getenv("EDITOR")) == NULL)
- editor = "ed";
+ editor = DEFAULT_EDITOR;
endwin();
fprintf(stderr, "%s: running %s %s\n", getprogname(), editor, sfn);