On Tue, Nov 17, 2020 at 09:31:27AM +0000, Gregory Heytings wrote:
I attach an updated version of my patch, which contains the two modifications I mentioned in my post scriptum, and fixes a bug in the previous patch when pager_index_lines is non-zero.

Hi Gregory,

No need to email me directly. :) I saw your previous patches but was waiting for some more comments before diving in again.

First I'd like to note that I'm not in favor of features that treat Mutt as a "library". If your patches have general merit, I'll consider them, but I'm not likely to add something just because it would make a Killer Featureā„¢ easier for you to develop.

Gregory Seidman seemed to think this would be useful, so let's get the last few issues ironed out and see about getting it applied. BTW, I still haven't had a chance to compile/test things yet, but I will try to do so later this afternoon.


diff --git a/contrib/mutt_xtitle.c b/contrib/mutt_xtitle.c
new file mode 100644
index 00000000..56a1e1e5

This would need to be listed in contrib/Makefile.am too, to be included in a release tarball.


diff --git a/curs_lib.c b/curs_lib.c
index 01bcde69..32d58ac8 100644
--- a/curs_lib.c
+++ b/curs_lib.c

+static char *mutt_process_status_line (char *s)
+{
+  BUFFER *command, *status; FILE *filter; char *ps = NULL; size_t ps_size; int 
r; pid_t pid;
+
+  if (!ProcessStatusLine)
+    return s;
+
+  status = mutt_buffer_new ();
+  mutt_buffer_quote_filename (status, s);
+
+  command = mutt_buffer_new ();

The buffer pool should use mutt_buffer_pool_get() + mutt_buffer_pool_release() to obtain and release buffers. Directly
managed buffers use mutt_buffer_new() + mutt_buffer_free().

+  mutt_buffer_addstr (command, ProcessStatusLine);
+  mutt_buffer_addstr (command, " ");
+  mutt_buffer_addstr (command, status->data);

I don't insist, but you may still want to look into mutt_expand_file_fmt() instead. It allows a %s to optionally be put inside ProcessStatusLine, which gives users more flexibility if they need it.

+  ps = mutt_read_line (NULL, &ps_size, filter, NULL, 0);

mutt_read_line() returns a malloc'ed string.

+void mutt_draw_status_window (mutt_window_t *w, char *s)

I understand why you moved the OPTDISPLAYSTATUSBAR check inside mutt_process_and_draw_status_window(). That's fine (personally I would have just left the pager index_status_window as direct calls). But I think a comment here noting it doesn't check the option might be good,
just to make the intent explicit.


--
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