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 ms1 with LMTPS id +DR/MG7PjF49dgAAk0OIDg (envelope-from ) for ; Tue, 07 Apr 2020 19:07:26 +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 MPC+EW3PjF7PfQAA1q6Kng (envelope-from ) for ; Tue, 07 Apr 2020 19:07:25 +0000 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 311B2950105 for ; Tue, 7 Apr 2020 19:07:23 +0000 (UTC) Received: from localhost ([::1]:52168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLtZB-0001TM-LM for larch@yhetil.org; Tue, 07 Apr 2020 15:07:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45404) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLtYa-00014w-KY for emacs-orgmode@gnu.org; Tue, 07 Apr 2020 15:06:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jLtYZ-0007xZ-Gm for emacs-orgmode@gnu.org; Tue, 07 Apr 2020 15:06:44 -0400 Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]:45358) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jLtYZ-0007xN-Bm for emacs-orgmode@gnu.org; Tue, 07 Apr 2020 15:06:43 -0400 Received: by mail-qt1-x82d.google.com with SMTP id 71so3570584qtc.12 for ; Tue, 07 Apr 2020 12:06:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:message-id :date:mime-version; bh=xtECRodGNH58PqnHlC31P51hi1p9wMwYzFY6fWB5+G0=; b=O0PNB7LqVoz/zYm4ENDuOEYdwJfmib1mny0k754CTZn3tRiJKC3jiRjNcTlBduQgMF qbVuXI7RJ7JmfGY3T6bfButmt2/DZQgf+FOVDGbz73Iyoe+s01QyHkQMI0g2p+3onUL/ 4pfJwdm011g4524UDzeGTcSK4J4FrLPnSNbjEzfsMPZ/fBcNsUEZj9F1IxWnN+p+10m8 NQPvD1RcZ8OqvwuNK+Gb2ebA22B8m1nkf1hv4KT44ncfbXyUJJxY6u2oqX0JOYh4fBQk C9JawqllyabyeietbXnRm/uznLv5RZpNIRp6AI78Rnbdg5LBrTGcFDpp6gC0ONOBPhnR 0WLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version; bh=xtECRodGNH58PqnHlC31P51hi1p9wMwYzFY6fWB5+G0=; b=FOhvEjNrmIyskFZFyVKuzgqbyHFw+H5rHJkrTgIegQPMCtYeDylKVOKKe0YZFUnQSv xJAyhd9GLu02wjn1JEFn5saZBUCx5ijhQbqhvNgf9leD2vVlOWNDdaOzd2T05GTBJO3A G8aDPNPBTb+le0HBPuIgc+Vw0wvAodf0JsIODkjYJwCGvRiQTmLZ4SI/PKfdThHDt8oD eFxnQbkNl4xJSTnwv+5yAL8/HnPxEu7+9zyPtHROS33qEx6JSJkXZ3fNPRVKX/vMwyk9 iOLORc45SvLwWhMpdDJsJBNkwHPSHVvgC0fXpQHr/sTsOYfnGSsMbrjtLWjKyGfWEes2 7W+w== X-Gm-Message-State: AGi0PuaR+XuXwHucCBYaxhLqQCDjb83aAwNcflPxk8oIddPhSxC4qAni KpVHVk98CSgKMoWhjPbpJ5nz/nvX X-Google-Smtp-Source: APiQypKlwRjAyyS4ZtUK8SHGXUeCMrGQlKWU79g5ypMVjJ6gUPmr14luJYFkIQAtDto1qWtVymvBaw== X-Received: by 2002:ac8:4f11:: with SMTP id b17mr3567532qte.181.1586286402505; Tue, 07 Apr 2020 12:06:42 -0700 (PDT) Received: from arch (c-69-141-147-3.hsd1.nj.comcast.net. [69.141.147.3]) by smtp.gmail.com with ESMTPSA id q6sm3997833qte.72.2020.04.07.12.06.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2020 12:06:42 -0700 (PDT) References: <87zhcybjz5.fsf@gmail.com> <87lfn917rx.fsf@kyleam.com> <87zhbov9sw.fsf@gmail.com> <878sj8167w.fsf@kyleam.com> <874ktv86jk.fsf@gmail.com> User-agent: mu4e 1.3.10; emacs 28.0.50 From: No Wayman To: No Wayman Subject: Re: Bug: org-archive-subtree-save-file-p logic [9.3.6 (release_9.3.6-399-ge6df03 @ /home/n/.emacs.d/straight/build/org/)] In-reply-to: <874ktv86jk.fsf@gmail.com> Message-ID: <87y2r76rpa.fsf@gmail.com> Date: Tue, 07 Apr 2020 15:06:41 -0400 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::82d X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=default; t=1586286443; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=xtECRodGNH58PqnHlC31P51hi1p9wMwYzFY6fWB5+G0=; b=kSKfA7qOsXvd/S/uXEHhbAD5wVJ+2/6u2euxSyiL/P5wCmJaLIZSopKi83ZNumYDZUg1KO KhTHbw6Gu5sI4NxvgHESelpAiMC19pk6ENnsfeg8L5XQsCcEadocrAyEUTwqCmcz3ui5b1 kwQMUw6UHsS+MRZ8R1wnZ7cO8ESUh6w= ARC-Seal: i=1; s=default; d=yhetil.org; t=1586286443; a=rsa-sha256; cv=none; b=POUYOKf4274jPxzXY1PaCPnYr19kPAh0TSjd2wAhMmf1upIX/uXHODKvVvENElDdrA5raL doJEWI2QK5cPMfNXML1NxQu/RBvxui3+v84MWm8RiyPpW/quwkycwOv+2naLmXMd3Ct7sJ cvkc4Hkz+pV877IMe+2MJ3NGDqCRQjA= ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=O0PNB7Lq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scanner: scn0 X-Spam-Score: 0.09 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=O0PNB7Lq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scan-Result: default: False [0.09 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.58221126318423]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; R_DKIM_REJECT(1.00)[gmail.com:s=20161025]; HAS_ATTACHMENT(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; ARC_SIGNED(0.00)[i=1]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.32), country: US(-0.01), ip: 209.51.188.17(-0.58)]; DKIM_TRACE(0.00)[gmail.com:-]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[iarchivedmywholelife@gmail.com,emacs-orgmode-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; PREVIOUSLY_DELIVERED(0.00)[emacs-orgmode@gnu.org]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_SEVEN(0.00)[7]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : SPF not aligned (relaxed),none] X-TUID: wr9VLjrQgH3T --=-=-= Content-Type: text/plain; format=flowed No Wayman writes: > Attaching a proper patch with your suggested revisions here. Sorry, I'm not used to submitting patches through email. I see it inlined on my end, but it does not appear as if it was attached. Trying once more: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-archive.el-fix-org-archive-subtree-save-file-p.patch Content-Description: fix-org-archive-subtree-save-file-p >From 289d3ff93c9f7f56ee54d98fd7d6294c4472a37b Mon Sep 17 00:00:00 2001 From: Nicholas Vollmer Date: Tue, 7 Apr 2020 14:39:29 -0400 Subject: [PATCH] org-archive.el: fix org-archive-subtree-save-file-p Consider case of 'from-org setting in saving logic. Improve docstring. Remove dead code comment. --- lisp/org-archive.el | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/lisp/org-archive.el b/lisp/org-archive.el index 10a5eb501..5e11c3743 100644 --- a/lisp/org-archive.el +++ b/lisp/org-archive.el @@ -92,14 +92,20 @@ When a string, a %s formatter will be replaced by the file name." (const :tag "Always" t))) (defcustom org-archive-subtree-save-file-p 'from-org - "Non-nil means save the archive file after archiving a subtree." + "Conditionally save the archive file after archiving a subtree. +This variable can be any of the following symbols: + +t saves in all cases. +`from-org' prevents saving from an agenda-view. +`from-agenda' saves only when the archive is initiated from an agenda-view. +nil prevents saving in all cases." :group 'org-archive :package-version '(Org . "9.4") :type '(choice - (const :tag "Always save the archive buffer" t) - (const :tag "Save target buffer when archiving from an agenda view" from-agenda) - (const :tag "Save target buffer when archiving from an org buffer" from-org) - (const :tag "Do not save the archive buffer"))) + (const :tag "from-org" from-org) + (const :tag "from-agenda" from-agenda) + (const :tag "t" t) + (const :tag "nil"))) (defcustom org-archive-save-context-info '(time file olpath category todo itags) "Parts of context info that should be stored as properties when archiving. @@ -373,14 +379,13 @@ direct children of this heading." value)))) ;; Save and kill the buffer, if it is not the same ;; buffer and depending on `org-archive-subtree-save-file-p' - (unless (eq this-buffer buffer) - (when (or (eq org-archive-subtree-save-file-p t) - (and (boundp 'org-archive-from-agenda) - (eq org-archive-subtree-save-file-p 'from-agenda))) - (save-buffer))) - ;; (unless (or (not org-archive-subtree-save-file-p) - ;; (eq this-buffer buffer)) - ;; (save-buffer)) + (unless (eq this-buffer buffer) + (when (or (eq org-archive-subtree-save-file-p t) + (and (boundp 'org-archive-from-agenda) + (eq org-archive-subtree-save-file-p 'from-agenda)) + (and (not (boundp 'org-archive-from-agenda)) + (eq org-archive-subtree-save-file-p 'from-org))) + (save-buffer))) (widen)))) ;; Here we are back in the original buffer. Everything seems ;; to have worked. So now run hooks, cut the tree and finish -- 2.26.0 --=-=-=--