{"thread":{"id":"34252","subject":"[PATCH] help: introduce man.viewer = eman","startedAt":"2013-06-22T11:43:29Z","lastAt":"2013-06-22T12:05:01Z","messageCount":3,"participants":["Ramkumar Ramachandra","John Keeping"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"221679","messageId":"1371901409-8319-1-git-send-email-artagnon@gmail.com","threadId":"34252","inReplyTo":null,"subject":"[PATCH] help: introduce man.viewer = eman","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T11:43:29Z","receivedAt":"2013-06-22T11:43:29Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Corresponding to woman.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n Documentation/git-help.txt |  3 +++\n builtin/help.c             | 11 ++++++++---\n 2 files changed, 11 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-help.txt b/Documentation/git-help.txt\nindex b21e9d7..0cb4c46 100644\n--- a/Documentation/git-help.txt\n+++ b/Documentation/git-help.txt\n@@ -104,6 +104,9 @@ The 'man.viewer' config variable will be checked if the 'man' format\n is chosen. The following values are currently supported:\n \n * \"man\": use the 'man' program as usual,\n+* \"eman\": use 'emacsclient' to launch the \"man\" mode in emacs\n+(this only works starting with emacsclient versions 22), on systems\n+with man,\n * \"woman\": use 'emacsclient' to launch the \"woman\" mode in emacs\n (this only works starting with emacsclient versions 22),\n * \"konqueror\": use 'kfmclient' to open the man page in a new konqueror\ndiff --git a/builtin/help.c b/builtin/help.c\nindex 062957f..7cb44e0 100644\n--- a/builtin/help.c\n+++ b/builtin/help.c\n@@ -120,7 +120,7 @@ static int check_emacsclient_version(void)\n \treturn 0;\n }\n \n-static void exec_woman_emacs(const char *path, const char *page)\n+static void exec_woman_emacs(const char *path, const char *page, int eman)\n {\n \tif (!check_emacsclient_version()) {\n \t\t/* This works only with emacsclient version >= 22. */\n@@ -128,7 +128,10 @@ static void exec_woman_emacs(const char *path, const char *page)\n \n \t\tif (!path)\n \t\t\tpath = \"emacsclient\";\n-\t\tstrbuf_addf(&man_page, \"(woman \\\"%s\\\")\", page);\n+\t\tif (eman)\n+\t\t\tstrbuf_addf(&man_page, \"(man \\\"%s\\\")\", page);\n+\t\telse\n+\t\t\tstrbuf_addf(&man_page, \"(woman \\\"%s\\\")\", page);\n \t\texeclp(path, \"emacsclient\", \"-e\", man_page.buf, (char *)NULL);\n \t\twarning(_(\"failed to exec '%s': %s\"), path, strerror(errno));\n \t}\n@@ -341,8 +344,10 @@ static void exec_viewer(const char *name, const char *page)\n \n \tif (!strcasecmp(name, \"man\"))\n \t\texec_man_man(info, page);\n+\telse if (!strcasecmp(name, \"eman\"))\n+\t\texec_woman_emacs(info, page, 1);\n \telse if (!strcasecmp(name, \"woman\"))\n-\t\texec_woman_emacs(info, page);\n+\t\texec_woman_emacs(info, page, 0);\n \telse if (!strcasecmp(name, \"konqueror\"))\n \t\texec_man_konqueror(info, page);\n \telse if (info)\n-- \n1.8.3.1.487.g3e7a5b4.dirty\n"},{"id":"221681","messageId":"20130622115938.GF4676@serenity.lan","threadId":"34252","inReplyTo":"1371901409-8319-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH] help: introduce man.viewer = eman","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-06-22T11:59:38Z","receivedAt":"2013-06-22T11:59:38Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Sat, Jun 22, 2013 at 05:13:29PM +0530, Ramkumar Ramachandra wrote:\n> Corresponding to woman.\n> \n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> ---\n>  Documentation/git-help.txt |  3 +++\n>  builtin/help.c             | 11 ++++++++---\n>  2 files changed, 11 insertions(+), 3 deletions(-)\n> \n> diff --git a/Documentation/git-help.txt b/Documentation/git-help.txt\n> index b21e9d7..0cb4c46 100644\n> --- a/Documentation/git-help.txt\n> +++ b/Documentation/git-help.txt\n> @@ -104,6 +104,9 @@ The 'man.viewer' config variable will be checked if the 'man' format\n>  is chosen. The following values are currently supported:\n>  \n>  * \"man\": use the 'man' program as usual,\n> +* \"eman\": use 'emacsclient' to launch the \"man\" mode in emacs\n> +(this only works starting with emacsclient versions 22), on systems\n> +with man,\n>  * \"woman\": use 'emacsclient' to launch the \"woman\" mode in emacs\n>  (this only works starting with emacsclient versions 22),\n>  * \"konqueror\": use 'kfmclient' to open the man page in a new konqueror\n> diff --git a/builtin/help.c b/builtin/help.c\n> index 062957f..7cb44e0 100644\n> --- a/builtin/help.c\n> +++ b/builtin/help.c\n> @@ -120,7 +120,7 @@ static int check_emacsclient_version(void)\n>  \treturn 0;\n>  }\n>  \n> -static void exec_woman_emacs(const char *path, const char *page)\n> +static void exec_woman_emacs(const char *path, const char *page, int eman)\n>  {\n>  \tif (!check_emacsclient_version()) {\n>  \t\t/* This works only with emacsclient version >= 22. */\n> @@ -128,7 +128,10 @@ static void exec_woman_emacs(const char *path, const char *page)\n>  \n>  \t\tif (!path)\n>  \t\t\tpath = \"emacsclient\";\n> -\t\tstrbuf_addf(&man_page, \"(woman \\\"%s\\\")\", page);\n> +\t\tif (eman)\n> +\t\t\tstrbuf_addf(&man_page, \"(man \\\"%s\\\")\", page);\n> +\t\telse\n> +\t\t\tstrbuf_addf(&man_page, \"(woman \\\"%s\\\")\", page);\n\nWould it be nicer to pass a string in here instead of a flag?  Then this\nbecomes:\n\n\tstrbuf_addf(&man_page, \"(%s \\\"%s\\\")\", command, page);\n\nYou should probably also rename this function to \"exec_emacsclient\" or\nsomething as well now that it doesn't just launch woman.\n\n>  \t\texeclp(path, \"emacsclient\", \"-e\", man_page.buf, (char *)NULL);\n>  \t\twarning(_(\"failed to exec '%s': %s\"), path, strerror(errno));\n>  \t}\n> @@ -341,8 +344,10 @@ static void exec_viewer(const char *name, const char *page)\n>  \n>  \tif (!strcasecmp(name, \"man\"))\n>  \t\texec_man_man(info, page);\n> +\telse if (!strcasecmp(name, \"eman\"))\n> +\t\texec_woman_emacs(info, page, 1);\n>  \telse if (!strcasecmp(name, \"woman\"))\n> -\t\texec_woman_emacs(info, page);\n> +\t\texec_woman_emacs(info, page, 0);\n>  \telse if (!strcasecmp(name, \"konqueror\"))\n>  \t\texec_man_konqueror(info, page);\n>  \telse if (info)\n> -- \n> 1.8.3.1.487.g3e7a5b4.dirty\n"},{"id":"221682","messageId":"CALkWK0m6V9ULgeA81yK2WuoLgf6n4q8_BS-D4VHpTYJMQiG95Q@mail.gmail.com","threadId":"34252","inReplyTo":"20130622115938.GF4676@serenity.lan","subject":"Re: [PATCH] help: introduce man.viewer = eman","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-22T12:05:01Z","receivedAt":"2013-06-22T12:05:01Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"John Keeping wrote:\n> Would it be nicer to pass a string in here instead of a flag?  Then this\n> becomes:\n>\n>         strbuf_addf(&man_page, \"(%s \\\"%s\\\")\", command, page);\n>\n> You should probably also rename this function to \"exec_emacsclient\" or\n> something as well now that it doesn't just launch woman.\n\nSure, will do both.\n"}]}