Ah well... might as well add it right away, seems to work okay here. Diff attached!

Joop

Op 22-11-19 om 15:35 schreef joop.stakenb...@xs4all.nl:
Thanks Nate! Looks really simple... Will try it out next week.

Joop

Op 22 nov. 2019 15:13 schreef Nate Bargmann <n...@n0nb.us>:

    * On 2019 22 Nov 08:07 -0600, Joop Stakenborg wrote:
    > I have gotten used to the GNU nano editor, but it does not seem
    to work with
    > tlf. When I type :edit in the callsign field, tlf exits and
    returns straight
    > away without opening nano. Both joe and vi work okay here. It is
    hard to
    > debug, have to spent some time on it to see what actually
    happens. Maybe use
    > gdb with a break added. I will have a look next week.

    It should be fairly simple as I added mcedit to the list of available
    editors.  A quick 'git grep mcedit' shows where mcedit was added:

    $ git grep mcedit
    ChangeLog:1117:  * share/logcfg.dat, src/editlog.c,
    src/parse_logcfg.c: Prefer 'mcedit' for
    ChangeLog:1119:  Enable 'mcedit' as a log file editor.
    share/logcfg.dat:33:#EDITOR=mcedit
    src/changepars.c:359:           strcpy(cmdstring, "mcedit ");
    src/editlog.c:63:       strcat(comstr, "mcedit  ");
    src/parse_logcfg.c:904:     if ((strncmp(buff, "mcedit", 6) == 0)
    tlf.1.in:282:Edit the log with your favourite editor (the editor
    (vi[m]|joe|e3|mcedit)
    tlf.1.in:975:You can set your favourite editor (joe | vi[m] | e3 |
    mcedit) in the
    tlf.1.in:1047:\fBEDITOR\fR=\fIjoe\fR | \fIvi\fR[\fIm\fR] |
    \fIe3\fR | \fImcedit\fR

    This should help you get started, Joop.

    73, Nate

--
    "The optimist proclaims that we live in the best of all
    possible worlds.  The pessimist fears this is true."

    Web: https://www.n0nb.us
    Projects: https://github.com/N0NB
    GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819


diff --git a/src/changepars.c b/src/changepars.c
index 02970c1..2d5bbb1 100644
--- a/src/changepars.c
+++ b/src/changepars.c
@@ -358,6 +358,8 @@ int changepars(void) {
 		strcpy(cmdstring, "vi ");
 	    } else if (editor == EDITOR_MC) {
 		strcpy(cmdstring, "mcedit ");
+	    } else if (editor == EDITOR_NANO) {
+		strcpy(cmdstring, "nano ");
 	    } else {
 		strcpy(cmdstring, "e3 ");
 	    }
diff --git a/src/editlog.c b/src/editlog.c
index e11c140..bf82bdb 100644
--- a/src/editlog.c
+++ b/src/editlog.c
@@ -53,6 +53,8 @@ int logedit(void) {
 	strcat(comstr, "vi  ");
     else if (editor == EDITOR_MC)
 	strcat(comstr, "mcedit  ");
+    else if (editor == EDITOR_NANO)
+	strcat(comstr, "nano  ");
     else
 	strcat(comstr, "e3  ");
 
diff --git a/src/parse_logcfg.c b/src/parse_logcfg.c
index 43b53a4..0de1085 100644
--- a/src/parse_logcfg.c
+++ b/src/parse_logcfg.c
@@ -934,6 +934,11 @@ int parse_logcfg(char *inputbuffer) {
 	    if (j != NULL) {
 		editor = EDITOR_VI;
 		break;
+	    }
+	    j = strstr(fields[1], "nano");
+	    if (j != NULL) {
+		editor = EDITOR_NANO;
+		break;
 	    } else {
 		editor = EDITOR_E3;
 		break;
diff --git a/src/tlf.h b/src/tlf.h
index ae11b76..61b5a61 100644
--- a/src/tlf.h
+++ b/src/tlf.h
@@ -119,6 +119,7 @@ enum {
 #define EDITOR_VI 1
 #define EDITOR_E3 2
 #define EDITOR_MC 3
+#define EDITOR_NANO 4
 
 #define UNIQUECALL_ALL      1
 #define UNIQUECALL_BAND     2

Reply via email to