From 20ff5ae8660ae7dbe74e8cc8a45b23cdb8e92cf5 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Sun, 4 Oct 2015 21:59:42 +0300 Subject: [PATCH] =?utf8?q?[P=C3=84TCH]=20notmuch-emacs-mua:=20set=20EMACS{?= =?utf8?q?,CLIENT}=20variables=20to=20defaults=20when=20empty?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- 5d/8c0ef187bb063e68677c653c24ed98fbaf9e4a | 80 +++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 5d/8c0ef187bb063e68677c653c24ed98fbaf9e4a diff --git a/5d/8c0ef187bb063e68677c653c24ed98fbaf9e4a b/5d/8c0ef187bb063e68677c653c24ed98fbaf9e4a new file mode 100644 index 000000000..5603493de --- /dev/null +++ b/5d/8c0ef187bb063e68677c653c24ed98fbaf9e4a @@ -0,0 +1,80 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id ED4C86DE158D + for ; Sun, 4 Oct 2015 11:59:45 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.174 +X-Spam-Level: +X-Spam-Status: No, score=0.174 tagged_above=-999 required=5 tests=[AWL=0.714, + RP_MATCHES_RCVD=-0.55, T_HEADER_FROM_DIFFERENT_DOMAINS=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 0J5Gb679IR13 for ; + Sun, 4 Oct 2015 11:59:43 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by arlo.cworth.org (Postfix) with ESMTP id 1C8AE6DE13E2 + for ; Sun, 4 Oct 2015 11:59:42 -0700 (PDT) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id 2813D100269; Sun, 4 Oct 2015 21:59:44 +0300 (EEST) +From: Tomi Ollila +To: notmuch@notmuchmail.org +Subject: =?utf-8?q?=5BP=C3=84TCH=5D_notmuch-emacs-mua=3A_set_EMACS=7B=2CCLIENT=7D_variables_to_defaults_when_empty?= +Date: Sun, 4 Oct 2015 21:59:42 +0300 +Message-Id: <1443985182-20048-1-git-send-email-tomi.ollila@iki.fi> +X-Mailer: git-send-email 2.0.0 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Cc: tomi.ollila@iki.fi +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +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: Sun, 04 Oct 2015 18:59:46 -0000 + +... in addition to doing this when these variables are unset. + +It is more useful to use defaults (emacs or emacsclient) than empty +string as a command name. +--- + +Without this: + +$ EMACS= ./notmuch-emacs-mua +./notmuch-emacs-mua: line 150: exec: --: invalid option +exec: usage: exec [-cl] [-a name] [command [arguments ...]] [redirection ...] +zsh: exit 2 EMACS= ./notmuch-emacs-mua + + notmuch-emacs-mua | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/notmuch-emacs-mua b/notmuch-emacs-mua +index 016fa12613c4..4404cd7c33b8 100755 +--- a/notmuch-emacs-mua ++++ b/notmuch-emacs-mua +@@ -30,8 +30,8 @@ escape () + printf -v $2 '%s' "${__escape_arg__//\"/\\\"}" + } + +-EMACS=${EMACS-emacs} +-EMACSCLIENT=${EMACSCLIENT-emacsclient} ++EMACS=${EMACS:-emacs} ++EMACSCLIENT=${EMACSCLIENT:-emacsclient} + + PRINT_ONLY= + NO_WINDOW= +-- +2.0.0 + -- 2.26.2