[PATCH] cli/help: give a hint about notmuch-emacs-mua

classic Classic list List threaded Threaded
10 messages Options
Daniel Kahn Gillmor Daniel Kahn Gillmor
Reply | Threaded
Open this post in threaded view
|

[PATCH] cli/help: give a hint about notmuch-emacs-mua

"notmuch help" doesn't mention "notmuch-emacs-mua" even though we
support it through the try_external_command() mechanism.

In addition, "notmuch help emacs-mua" doesn't work, even though we
ship the appropriate manpage.

This changeset fixes both of these problems.
---
 notmuch.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/notmuch.c b/notmuch.c
index efbe32ff..8eab561b 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -172,6 +172,8 @@ static command_t commands[] = {
       "Re-index all messages matching the search terms." },
     { "config", notmuch_config_command, NOTMUCH_CONFIG_OPEN,
       "Get or set settings in the notmuch configuration file." },
+    { "emacs-mua", NULL, 0,
+      "send mail with notmuch and emacs." },
     { "help", notmuch_help_command, NOTMUCH_CONFIG_CREATE, /* create but don't save config */
       "This message, or more detailed help for the named command." }
 };
@@ -487,7 +489,8 @@ main (int argc, char *argv[])
     notmuch_process_shared_options (command_name);
 
     command = find_command (command_name);
-    if (!command) {
+    /* if command->function is NULL, try external command */
+    if (!command || !command->function) {
  /* This won't return if the external command is found. */
  if (try_external_command(argv + opt_index))
     fprintf (stderr, "Error: Unknown command '%s' (see \"notmuch help\")\n",
--
2.14.2

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Daniel Kahn Gillmor Daniel Kahn Gillmor
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] cli/help: give a hint about notmuch-emacs-mua

On Thu 2017-10-26 18:27:51 -0400, Daniel Kahn Gillmor wrote:
> "notmuch help" doesn't mention "notmuch-emacs-mua" even though we
> support it through the try_external_command() mechanism.
>
> In addition, "notmuch help emacs-mua" doesn't work, even though we
> ship the appropriate manpage.
>
> This changeset fixes both of these problems.

Ping!  i don't think this patch is complex or objectionable.  Can it be
merged?

        --dkg
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Tomi Ollila-2 Tomi Ollila-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] cli/help: give a hint about notmuch-emacs-mua

On Thu, Nov 30 2017, Daniel Kahn Gillmor wrote:

> On Thu 2017-10-26 18:27:51 -0400, Daniel Kahn Gillmor wrote:
>> "notmuch help" doesn't mention "notmuch-emacs-mua" even though we
>> support it through the try_external_command() mechanism.
>>
>> In addition, "notmuch help emacs-mua" doesn't work, even though we
>> ship the appropriate manpage.
>>
>> This changeset fixes both of these problems.
>
> Ping!  i don't think this patch is complex or objectionable.  Can it be
> merged?

it may (*) look like we don't have #if WITH_EMACS (**) cpp macros defined ???

Tomi

(*) did not check...

(**) this is emacs-specific stull, less generic that other hints (if that
matters) ...

Sorry to cause confusion...

>
>         --dkg
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Daniel Kahn Gillmor Daniel Kahn Gillmor
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] cli/help: give a hint about notmuch-emacs-mua

On Thu 2017-11-30 11:08:05 +0200, Tomi Ollila wrote:

> On Thu, Nov 30 2017, Daniel Kahn Gillmor wrote:
>
>> On Thu 2017-10-26 18:27:51 -0400, Daniel Kahn Gillmor wrote:
>>> "notmuch help" doesn't mention "notmuch-emacs-mua" even though we
>>> support it through the try_external_command() mechanism.
>>>
>>> In addition, "notmuch help emacs-mua" doesn't work, even though we
>>> ship the appropriate manpage.
>>>
>>> This changeset fixes both of these problems.
>>
>> Ping!  i don't think this patch is complex or objectionable.  Can it be
>> merged?
>
> it may (*) look like we don't have #if WITH_EMACS (**) cpp macros defined ???
>
> Tomi
>
> (*) did not check...
>
> (**) this is emacs-specific stull, less generic that other hints (if that
> matters) ...
>
> Sorry to cause confusion...

