[PATCH] doc: tweak hook configuration documentation.

2021-06-22 Thread David Bremner
Add a historical note, and hint to look below for more about hooks.
Capitalized the heading for consistency.
---
 doc/man1/notmuch-config.rst | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/doc/man1/notmuch-config.rst b/doc/man1/notmuch-config.rst
index 56f4a160..eb941dc8 100644
--- a/doc/man1/notmuch-config.rst
+++ b/doc/man1/notmuch-config.rst
@@ -85,6 +85,10 @@ paths are presumed relative to `$HOME` for items in section
 Directory containing hooks run by notmuch commands. See
 :any:`notmuch-hooks(5)`.
 
+History: this configuration value was introduced in notmuch 0.32.
+
+Default: See HOOKS, below.
+
 **user.name**
 Your full name.
 
@@ -261,7 +265,7 @@ Notmuch configuration file search order:
by :envvar:`NOTMUCH_PROFILE` environment variable if set,
``$HOME/.notmuch-config`` otherwise.
 
-Hooks
+HOOKS
 -
 
 Notmuch hook directory search order:
-- 
2.30.2
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[PATCH] emacs: Add compatibility for org-msg.el

2021-06-22 Thread Ori
See https://github.com/jeremy-compostella/org-msg/issues/53
---
 NEWS | 2 ++
 emacs/notmuch-company.el | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 09456f60..c167c9a2 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ Emacs
 previous behaviour of using notmuch to send mail by default, customize
 `mail-user-agent` to `notmuch-user-agent`.
 
+`notmuch-company` now works in `org-msg`.
+
 Vim
 ---
 
diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el
index c6a004ae..7e05dc8f 100644
--- a/emacs/notmuch-company.el
+++ b/emacs/notmuch-company.el
@@ -70,7 +70,8 @@
(completion-ignore-case t))
 (cl-case command
   (interactive (company-begin-backend 'notmuch-company))
-  (prefix (and (derived-mode-p 'message-mode)
+  (prefix (and (or (derived-mode-p 'message-mode)
+  (derived-mode-p 'org-msg-edit-mode))
   (looking-back
(concat notmuch-address-completion-headers-regexp ".*")
(line-beginning-position))
-- 
2.25.1
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[PATCH] cli/show: add --color/--no-color

2021-06-22 Thread Hannu Hartikainen
These arguments allow setting color explicitly on or off when using
`--format=pretty`. The default is still to use color iff stdout is a
TTY.
---

I got a reply off-list to my previous patch (cli/show: add
--format=pretty) about explicitly enabling color (for use with $PAGER).
It's quite a minor addition so I just implemented it. IMHO this warrants
its own commit; it's a separate feature from --format=pretty. But I'm ok
with squashing these together if that's considered better.

Of course, with an explicit --color command-line argument in one command
for one purpose, one could reasonably ask if other commands should
support colored output as well. What do you all think?

 doc/man1/notmuch-show.rst | 6 ++
 notmuch-client.h  | 1 +
 notmuch-show.c| 4 +++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/doc/man1/notmuch-show.rst b/doc/man1/notmuch-show.rst
index 1fe4dcc7..e61000a6 100644
--- a/doc/man1/notmuch-show.rst
+++ b/doc/man1/notmuch-show.rst
@@ -209,6 +209,12 @@ Supported options for **show** include
"text/html" parts, no part with content type "text/html" is included
in the output.
 
+.. option:: --color
+
+   Use colored output for formats that support that (currently only
+   ``--format=pretty``). By default, color is used if the output
+   goes to a TTY. To disable color, use ``--no-color``.
+
 A common use of **notmuch show** is to display a single thread of
 email messages. For this, use a search term of "thread:" as
 can be seen in the first column of output from the
diff --git a/notmuch-client.h b/notmuch-client.h
index 8227fea4..c4f7cfd6 100644
--- a/notmuch-client.h
+++ b/notmuch-client.h
@@ -78,6 +78,7 @@ typedef struct notmuch_show_params {
 int part;
 _notmuch_crypto_t crypto;
 bool include_html;
+bool color;
 GMimeStream *out_stream;
 } notmuch_show_params_t;
 
diff --git a/notmuch-show.c b/notmuch-show.c
index fe3b753e..6274a99a 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -612,7 +612,7 @@ format_part_pretty (const void *ctx, sprinter_t *sp, 
mime_node_t *node,
 GMimeContentType *content_type = g_mime_object_get_content_type (meta);
 GMimeStream *stream = params->out_stream;
 int i;
-bool color = isatty (fileno (stdout));
+bool color = params->color;
 
 if (GMIME_IS_MESSAGE (node->part)) {
GMimeMessage *message = GMIME_MESSAGE (node->part);
@@ -1300,6 +1300,7 @@ notmuch_show_command (notmuch_database_t *notmuch, int 
argc, char *argv[])
.part = -1,
.omit_excluded = true,
.output_body = true,
+   .color = isatty (fileno (stdout)),
.crypto = { .decrypt = NOTMUCH_DECRYPT_AUTO },
 };
 int format = NOTMUCH_FORMAT_NOT_SPECIFIED;
@@ -1334,6 +1335,7 @@ notmuch_show_command (notmuch_database_t *notmuch, int 
argc, char *argv[])
{ .opt_bool = , .name = "verify" },
{ .opt_bool = _body, .name = "body" },
{ .opt_bool = _html, .name = "include-html" },
+   { .opt_bool = , .name = "color" },
{ .opt_inherit = notmuch_shared_options },
{ }
 };
-- 
2.32.0
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org