From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id eHBBMCSK9GbcEwEAe85BDQ:P1 (envelope-from ) for ; Wed, 25 Sep 2024 22:09:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id eHBBMCSK9GbcEwEAe85BDQ (envelope-from ) for ; Thu, 26 Sep 2024 00:09:40 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=tethera.net header.s=2024 header.b="OcUm+/ON"; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727302180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to: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-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=o7C+9O+N2s3ek/Xd/hsYznZbTY1V1R1aQ4eAmxYAr6A=; b=C/Q0Iic1EAUNW1wQgxeKu1ByPPSjf9ZZjoMqlvqXaFJTZpick+IqCdmcaFud4Fnog96pD2 Mp+ZhOsVl8Z8vX7aNI6f58zJ7Kxmo8TnoGsFXhQl9uuB82JGPciY26hcS7tYInhUdyMcWw 3yCViQrs4fA4wH3pLJsPSnQwV5UwXX+8j2fiVw9qB/Ze0xJZlWIIp5DtaZ50qL4C8HONW1 zT+Tpx1e4uNoxfgOTN3lpGbQTCUaZQgqVR3HTvilbhF05lvkTgfjA2SNdbrpyr7OT2/+6t tFlGkgjSKtFQWm5q1fuUoisVqO7ubPgueFX18+jRgze31/G0FkRaPc7TJRhwIw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=tethera.net header.s=2024 header.b="OcUm+/ON"; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727302180; a=rsa-sha256; cv=none; b=iyU21y5LxX0IOgK1Ws/NHsLRy7Q3/51CHhwtgPgWKS9uckc+l+VsG8CE5oO6GqmokWTi1u 32MNUEJlUCkiKKv6NhYE4Ba+J6G90mTLDp+o50XbrWN5uwnku+SqP7GKtzIPFXnSZnqwCZ Ke/nNgdl2euayiE19MSFXEH/dK1z8DnFS6b+LgrDz5WC/UmerrTnlMi2plUIe/gp1rkEPl RwA8XjRf78bRwsf16QV1O/7wBWw1XTbWMkU0MmE4itKLvSKhxKfGN3z4J1ZrunsNSsB24G Squs5kY+0uIB2NaVbuxFR3Sk1jGAEghH3DqUHDzQObYocZF4qLk8LKZ4R4we4A== Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (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 A8043A4BB for ; Thu, 26 Sep 2024 00:09:40 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id E00D75F3A4; Wed, 25 Sep 2024 22:09:37 +0000 (UTC) Received: from phubs.tethera.net (phubs.tethera.net [192.99.9.157]) by mail.notmuchmail.org (Postfix) with ESMTPS id 2BD875E50A for ; Wed, 25 Sep 2024 22:09:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tethera.net; i=@tethera.net; q=dns/txt; s=2024; t=1727302171; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=wEX8s+hrd47MSjF5OKgD4sxxItIDa8WhKsRb9AbssCo=; b=OcUm+/ONRSVGsZnZ/rk7Ubz834NALr3dFe0Ejdv/XlGiigeAnwwXhAKmOkbZUQeU8bT1L j8n2OPH0ZZQ0SgwIDNosYRn0dkjwIAuaj0aZWNmOSlje+ecYj1VPrDmpu5aqBABR5de9ydx YbEBLdITafcPu118ylWetJ/rtfyC8eRuF2GDxMNoFKOwl9Ppo8RSPtJhefrPNLvOgwf9Rnw 7gmHpGVIHwgHoX3yLo1SDsCVDWyqQpjqzLOZtAx2Y+Wy/CwFlIHMuNKNSywtJ0Rgpydpig9 FYBMQUiGG2P3tDJdwhdtbAGI8FJ7nEw4tl8n5pcg87JAgiIVxXbyHujuzZRA== Received: from tethera.net (fctnnbsc51w-159-2-211-58.dhcp-dynamic.fibreop.nb.bellaliant.net [159.2.211.58]) by phubs.tethera.net (Postfix) with ESMTPS id 9F06518006E; Wed, 25 Sep 2024 19:09:31 -0300 (ADT) Received: (nullmailer pid 589956 invoked by uid 1000); Wed, 25 Sep 2024 22:09:31 -0000 From: David Bremner To: Brennan Vincent , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: Introduce notmuch-draftify-buffer command. In-Reply-To: <87r09qtbn6.fsf@taipei.mail-host-address-is-not-set> References: <87plpbtfj2.fsf@taipei.mail-host-address-is-not-set> <87r09qtbn6.fsf@taipei.mail-host-address-is-not-set> Date: Wed, 25 Sep 2024 19:09:31 -0300 Message-ID: <87msjvl71g.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: KSLD2MTFREUTQ74CRTAU5X7I275OLDKI X-Message-ID-Hash: KSLD2MTFREUTQ74CRTAU5X7I275OLDKI 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; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE X-Migadu-Spam-Score: -1.21 X-Spam-Score: -1.21 X-Migadu-Queue-Id: A8043A4BB X-Migadu-Scanner: mx10.migadu.com X-TUID: ewltFV+codpH Brennan Vincent writes: > This command inserts the current buffer as a draft. It optionally > begins editing the draft. [nice commit message snipped] Here again, if possible we would like a test. For emacs tests it is a bit more laborious, but there are several options outlined in test/ > will appear in a buffer named \"*Notmuch errors*\" and an error > -will be signaled." > +will be signaled. > + > +Otherwise, returns the output from the process as a string." > (with-temp-buffer > - (let ((status (notmuch-call-notmuch--helper t args))) > - (notmuch-check-exit-status status (cons notmuch-command args) > - (buffer-string))))) > + (let ((status (notmuch-call-notmuch--helper t args)) > + (output (buffer-string))) > + (and (notmuch-check-exit-status status (cons notmuch-command args) > + output) > + output)))) Is it clear / documented what the return value of notmuch-check-exit-status is? If all you mean is that it completes without error, I think "progn" is clearer than "and" > +Returns the message ID of the inserted message." > + (let ((output (apply 'notmuch-call-notmuch-process > + :stdin-string (buffer-string) "insert" > + (append (and create (list "--create-folder")) > + (list (concat "--folder=" folder) > + "--emit-message-id") > + tags)))) > + (string-trim output))) One problem we have is that people merrily upgrade the emacs front end without updating the CLI. Recently (see devel/schemata) we have started bumping the output version for new command arguments, so at least the error reporting is clear.