File: use_usr_bin_editor.patch

package info (click to toggle)
neomutt 20250113%2Bdfsg-1~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 22,872 kB
  • sloc: ansic: 170,180; sh: 5,356; perl: 1,121; tcl: 1,065; python: 421; makefile: 48
file content (38 lines) | stat: -rw-r--r-- 1,403 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From: Antonio Radici <antonio@debian.org>
Date: Thu, 27 Feb 2014 16:06:15 +0100
Subject: use_usr_bin_editor

Even if EDITOR is not set, mutt will always use /usr/bin/editor
(which is set by update-alternatives), rather than falling back
to vi.
---
 docs/config.c | 2 +-
 init.c        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/config.c b/docs/config.c
index 43fb968..708ac3d 100644
--- a/docs/config.c
+++ b/docs/config.c
@@ -1175,7 +1175,7 @@
 ** .pp
 ** This variable specifies which editor is used by NeoMutt.
 ** It defaults to the value of the \fC$$$VISUAL\fP, or \fC$$$EDITOR\fP, environment
-** variable, or to the string "vi" if neither of those are set.
+** variable, or to the string "/usr/bin/editor" if neither of those are set.
 ** .pp
 ** The \fC$$editor\fP string may contain a \fI%s\fP escape, which will be replaced by the name
 ** of the file to be edited.  If the \fI%s\fP escape does not appear in \fC$$editor\fP, a
diff --git a/init.c b/init.c
index b83b962..c143174 100644
--- a/init.c
+++ b/init.c
@@ -420,7 +420,7 @@ int mutt_init(struct ConfigSet *cs, const char *dlevel, const char *dfile,
   if (!env_ed)
     env_ed = mutt_str_getenv("EDITOR");
   if (!env_ed)
-    env_ed = "vi";
+    env_ed = "/usr/bin/editor";
   cs_str_initial_set(cs, "editor", env_ed, NULL);
 
   const char *const c_editor = cs_subset_string(NeoMutt->sub, "editor");