From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gKP2Kz0e12CicwEAgWs5BA (envelope-from ) for ; Sat, 26 Jun 2021 14:31:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id eAiyJz0e12AafwAAB5/wlQ (envelope-from ) for ; Sat, 26 Jun 2021 12:31:57 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1C447EBCA for ; Sat, 26 Jun 2021 14:31:57 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 995B4290C9; Sat, 26 Jun 2021 08:31:53 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id DEACA290A8 for ; Sat, 26 Jun 2021 08:31:50 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id BDF4C5FD21; Sat, 26 Jun 2021 08:31:50 -0400 (EDT) Received: (nullmailer pid 160985 invoked by uid 1000); Sat, 26 Jun 2021 12:31:49 -0000 From: David Bremner To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH 1/2] test-lib-emacs: re-define test_emacs() after initialization In-Reply-To: <20210522152008.27059-1-tomi.ollila@iki.fi> References: <20210522152008.27059-1-tomi.ollila@iki.fi> Date: Sat, 26 Jun 2021 09:31:49 -0300 Message-ID: <87eecozu16.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: L774WNPFGKE4DKKIRJDDP3IX6GLVPV3N X-Message-ID-Hash: L774WNPFGKE4DKKIRJDDP3IX6GLVPV3N X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: tomi.ollila@iki.fi X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624710717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=T35tU3/7UucuCnXdeCmjZivOrPxxtfqecJgI3m/B8lk=; b=USgajhWMRCDlIVjd7hUc3g+rzgO0SbOUR9pNp02QylJUs6JogmixBkjiGKzMdAYao8g4/p DcwldNpgdBM1SN+LpoYPKpb2U24Rn5fq5krow7uFbCcnNZ66ur9A79Sfo+VhtH2hF7mv6L BgQw0PfIFAQsEf1e/vM1Ry3vUqfeY9/1TdTja0Bum+OUXvhkUWbzrwQ1mANtdbMlttgeDR SxzLwWbllKhgeWMwdx8DuArGsbeJGrR3w4Qxu6XKCnWDqyi6lJKUjeS/6reSYyJcataXee 1afYOQGenXPmRQ0Ww13JQx+9A8295t7QSrs2mmKH8TAsClHB7e6a8iIEao2ayQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624710717; a=rsa-sha256; cv=none; b=Cd4zY1mU5Pb4KXP8v3FoHLLQls1ZMJp70DIvqNF39OHUusoXd1o3FgsOD/fobI2ycSEHan 4IY18zLzDOyCLk9v4s8l5gY6UMi2wrEOI2D96VrDGf26ZJET4gGDgo8xLM4vIWQzYprAh5 ptTYjMUWeyYorhhRak9DXm9KnlRj1T/OBSKRY/AY22xcg+/NVaNuTg5+6sUXhSpLGQ/OsJ qbY3EIrBonALptcRe5iKuEZXMzuRJp6f66dAmW3ESlaossWzAkTHT6K4eNTUUmKxL5fOL0 WT1qq2kSIrC69wS+V5MMjUVFdUDX2Kmvmw5mZxYwXzXLn0jBFZWL1lZJPWRJ2w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -2.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 1C447EBCA X-Spam-Score: -2.01 X-Migadu-Scanner: scn0.migadu.com X-TUID: deFB7uiPLqFO Tomi Ollila writes: > After test_emacs() has started emacs, it re-defines > itself as just calling the started emacs. > > First call to test_emacs() will execute to the end of it; > next calls will just execute the 2 lines, first clearing OUTPUT, > second and last executing TEST_EMACSCLIENT... > > This simplifies away one if constructs and reduces xtrace > output when doing test debugging with set -x. Although I am slightly horrified to learn that bash functions can redefine themselves, I guess I can live with this if it is useful. It's not like checking an environment variable is such a pretty construct.