On Sun, Nov 15, 2020 at 01:35:11AM +0000, Gregory Heytings wrote:
I'd like to suggest a feature for Mutt: to make it possible to move the status line to the window title.

Hi Gregory,

Sorry I didn't have a chance to respond until now.

I'm glad you implemented the feature. I'm not convinced this would be a generally useful feature, though, and I don't like to add options that have a user-size of "one". What do others think?

Overall, I like the cleanup you did in the patch while adding the new functionality. Taking just a quick look, I have a few comments.

--- a/curs_lib.c
+++ b/curs_lib.c
@@ -775,6 +775,12 @@ void mutt_reflow_windows (void)
   MuttMessageWindow->row_offset = LINES - 1;

   memcpy (MuttIndexWindow, MuttStatusWindow, sizeof (mutt_window_t));
+
+  if (! option (OPTDISPLAYSTATUSBAR)) {

Watch the brace style.


+void mutt_draw_status_window (mutt_window_t *w, char *s)
+{
+  char command[512], dst[256]; pid_t pid; FILE *filter; int n, r;
+  if (ProcessStatusLine)
+  {

The filter part of the function is *really* clunky. You should use a BUFFER from the buffer pool to hold and generate the command. Use mutt_buffer_quote_filename() to perform correct escaping on the s parameter; or you may want to just use mutt_expand_file_fmt() so the ProcessStatusLine can have an optional %s expando.

Use mutt_read_line() to read the result. See, for example, mutt_account_getoauthbearer() in account.c. (There may be better examples in the code, that's just one I found quickly).

Stylistically, there are *way* too many dprint calls, and they probably shouldn't be at level 1. Also, in the rest of the patch you did a good job matching the function call parenthesis spacing, but I see a few without a space separator.


+  SETCOLOR (MT_COLOR_STATUS);
+  mutt_window_move (w, 0, 0);
+  mutt_paddstr (w->cols, s);
+  NORMAL_COLOR;

Maybe add a check here for option(OPTDISPLAYSTATUSBAR)?


+}
+
+void mutt_draw_help_window (mutt_window_t *w, char *s)
+{
+  if (! option (OPTHELP)) return;

Stylistically, I'd prefer to see this (and others lines like it in the patch) on multiple lines.


diff --git a/pager.c b/pager.c
index 4346b638..391789bf 100644
--- a/pager.c
+++ b/pager.c

+      mutt_draw_status_window (rd->pager_status_window, buffer);

+    mutt_draw_status_window (rd->index_status_window, buffer);

Be careful here - you are potentially piping both status lines. You probably only want the pager_status_window.

Also, I didn't have time to look deeply at index_status_lines/pager_status_lines flow and OPTSTATUSONTOP. I *think* it will deal okay with a status line with 0 rows, but would want to test and make sure about that.

--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA

Attachment: signature.asc
Description: PGP signature

Reply via email to