confusion is right!  i don't understand what you're saying, sorry.  are
you suggesting a different change somehow?  Want to propose a different patch?

           --dkg
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Tomi Ollila-2 Tomi Ollila-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] cli/help: give a hint about notmuch-emacs-mua

On Thu, Nov 30 2017, Daniel Kahn Gillmor wrote:

> On Thu 2017-11-30 11:08:05 +0200, Tomi Ollila wrote:
>> On Thu, Nov 30 2017, Daniel Kahn Gillmor wrote:
>>
>>> On Thu 2017-10-26 18:27:51 -0400, Daniel Kahn Gillmor wrote:
>>>> "notmuch help" doesn't mention "notmuch-emacs-mua" even though we
>>>> support it through the try_external_command() mechanism.
>>>>
>>>> In addition, "notmuch help emacs-mua" doesn't work, even though we
>>>> ship the appropriate manpage.
>>>>
>>>> This changeset fixes both of these problems.
>>>
>>> Ping!  i don't think this patch is complex or objectionable.  Can it be
>>> merged?
>>
>> it may (*) look like we don't have #if WITH_EMACS (**) cpp macros defined ???
>>
>> Tomi
>>
>> (*) did not check...
>>
>> (**) this is emacs-specific stull, less generic that other hints (if that
>> matters) ...
>>
>> Sorry to cause confusion...
>
> confusion is right!  i don't understand what you're saying, sorry.  are
> you suggesting a different change somehow?  Want to propose a different
> patch?

My thought was that even though user may compile notmuch without emacs
support (and notmuch-emacs-mua not installed) we would be hinting
`notmuch emacs-mua` command to exist.

Tomi

>
>            --dkg
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Daniel Kahn Gillmor Daniel Kahn Gillmor
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] cli/help: give a hint about notmuch-emacs-mua

On Sun 2017-12-03 15:26:32 +0200, Tomi Ollila wrote:
> My thought was that even though user may compile notmuch without emacs
> support (and notmuch-emacs-mua not installed) we would be hinting
> `notmuch emacs-mua` command to exist.

Currently, if the user *does* compile with emacs support, and installs
it, we are hinting that "notmuch emacs-mua" *doesn't* exist.

Given that "notmuch emacs-mua" does exist somewhere (even if it's not in
the local installation), i prefer the error in the direction of
inclusion.

But maybe you'll find my revised version
(id:[hidden email]) mitigates the error
you're pointing out?

       --dkg
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Daniel Kahn Gillmor Daniel Kahn Gillmor
Reply | Threaded
Open this post in threaded view
|

[PATCH v2] cli/help: give a hint about notmuch-emacs-mua

In reply to this post by Tomi Ollila-2
"notmuch help" doesn't mention "notmuch-emacs-mua" even though we
support it through the try_external_command() mechanism.

In addition, "notmuch help emacs-mua" doesn't work, even though we
ship the appropriate manpage.

This changeset fixes both of these problems.
---
 configure | 1 +
 notmuch.c | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index bd034f91..f1974520 100755
--- a/configure
+++ b/configure
@@ -1185,6 +1185,7 @@ COMMON_CONFIGURE_CFLAGS = \\
  \$(GMIME_CFLAGS) \$(TALLOC_CFLAGS) \$(ZLIB_CFLAGS) \\
  -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \$(VALGRIND_CFLAGS) \\
  -DHAVE_GETLINE=\$(HAVE_GETLINE) \\
+ -DWITH_EMACS=\$(WITH_EMACS) \\
  -DHAVE_CANONICALIZE_FILE_NAME=\$(HAVE_CANONICALIZE_FILE_NAME) \\
  -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR) \\
  -DHAVE_STRSEP=\$(HAVE_STRSEP) \\
diff --git a/notmuch.c b/notmuch.c
index d5bf7902..2d193aa8 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -172,6 +172,10 @@ static command_t commands[] = {
       "Re-index all messages matching the search terms." },
     { "config", notmuch_config_command, NOTMUCH_CONFIG_OPEN,
       "Get or set settings in the notmuch configuration file." },
+#if WITH_EMACS
+    { "emacs-mua", NULL, 0,
+      "send mail with notmuch and emacs." },
+#endif
     { "help", notmuch_help_command, NOTMUCH_CONFIG_CREATE, /* create but don't save config */
       "This message, or more detailed help for the named command." }
 };
