From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sIeEB9iR118ZcQAA0tVLHw (envelope-from ) for ; Mon, 14 Dec 2020 16:24:56 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 0HNZA9iR119LXgAA1q6Kng (envelope-from ) for ; Mon, 14 Dec 2020 16:24:56 +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) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BE8319401BF for ; Mon, 14 Dec 2020 16:24:55 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 0859D29C98; Mon, 14 Dec 2020 11:24:27 -0500 (EST) Received: from mail.hostpark.net (mail.hostpark.net [212.243.197.30]) by mail.notmuchmail.org (Postfix) with ESMTPS id 8FC5528538 for ; Mon, 14 Dec 2020 11:24:06 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id BDB50165B8 for ; Mon, 14 Dec 2020 17:24:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=sel2011a; t=1607963042; bh=oX5W9ODCaoBVONN wCp3YP0gC705Y2Q762pTZFGWB0Dk=; b=dmItgQ3uuABtNA+u//J4S08+bhZ/nVJ E+4t1OmKG27jTJhCzUNQtWk1iQx17zM0SuzwZsh/QrLu2dd1PsDbVgk5Ez7lXeEv W54OLAaC0Ogun6I/OBVw8Zv6BExnAS+AHmpaqIHS76IXZPWSVMDl8c/vEzvDSdfU H5TPzrPa9fXQ= X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail0.hostpark.net [127.0.0.1]) (amavisd-new, port 10224) with ESMTP id Z07uOj6no9Xz for ; Mon, 14 Dec 2020 17:24:02 +0100 (CET) Received: from customer (localhost [127.0.0.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 mail.hostpark.net (Postfix) with ESMTPSA id 86998165F1 for ; Mon, 14 Dec 2020 17:24:02 +0100 (CET) From: Jonas Bernoulli To: notmuch@notmuchmail.org Subject: [PATCH 07/32] emacs: notmuch-start-notmuch: avoid storing process buffer twice Date: Mon, 14 Dec 2020 17:23:36 +0100 Message-Id: <20201214162401.19569-8-jonas@bernoul.li> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201214162401.19569-1-jonas@bernoul.li> References: <20201214162401.19569-1-jonas@bernoul.li> MIME-Version: 1.0 Message-ID-Hash: QIP4CJY2ASX7MVDQEH4AL4WACZHL53EH X-Message-ID-Hash: QIP4CJY2ASX7MVDQEH4AL4WACZHL53EH X-MailFrom: jonas@bernoul.li 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 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 X-Migadu-Spam-Score: 1.73 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=bernoul.li header.s=sel2011a header.b=dmItgQ3u; 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: BE8319401BF X-Spam-Score: 1.73 X-Migadu-Scanner: scn0.migadu.com X-TUID: zKrE5OKJLh82 The buffer of the error process is accessible using `process-buffer'. We still have to store the error-buffer in the non-error process because for that process `process-buffer' obviously returns its own buffer. --- emacs/notmuch-lib.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 06ca8cdc..be15af5e 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -906,12 +906,11 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args) :connection-type 'pipe :stderr err-buffer)) (err-proc (get-buffer-process err-buffer))) - (process-put err-proc 'err-buffer err-buffer) - (set-process-sentinel err-proc #'notmuch-start-notmuch-error-sentinel) (process-put proc 'err-buffer err-buffer) (process-put proc 'sub-sentinel sentinel) (process-put proc 'real-command (cons notmuch-command args)) (set-process-sentinel proc #'notmuch-start-notmuch-sentinel) + (set-process-sentinel err-proc #'notmuch-start-notmuch-error-sentinel) proc)) (defun notmuch-start-notmuch-sentinel (proc event) @@ -956,7 +955,7 @@ (defun notmuch-start-notmuch-sentinel (proc event) (message "%s" (error-message-string err)))))) (defun notmuch-start-notmuch-error-sentinel (proc event) - (let ((buffer (process-get proc 'err-buffer))) + (let ((buffer (process-buffer proc))) (when (buffer-live-p buffer) (kill-buffer buffer)))) -- 2.29.1