From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id E14E06DE01D0 for ; Tue, 13 Sep 2016 23:17:52 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.905 X-Spam-Level: X-Spam-Status: No, score=-0.905 tagged_above=-999 required=5 tests=[AWL=0.117, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.211, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wIVoOmXfk47A for ; Tue, 13 Sep 2016 23:17:52 -0700 (PDT) Received: from mail-pf0-f172.google.com (mail-pf0-f172.google.com [209.85.192.172]) by arlo.cworth.org (Postfix) with ESMTPS id 226266DE0134 for ; Tue, 13 Sep 2016 23:17:52 -0700 (PDT) Received: by mail-pf0-f172.google.com with SMTP id 128so2263692pfb.3 for ; Tue, 13 Sep 2016 23:17:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=3y5FLSi8g9MAqQ7gw5O9YuSga4ndia5ryAPy2Q3RN8g=; b=epovgQgiKjHLkBMs8GWfYzntxDuHs3nR9icc3K6pFzYAnxr2+5TLalvl5itqPPvYcS YOBOYETXIX6P+8u0pRZ4hlnPL/m7xz0py3xy7FahLNPkw4RKBmJQuLB8hQRYuOK64EQf Wrd85R2qaJkIdNrZgwWiidlsYUNnLIj9Sxq4mEWltCJqZ0ejGgOkL2u4rFMk8pB2wWXn 8lUVH3cBiODcyjVB+0ymnc+WpiV2PP2NjEJHl7C3pRtNLfM0yV6vTF/yNDUuoqOgaOqc HJR/vExA36OC4ByqVouTqPsQ69Wm3F5ciulhHTt6AHsxCQCciwIgZsPnsDtdkAwhhZbm KKTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3y5FLSi8g9MAqQ7gw5O9YuSga4ndia5ryAPy2Q3RN8g=; b=QRvXbd6keeRO9s6B+A3KtGdWM1DSrLNR8ZzhBL23ytmNUN8ueZhViJMFW5d/hLu/cw /u4rag0oVn4vFWqmVeA4l/yQMovJIKOGl5yy4u84FdDj8GWPnotf5AbsnRWbOT090eGs VwQE5GZM4hqi37eJcRCqeygsBcuf0NZAO0GR4fa9vXOPA5zM+iHLzj+IywwqOqm4i13g JEebN1jJrsieMpgSMRhMlM1uh/F7I4EF5Ru8yIymHVc/rPpXxlVx6ZRKw2jzM5fR4LhG qlwpL+g3COeJ5Z8xaCveiWUFRB+/fCvvA8VMK4UvEZMJzJcP6x2qc/xo33H557GH3SDM DWKQ== X-Gm-Message-State: AE9vXwMyFnRylTPinz12WvT1v2o1PunGlkBRHojisN/DAcUlB7hVvfXuoCZFdGw7prZ72oYp X-Received: by 10.98.94.6 with SMTP id s6mr1499367pfb.31.1473833871593; Tue, 13 Sep 2016 23:17:51 -0700 (PDT) Received: from marmstrong-linux.kir.corp.google.com ([100.119.200.73]) by smtp.gmail.com with ESMTPSA id b88sm35060971pfe.66.2016.09.13.23.17.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Sep 2016 23:17:48 -0700 (PDT) From: Matt Armstrong To: notmuch@notmuchmail.org Subject: [PATCH] emacs: notmuch-show: remove extraneous shell quoting Date: Tue, 13 Sep 2016 23:17:15 -0700 Message-Id: <1473833835-17208-1-git-send-email-marmstrong@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2016 06:17:53 -0000 Remove shell quoting from notmuch-show--build-buffer. The args list is ultimately passed to call-process, which passes them verbatim to the subprocess (typically, notmuch). The quoting, intended for a shell, are unnecessary and confusing. This code originally appeared in 9193455fa1476ea3957475e77379b75efa6dd90b, aiming to support remote notmuch execution over ssh. The commit message included this example shell script (simplified): #!/bin/sh ssh remotehost notmuch $@ That script doesn't properly quote "$@". Even if it did, it wouldn't work because the shell ssh starts on the remote host does another round of shell word splitting. Fortunately, notmuch already provides an example of a correct shell script on https://notmuchmail.org/remoteusage/ (again simplified): #!/bin/bash printf -v ARGS "%q " "$@" ssh remotehost notmuch $ARGS With the above script I'm able to use notmuch in "remote" mode. Quoted search terms work as expected, etc. (this is my t/remote-quoting) --- emacs/notmuch-show.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 5a585f3..da2d685 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1267,9 +1267,9 @@ first relevant message. If no messages match the query return NIL." (let* ((basic-args (list notmuch-show-thread-id)) (args (if notmuch-show-query-context - (append (list "\'") basic-args - (list "and (" notmuch-show-query-context ")\'")) - (append (list "\'") basic-args (list "\'")))) + (append basic-args + (list "and (" notmuch-show-query-context ")")) + basic-args)) (cli-args (cons "--exclude=false" (when notmuch-show-elide-non-matching-messages (list "--entire-thread=false")))) -- tg: (89c8d27..) t/remote-quoting (depends on: master)