From 17ff8677ee5e50d33744723c03ff0051bd2c677b Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 23 Jul 2023 11:51:17 +0200 Subject: [PATCH] board/common: replace default editor, nano -> mg This reverts an earlier change where nano was made the default editor in a misguided attemt by yours truly to accomodate beginner users. With the recent improvements of the CLI and the fact that the NETCONF support has matured greatly, the need for a user-friendly editor have diminished drastically. Editing system files is now limited to devs and the core team prefers Mg over nano and vi. Signed-off-by: Joachim Wiberg --- .../rootfs/etc/profile.d/convenience.sh | 1 + board/common/rootfs/usr/bin/edit | 2 +- board/common/rootfs/usr/bin/editor | 2 +- ...ackport-v3.7-help-text-fixes-to-v3.5.patch | 73 +++++++++++++++++++ ...ze-and-make-help-text-in-status-area.patch | 58 +++++++++++++++ 5 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 patches/mg/3.5/0001-Backport-v3.7-help-text-fixes-to-v3.5.patch create mode 100644 patches/mg/3.6/0001-Redcuce-quick-size-and-make-help-text-in-status-area.patch diff --git a/board/common/rootfs/etc/profile.d/convenience.sh b/board/common/rootfs/etc/profile.d/convenience.sh index 799318ea..83dcb7b3 100644 --- a/board/common/rootfs/etc/profile.d/convenience.sh +++ b/board/common/rootfs/etc/profile.d/convenience.sh @@ -4,6 +4,7 @@ alias ll='ls -alF' alias ls='ls --color=auto' export EDITOR=/usr/bin/edit +export VISUAL=/usr/bin/edit export LESS="-P %f (press h for help or q to quit)" alias vim='vi' alias view='vi -R' diff --git a/board/common/rootfs/usr/bin/edit b/board/common/rootfs/usr/bin/edit index 0f0ddd39..0cf215e9 120000 --- a/board/common/rootfs/usr/bin/edit +++ b/board/common/rootfs/usr/bin/edit @@ -1 +1 @@ -nano \ No newline at end of file +mg \ No newline at end of file diff --git a/board/common/rootfs/usr/bin/editor b/board/common/rootfs/usr/bin/editor index 0f0ddd39..0cf215e9 120000 --- a/board/common/rootfs/usr/bin/editor +++ b/board/common/rootfs/usr/bin/editor @@ -1 +1 @@ -nano \ No newline at end of file +mg \ No newline at end of file diff --git a/patches/mg/3.5/0001-Backport-v3.7-help-text-fixes-to-v3.5.patch b/patches/mg/3.5/0001-Backport-v3.7-help-text-fixes-to-v3.5.patch new file mode 100644 index 00000000..afc5d27c --- /dev/null +++ b/patches/mg/3.5/0001-Backport-v3.7-help-text-fixes-to-v3.5.patch @@ -0,0 +1,73 @@ +From eb6a25f194bc76f2fefff319bcf9cb7d64b17e11 Mon Sep 17 00:00:00 2001 +From: Joachim Wiberg +Date: Sun, 23 Jul 2023 10:44:46 +0200 +Subject: [PATCH] Backport v3.7 help text fixes to v3.5 +Organization: Addiva Elektronik + + - Follow-up to #17: reorder and imporve *quick* buffer + - Replace 2nd undo command in *quick* with mark-all instead + - Move C + M help last on the line + - Redcuce *quick* size and make help text in status area permanent + +Signed-off-by: Joachim Wiberg +--- + src/echo.c | 1 + + src/help.c | 16 +++++++--------- + 2 files changed, 8 insertions(+), 9 deletions(-) + +diff --git a/src/echo.c b/src/echo.c +index 12a0853..e7388c9 100644 +--- a/src/echo.c ++++ b/src/echo.c +@@ -46,6 +46,7 @@ eerase(void) + tteeol(); + ttflush(); + epresf = FALSE; ++ ewprintf(" %s", hlp); + } + + /* +diff --git a/src/help.c b/src/help.c +index 19fe9bf..980b0ae 100644 +--- a/src/help.c ++++ b/src/help.c +@@ -19,7 +19,7 @@ + + #define KEYNAMESZ 6 /* max is "C-SPC" */ + +-const char *hlp = "C-h q toggle quick help | C-h t show tutorial | C-h b show key bindings"; ++const char *hlp = "C-h q quick help | C-h t tutorial | C-h b key bindings | C = Ctrl | M = Alt"; + + static int showall(struct buffer *, KEYMAP *, char *); + static int findbind(KEYMAP *, PF, char *, size_t); +@@ -237,13 +237,11 @@ quickhelp(int f, int n) + bp->b_flag |= BFREADONLY; + + addline(bp, "FILE BUFFER WINDOW MARK/KILL MISC"); +- addline(bp, "C-x C-c exit C-x C-k close C-0 only other C-space mark C-_ undo"); +- addline(bp, "C-x C-f find C-x k other C-1 only this C-w wipe C-s search"); +- addline(bp, "C-x C-s save C-x C-b list C-2 split two C-k close C-r r-search"); +- addline(bp, "C-x s all C-x b switch C-x ^ enlarge C-y yank M-% replace"); +- addline(bp, "C-x i insert C-x g goto ln C-x o other win C-x C-x swap M-q reformat"); +- addline(bp, "______________________________________________________________________________"); +- addlinef(bp, "%s", hlp); ++ addline(bp, "C-x C-c exit C-x b switch C-x 0 only other C-space mark C-_ undo"); ++ addline(bp, "C-x C-f find C-x k close C-x 1 only this C-w kill-rg C-s search"); ++ addline(bp, "C-x C-s save C-x C-b list C-x 2 split two C-k kill-ln C-r r-search"); ++ addline(bp, "C-x s save-all C-x h mark C-x ^ enlarge C-y yank M-% replace"); ++ addline(bp, "C-x i insert C-x g goto-ln C-x o other win C-x C-x swap M-q reformat"); + + rc = popbuftop(bp, WNONE); + if (rc == TRUE) { +@@ -252,7 +250,7 @@ quickhelp(int f, int n) + prevwind(0, 0); + + /* Attempt to shkrink window to size fo quick help */ +- n = curwp->w_ntrows - 8; ++ n = curwp->w_ntrows - 6; + shrinkwind(FFRAND, n); + + prevwind(0, 0); +-- +2.34.1 + diff --git a/patches/mg/3.6/0001-Redcuce-quick-size-and-make-help-text-in-status-area.patch b/patches/mg/3.6/0001-Redcuce-quick-size-and-make-help-text-in-status-area.patch new file mode 100644 index 00000000..e23ace68 --- /dev/null +++ b/patches/mg/3.6/0001-Redcuce-quick-size-and-make-help-text-in-status-area.patch @@ -0,0 +1,58 @@ +From 2effd39272fb6137220700f00e3901e4575772ac Mon Sep 17 00:00:00 2001 +From: Joachim Wiberg +Date: Sun, 23 Jul 2023 10:44:46 +0200 +Subject: [PATCH 1/2] Redcuce *quick* size and make help text in status area + permanent +Organization: Addiva Elektronik + +In an effort to improve on the usability for beginners, without getting +in the way of experienced Mg users, the initial help text in the status +area is now shown permanently. I.e., whenever Mg clears the statis area +we show the help text. + +Since we now show the help text in the status area we can drop it from +the *quick* help buffer and reduce the height to save screen estate. + +Signed-off-by: Joachim Wiberg +--- + src/echo.c | 1 + + src/help.c | 4 +--- + 2 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/src/echo.c b/src/echo.c +index 397ddc4..46a095f 100644 +--- a/src/echo.c ++++ b/src/echo.c +@@ -46,6 +46,7 @@ eerase(void) + tteeol(); + ttflush(); + epresf = FALSE; ++ ewprintf(" %s", hlp); + } + + /* +diff --git a/src/help.c b/src/help.c +index 03bd8f8..cc49bed 100644 +--- a/src/help.c ++++ b/src/help.c +@@ -239,8 +239,6 @@ quickhelp(int f, int n) + addline(bp, "C-x C-s save C-x C-b list C-x 2 split two C-k kill-ln C-r r-search"); + addline(bp, "C-x s save-all C-x h mark C-x ^ enlarge C-y yank M-% replace"); + addline(bp, "C-x i insert C-x g goto-ln C-x o other win C-x C-x swap M-q reformat"); +- addline(bp, "______________________________________________________________________________"); +- addlinef(bp, "%s", hlp); + + rc = popbuftop(bp, WNONE); + if (rc == TRUE) { +@@ -249,7 +247,7 @@ quickhelp(int f, int n) + prevwind(0, 0); + + /* Attempt to shkrink window to size fo quick help */ +- n = curwp->w_ntrows - 8; ++ n = curwp->w_ntrows - 6; + shrinkwind(FFRAND, n); + + prevwind(0, 0); +-- +2.34.1 +