From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id apAfICdEC2JSEwEAgWs5BA (envelope-from ) for ; Tue, 15 Feb 2022 07:11:51 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id uOUiFydEC2KNJwAAG6o9tA (envelope-from ) for ; Tue, 15 Feb 2022 07:11:51 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id EE676130CF for ; Tue, 15 Feb 2022 07:11:50 +0100 (CET) Received: from localhost ([::1]:59350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJr41-0004a9-AS for larch@yhetil.org; Tue, 15 Feb 2022 01:11:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJr2W-0004Zl-H7 for emacs-orgmode@gnu.org; Tue, 15 Feb 2022 01:10:16 -0500 Received: from [2607:f8b0:4864:20::832] (port=45775 helo=mail-qt1-x832.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJr2U-0002u1-Mg for emacs-orgmode@gnu.org; Tue, 15 Feb 2022 01:10:16 -0500 Received: by mail-qt1-x832.google.com with SMTP id o3so17645975qtm.12 for ; Mon, 14 Feb 2022 22:10:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=Lfyfh0Vr7byHYDqpK+Yo2OmutJ4uDvGQPgCh0/lp1sc=; b=AtD/C2NOjLh6hYHHA6nTc1nLR33d0LYCBCXuqgmVTXbR8wiuhM7EpuzAwv9j8ReNlq 8fKc16vZeklJQQZ2cUK2cRsbbeJjtHivjNjToArSYIvRt8t4uw18Ef22V2TKUmAjzip3 VPOIJZdjnI4wyIm1C8Zp1VR++BlFYfjqkzNrW5x74TFCwQkfYyReUIuPaGoV6RLcTv9j X+z5ML781NakKolXXkdcRkLf4lpI0EeuSGObJIkEcR77CJc+ZLBmm6X/2mScnBScrFOr aJl5USOTsbkYlfbGVzxmLvDX5pXPAAsgOhrY6bFw8D+DqsCAin3lOAz4syHgVKP0EKuW pQKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Lfyfh0Vr7byHYDqpK+Yo2OmutJ4uDvGQPgCh0/lp1sc=; b=5PMTTC2EezMmsPnSGNiCn7iHC/lPMcM2U5rjuS4ynCfog3snrxm28eKzVIMkMLXlDX jK/ACK7yygO3Eql0Je80cbRRL2ZYtcJtsxloz5fd+9NtETeUw/Ukaz1yT2hAYVQl79MH SuQn9K9HDUJDpns5T5JaoCa3g6gSMfrNWyK0THnTcDVeCuaGg4+DfIT2VKDHpQpemHRB u20g32L3U7oACsNSuE5nbNOeHguLRxJcqcF7hoCjM/+nlqi5ekpJSM4nwPVHUfP2kHlk 9gn6UADwDcSl5VW9ly5+Sct5AxaRekSzgFil9hTmSehWgBkPnUDEAOCKutQbY0SHUYKv Q1QQ== X-Gm-Message-State: AOAM533Vch4SIjq/YhKLocm0bxwtwLj/fnfW3I/u8G4d/0W2zvvYAoN4 16xcGhn1jrv98BwXagJ3Eqa/0dsqRoLamfromH2Ipp6XWxa4RQ== X-Google-Smtp-Source: ABdhPJwRxXPoQJaHlYddAstgDYafk7HFWjeMpH7L/nCYrVCrTnzX13kjqEtY8CpUMKRGGX3g6qsRgcDs0I1AYrS2LZU= X-Received: by 2002:ac8:5950:: with SMTP id 16mr1721358qtz.162.1644905413387; Mon, 14 Feb 2022 22:10:13 -0800 (PST) MIME-Version: 1.0 From: Hu Lucius Date: Tue, 15 Feb 2022 06:10:02 +0000 Message-ID: Subject: [PATCH] org-agenda: fix `org-agenda-new-marker` To: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="000000000000daa7ab05d808623c" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::832 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::832; envelope-from=orctarorga@gmail.com; helo=mail-qt1-x832.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.635, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644905511; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Lfyfh0Vr7byHYDqpK+Yo2OmutJ4uDvGQPgCh0/lp1sc=; b=LoNPUGKYkmvrRODhdHqMaxdLWUF9/xSVGFemKLZ4fGQejXTMq+z4jHNMf4U8X/Jdd+3jHq qxl4W6sBsKgLG5cd5TXoGcad3uW9laOow6Ky2rKJsvl1BMuaNhmJtgm0XcDLCVQYsTvwgo bGSmneftzz/HExqplvPZDy2lf5ehMxhT6REqlyTOd43FbDqmQqYB1S123dC2nH0DAJJ9Px qBf87Cka9zEPJoyMuiATmQSLtWZYPh4/clb0FzaTjAMIpgPdtRlH1QmzYLaK36iVAa+cgJ PmWpqIyXFok2h7E6D5F5d47ltmKwKyakmunaTT6u8n8g5OMOL+KqZOXxtfZa/Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644905511; a=rsa-sha256; cv=none; b=FAjGwT1cHlh3gwp/wMfpg361XWzhJDjYjGYG9hcPv1vcxBsb9VXUpzrseIbhK/GTiPqftl +PkgQ1g7sABM81jQVuEc6gmTOFMuZdz50+FtsLhG+KQA8d5NM6SpY3E8NZvYHlX5QDcD00 488ucElpdK3xm1mURYXLZRXw7Q3+ZFa7yIHWlRCBasD4F/7/IlFV1fDdJ70qWaC1fK8l96 wJQClIa8f5m976rGj6yR7iI9YQNWUynopc8V8/7yWuriuG6+lQdItvIFq+84/KYGKMPCzz eLzceBu72wr5ma2q+EZfDqfhixr5YkIKBcCf5a5iv83N+JNb/RacEzqmnEkfVg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="AtD/C2NO"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.33 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="AtD/C2NO"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: EE676130CF X-Spam-Score: -4.33 X-Migadu-Scanner: scn1.migadu.com X-TUID: +LUSJdd8R4aP --000000000000daa7ab05d808623c Content-Type: text/plain; charset="UTF-8" In some cases, `org-agenda-buffer` is killed while the symbol itself is still non-nil. `org-agena-new-marker` and anything that calls it would end in a message of "Selecting deleted buffer". This commit simply added an additional test that (buffer-live-p org-agenda-buffer) should also be true. P.S. I've sent another patch with the same subject a few days earlier. But that contains an error. Please dismiss that one. Signed-off-by: Lucius Hu --- lisp/org-agenda.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 9bc44a56e..cc7f01758 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -4225,7 +4225,7 @@ Marker is at point, or at POS if non-nil. Org mode keeps a list of these markers and resets them when they are no longer in use." (let ((m (copy-marker (or pos (point)) t))) (setq org-agenda-last-marker-time (float-time)) - (if org-agenda-buffer + (if (and org-agenda-buffer (buffer-live-p org-agenda-buffer)) (with-current-buffer org-agenda-buffer (push m org-agenda-markers)) (push m org-agenda-markers)) -- 2.35.1 --000000000000daa7ab05d808623c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
In some cases, `org-agenda-buffer` is killed while the sym= bol itself
is still non-nil. `org-agena-new-marker` and anything that ca= lls it would
end in a message of "Selecting deleted buffer".
This commit simply added an additional test that

=C2=A0 =C2=A0= (buffer-live-p org-agenda-buffer)

should also be true.

P.S. I've sent another patch with the same subject a = few days earlier.
But that contains an error. Please dismiss that= one.

Signed-off-by: Lucius Hu <lebensterben@users.noreply.github.com>=
---
=C2=A0lisp/org-agenda.el | 2 +-
=C2=A01 file changed, 1 inser= tion(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-ag= enda.el
index 9bc44a56e..cc7f01758 100644
--- a/lisp/org-agenda.el+++ b/lisp/org-agenda.el
@@ -4225,7 +4225,7 @@ Marker is at point, or a= t POS if non-nil.=C2=A0 Org mode keeps a list
=C2=A0of these markers and= resets them when they are no longer in use."
=C2=A0 =C2=A0(let ((m= (copy-marker (or pos (point)) t)))
=C2=A0 =C2=A0 =C2=A0(setq org-agenda= -last-marker-time (float-time))
- =C2=A0 =C2=A0(if org-agenda-buffer
= + =C2=A0 =C2=A0(if (and org-agenda-buffer (buffer-live-p org-agenda-buffer)= )
=C2=A0 (with-current-buffer org-agenda-buffer
=C2=A0 =C2=A0(push m= org-agenda-markers))
=C2=A0 =C2=A0 =C2=A0 =C2=A0(push m org-agenda-mark= ers))
--
2.35.1 --000000000000daa7ab05d808623c--