Re: [PATCH] emacs: notmuch-show-header-line: allow format strings and functions

2022-06-01 Thread David Bremner
Jose A Ortega Ruiz writes: > On Wed, Jun 01 2022, David Bremner wrote: > >>> Yes, good idea. I've done just that in a new version (v4) of the patch. >>> I've also noticed the variable notmuch-show-header-line is already >>> documented in doc/notmuch-emacs.rst (by importing its docstring): do we

Re: [PATCH] emacs: notmuch-show-header-line: allow format strings and functions

2022-06-01 Thread Jose A Ortega Ruiz
On Wed, Jun 01 2022, David Bremner wrote: >> Yes, good idea. I've done just that in a new version (v4) of the patch. >> I've also noticed the variable notmuch-show-header-line is already >> documented in doc/notmuch-emacs.rst (by importing its docstring): do we >> need to add documentation elsewh

Re: [PATCH] emacs: notmuch-show-header-line: allow format strings and functions

2022-06-01 Thread David Bremner
Jose A Ortega Ruiz writes: > On Wed, Jun 01 2022, David Bremner wrote: > >> Fair enough. But since the calling is not obvious to the casual user >> (*cough* or me), maybe mention the availability of message properties >> in the docstring. > > Yes, good idea. I've done just that in a new version

Re: [PATCH] emacs: notmuch-show-header-line: allow format strings and functions

2022-06-01 Thread Jose A Ortega Ruiz
On Wed, Jun 01 2022, David Bremner wrote: > Fair enough. But since the calling is not obvious to the casual user > (*cough* or me), maybe mention the availability of message properties > in the docstring. Yes, good idea. I've done just that in a new version (v4) of the patch. I've also noticed t

[PATCH v4 1/1] emacs: notmuch-show-header-line: allow format strings and functions

2022-06-01 Thread jao
If a string value is assigned to notmuch-show-header-line, it's used as a format string to be passed passed to format-spec with `%s` substituted by the message's subject. If a function is given, it's called with the subject as argument, and its return value used as header line. As before, t means

[PATCH v4 0/1] notmuch-show-header-line: allow format strings and functions

2022-06-01 Thread jao
This one overrides id:20220518192956.1440103-1-...@gnu.org, by improving the docstring. jao (1): emacs: notmuch-show-header-line: allow format strings and functions emacs/notmuch-show.el | 46 ++- 1 file changed, 37 insertions(+), 9 deletions

Re: [PATCH] emacs: notmuch-show-header-line: allow format strings and functions

2022-06-01 Thread David Bremner
Jose A Ortega Ruiz writes: > On Thu, May 26 2022, David Bremner wrote: >> The API defined here (function taking the subject as a string) seems a >> bit limited. What if the user wants to use some other message header in >> the header-line? Or list tags? > > well, the function is called with the

Re: [PATCH] emacs: notmuch-show-header-line: allow format strings and functions

2022-05-27 Thread Jose A Ortega Ruiz
On Thu, May 26 2022, David Bremner wrote: > jao writes: > >> If a string value is assigned to notmuch-show-header-line, it's used >> as a format string to be passed passed to format-spec with `%s` >> substituted by the message's subject. If a function is given, it's >> called with the subject as

Re: [PATCH] emacs: notmuch-show-header-line: allow format strings and functions

2022-05-26 Thread David Bremner
jao writes: > If a string value is assigned to notmuch-show-header-line, it's used > as a format string to be passed passed to format-spec with `%s` > substituted by the message's subject. If a function is given, it's > called with the subject as argument, and its return value used as > header l

Re: [PATCH v2 1/1] emacs: notmuch-show-header-line: allow format strings and functions

2022-05-18 Thread Jose A Ortega Ruiz
On Wed, May 18 2022, David Bremner wrote: > Jose A Ortega Ruiz writes: > >> On Tue, May 17 2022, Tomi Ollila wrote: >> >> >> [...] >> >>> To me it looks like some lines are indented with tabs and some spaces >>> (noticed as indentation looked weird to me and then started moving cursor >>> at the

notmuch-show-header-line: allow format strings and functions

2022-05-18 Thread jao
This one overrides id:20220516022039.551596-1-...@gnu.org, hopefully using proper indentation, and refactoring the new functionality in a separate function for clarity. ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to

[PATCH] emacs: notmuch-show-header-line: allow format strings and functions

2022-05-18 Thread jao
If a string value is assigned to notmuch-show-header-line, it's used as a format string to be passed passed to format-spec with `%s` substituted by the message's subject. If a function is given, it's called with the subject as argument, and its return value used as header line. As before, t means

Re: [PATCH v2 1/1] emacs: notmuch-show-header-line: allow format strings and functions

2022-05-18 Thread Tomi Ollila
On Tue, May 17 2022, Jose A. Ortega Ruiz wrote: > On Tue, May 17 2022, Tomi Ollila wrote: > > [...] > >> Otherwise it looks good to me (took a bit to match cond CLAUSES...) > > perhaps it'd be bit clearer if i factor it out in a separate function > that just does the bit of setting the header line

Re: [PATCH v2 1/1] emacs: notmuch-show-header-line: allow format strings and functions

2022-05-18 Thread David Bremner
Jose A Ortega Ruiz writes: > On Tue, May 17 2022, Tomi Ollila wrote: > > > [...] > >> To me it looks like some lines are indented with tabs and some spaces >> (noticed as indentation looked weird to me and then started moving cursor >> at the beginning of line -- there is probably a way to highli

Re: [PATCH v2 1/1] emacs: notmuch-show-header-line: allow format strings and functions

2022-05-17 Thread Jose A Ortega Ruiz
On Tue, May 17 2022, Tomi Ollila wrote: [...] > Otherwise it looks good to me (took a bit to match cond CLAUSES...) perhaps it'd be bit clearer if i factor it out in a separate function that just does the bit of setting the header line format? cheers, jao -- Not far from the invention of fire

Re: [PATCH v2 1/1] emacs: notmuch-show-header-line: allow format strings and functions

2022-05-17 Thread Jose A Ortega Ruiz
On Tue, May 17 2022, Tomi Ollila wrote: [...] > To me it looks like some lines are indented with tabs and some spaces > (noticed as indentation looked weird to me and then started moving cursor > at the beginning of line -- there is probably a way to highlight tabs in > notmuch show buffer but..

Re: [PATCH v2 1/1] emacs: notmuch-show-header-line: allow format strings and functions

2022-05-17 Thread Tomi Ollila
On Mon, May 16 2022, j...@gnu.org wrote: > If a string value is assigned to notmuch-show-header-line, it's used > as a format string to be passed passed to format-spec with `%s` > substituted by the message's subject. If a function is given, it's > called with the subject as argument, and its ret

[PATCH v2 1/1] emacs: notmuch-show-header-line: allow format strings and functions

2022-05-15 Thread jao
If a string value is assigned to notmuch-show-header-line, it's used as a format string to be passed passed to format-spec with `%s` substituted by the message's subject. If a function is given, it's called with the subject as argument, and its return value used as header line. As before, t means

[PATCH v2 0/1] notmuch-show-header-line: allow format strings and functions

2022-05-15 Thread jao
This one extends the previous version that accepted a format string by also accepting an arbitrary function. jao (1): emacs: notmuch-show-header-line: allow format strings and functions emacs/notmuch-show.el | 37 ++--- 1 file changed, 30 insertions(+), 7