>From 6d3e185a9ddacd94b8950775e3fb056c568fc66d Mon Sep 17 00:00:00 2001 From: "Peder O. Klingenberg" Date: Sun, 19 Feb 2017 20:59:14 +0100 Subject: [PATCH] Extend emacsclient --quiet to cover eval output * lib-src/emacsclient.c (main): Extend --quiet flag to suppress printing of eval-results. (Bug#25708) --- lib-src/emacsclient.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 70709ecec0..65ea5541b8 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -1860,19 +1860,25 @@ main (int argc, char **argv) else if (strprefix ("-print ", p)) { /* -print STRING: Print STRING on the terminal. */ - str = unquote_argument (p + strlen ("-print ")); - if (needlf) - printf ("\n"); - printf ("%s", str); - needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; - } + if (!quiet) + { + str = unquote_argument (p + strlen ("-print ")); + if (needlf) + printf ("\n"); + printf ("%s", str); + needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; + } + } else if (strprefix ("-print-nonl ", p)) { /* -print-nonl STRING: Print STRING on the terminal. Used to continue a preceding -print command. */ - str = unquote_argument (p + strlen ("-print-nonl ")); - printf ("%s", str); - needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; + if (!quiet) + { + str = unquote_argument (p + strlen ("-print-nonl ")); + printf ("%s", str); + needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n'; + } } else if (strprefix ("-error ", p)) { -- 2.11.0