@@ -487,7 +491,8 @@ main (int argc, char *argv[])
     notmuch_process_shared_options (command_name);
 
     command = find_command (command_name);
-    if (!command) {
+    /* if command->function is NULL, try external command */
+    if (!command || !command->function) {
  /* This won't return if the external command is found. */
  if (try_external_command(argv + opt_index))
     fprintf (stderr, "Error: Unknown command '%s' (see \"notmuch help\")\n",
--
2.15.0

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Daniel Kahn Gillmor Daniel Kahn Gillmor
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] cli/help: give a hint about notmuch-emacs-mua

In reply to this post by Daniel Kahn Gillmor
On Mon 2017-12-04 10:44:40 -0500, Daniel Kahn Gillmor wrote:
> But maybe you'll find my revised version
> (id:[hidden email]) mitigates the error
> you're pointing out?

sorry, that should be id:[hidden email] --
the previous message-id was never sent.

    --dkg
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Tomi Ollila-2 Tomi Ollila-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2] cli/help: give a hint about notmuch-emacs-mua

In reply to this post by Daniel Kahn Gillmor
On Mon, Dec 04 2017, Daniel Kahn Gillmor wrote:

> "notmuch help" doesn't mention "notmuch-emacs-mua" even though we
> support it through the try_external_command() mechanism.
>
> In addition, "notmuch help emacs-mua" doesn't work, even though we
> ship the appropriate manpage.
>
> This changeset fixes both of these problems.

+1

Tomi


> ---
>  configure | 1 +
>  notmuch.c | 7 ++++++-
>  2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index bd034f91..f1974520 100755
> --- a/configure
> +++ b/configure
> @@ -1185,6 +1185,7 @@ COMMON_CONFIGURE_CFLAGS = \\
>   \$(GMIME_CFLAGS) \$(TALLOC_CFLAGS) \$(ZLIB_CFLAGS) \\
>   -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \$(VALGRIND_CFLAGS) \\
>   -DHAVE_GETLINE=\$(HAVE_GETLINE) \\
> + -DWITH_EMACS=\$(WITH_EMACS) \\
>   -DHAVE_CANONICALIZE_FILE_NAME=\$(HAVE_CANONICALIZE_FILE_NAME) \\
>   -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR) \\
>   -DHAVE_STRSEP=\$(HAVE_STRSEP) \\
> diff --git a/notmuch.c b/notmuch.c
> index d5bf7902..2d193aa8 100644
> --- a/notmuch.c
> +++ b/notmuch.c
> @@ -172,6 +172,10 @@ static command_t commands[] = {
>        "Re-index all messages matching the search terms." },
>      { "config", notmuch_config_command, NOTMUCH_CONFIG_OPEN,
>        "Get or set settings in the notmuch configuration file." },
> +#if WITH_EMACS
> +    { "emacs-mua", NULL, 0,
> +      "send mail with notmuch and emacs." },
> +#endif
>      { "help", notmuch_help_command, NOTMUCH_CONFIG_CREATE, /* create but don't save config */
>        "This message, or more detailed help for the named command." }
>  };
> @@ -487,7 +491,8 @@ main (int argc, char *argv[])
>      notmuch_process_shared_options (command_name);
>  
>      command = find_command (command_name);
> -    if (!command) {
> +    /* if command->function is NULL, try external command */
> +    if (!command || !command->function) {
>   /* This won't return if the external command is found. */
>   if (try_external_command(argv + opt_index))
>      fprintf (stderr, "Error: Unknown command '%s' (see \"notmuch help\")\n",
> --
> 2.15.0
>
> _______________________________________________
> notmuch mailing list
> [hidden email]
> https://notmuchmail.org/mailman/listinfo/notmuch
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2] cli/help: give a hint about notmuch-emacs-mua

In reply to this post by Daniel Kahn Gillmor
Daniel Kahn Gillmor <[hidden email]> writes:

> "notmuch help" doesn't mention "notmuch-emacs-mua" even though we
> support it through the try_external_command() mechanism.
>
> In addition, "notmuch help emacs-mua" doesn't work, even though we
> ship the appropriate manpage.
>
> This changeset fixes both of these problems.

pushed,

d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch