From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:203:b4db::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qG16FRI+y2GQHgEAgWs5BA (envelope-from ) for ; Tue, 28 Dec 2021 17:40:50 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id ABTeEhI+y2FGLQAA9RJhRA (envelope-from ) for ; Tue, 28 Dec 2021 17:40:50 +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 B06FD395C0 for ; Tue, 28 Dec 2021 17:40:49 +0100 (CET) Received: from localhost ([::1]:59046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2FWq-0001Oi-LF for larch@yhetil.org; Tue, 28 Dec 2021 11:40:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2FVl-0001OK-OC for emacs-orgmode@gnu.org; Tue, 28 Dec 2021 11:39:41 -0500 Received: from [2607:f8b0:4864:20::62e] (port=42723 helo=mail-pl1-x62e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2FVj-0006KT-SA for emacs-orgmode@gnu.org; Tue, 28 Dec 2021 11:39:41 -0500 Received: by mail-pl1-x62e.google.com with SMTP id u16so13955614plg.9 for ; Tue, 28 Dec 2021 08:39:39 -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=xKWivZ0i1aNtdplLsdJR5F+Iwd8EAnw7C2+4NkP7aZ4=; b=FTUSzNIHy3v0wK4h+1glrrJ12SOAIzvZxgscDKQlNAXoLeOlnN3xzq3n8mxd0fCxCB /YJxliQYeHhk86dIHHKKvUvMIYdugP0RTrUaITzti4rozgG6m/UKHcQd66v3R9ARW1Vg ISLH0M9fH7m7r8AA+XxHUbZVQf7skEgNuHnY6DTLVg20mBbrhn5eIrUWLRfhfKEL9pz+ O9HtAhFPBlJDoMiToy4djk8XRKxCsfYAeQuJFHZ5zEdbcheHATyD212QlS8mwlzsmSwF N1ruq86tnuKSHcRCQPQZ1Q9eE6mEyAOf5VaLhdUuJisPp1zpff1ciCZHb8rpc9jNmCje 27yQ== 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=xKWivZ0i1aNtdplLsdJR5F+Iwd8EAnw7C2+4NkP7aZ4=; b=LDKyzPygK6OJM5D3x/YyVNAOXqnYdVP+SNEYwm19RnozXNbriEUcpsEDA5KblJOJSV RwovfZ6RXK9iJogaXUFlahpuq3ceHn4dHVec6kJXAuTURY+k97CulldmalN5ybcwna57 tq9gjG73s+nEJYBh+fqC7FXUw9k6Eq7v/9RHv8eDGzV531v7hIYcVXPeBORLcIRGv/cZ d++jVzZ31Dtcbn8hZcoz2MlU6h4TmwqUfk4amALFmZYjfy1KJzORh7UhdYP8HZOC49Vf JWRHq07qWjfYDfTnE6s32JX4OVRWYXI3uHv4JHeQpSDPClsaBammUJ9wxUJAA9X5yz7W NO+w== X-Gm-Message-State: AOAM533puYdz/3jkZgYRv7YOphTrgWXgde92sJK1iw+u9PI72kgviI/E aUm9S1xSt66tc+1+QVn2n7pyOqETEYy13QJ9FveMjnX124k= X-Google-Smtp-Source: ABdhPJz0qz3NqHruJ4ZmgPSg+dmGD6fUCZon07+CLPZmSTMkjMZDpyZFRb8N4xwl3Bup6O7Do0+RS1HN5jV89BJ8TcQ= X-Received: by 2002:a17:90b:4f85:: with SMTP id qe5mr27090115pjb.99.1640709577703; Tue, 28 Dec 2021 08:39:37 -0800 (PST) MIME-Version: 1.0 From: John Mathena Date: Tue, 28 Dec 2021 10:39:26 -0600 Message-ID: Subject: [BUG] Setting org-map-continue from to avoid skipping headings while archiving no longer works [9.5.2 (9.5.2-gd01235 @ /home/john/.emacs.d/straight/build/org/)] To: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="0000000000008f039e05d4377765" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=jmmathena@gmail.com; helo=mail-pl1-x62e.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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=1640709650; 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=xKWivZ0i1aNtdplLsdJR5F+Iwd8EAnw7C2+4NkP7aZ4=; b=BUJazSBRMzCANCle+/nSqKlfQpnjWmthkLsevbugngFM0SHQ49VQx/sNy/x6UQXLmJIHX3 iaFNF9ZgicTjLztchJiuuUA4WLNlt08ZzIkrxEJLIJ7O5NU/1zG2pV2VEE+fRy4DixyFK2 LBmby2ySFYRASOH1ypO6RMb1MNDiidQ8JlcfZJ9rymYzTiVhn9XPQUdUR550ciAdaAorU3 kGgTnAUH/od0WynbMqXDxl5kSKO+Qjl5+qZgEEcPgSWzvRQhXMCX0BlrCF89TsvEb62mxl mVfQxKn5dKkTTzT6v+oGWjUjG1ygJr7M0TwxnQOg7PDauvRFyqoNfWjqGfYS/g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640709650; a=rsa-sha256; cv=none; b=GLNiZmq/mlE12gBJ6NwbQD1rgHVNKlWkpT2p9aSyMyeE9LGw3K8NjrWXHEA9vIN4wioJT0 r034ZnkruFxHgJ1iRqjFMHWqb6uh2QGAQYli8p7+26lBSrinvlZkpVNW6uWbT+Xl6VxGrN bf91seSgw8jkcH8elgsBEuBbzj37+ASfz2owifDC/JrmrDg0Zy+otguDHAoOc5vtKnwnPh RCvBebZmD0BegAgyWSf5biV/0pBOyLHavZlYlirhgTum3qgsJIhAWeNVQVZY8aYq9pA9ii JAlRtf5tykt7y1+ZSgC0fn6pc1A/r/jebEokLqV2v8UrvVaX5YN0NE3eQ8uaXQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FTUSzNIH; 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.27 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FTUSzNIH; 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: B06FD395C0 X-Spam-Score: -4.27 X-Migadu-Scanner: scn0.migadu.com X-TUID: GBT5yOeqeDW3 --0000000000008f039e05d4377765 Content-Type: text/plain; charset="UTF-8" It's a common workflow to iterate over all Org headings in a given file, archiving those marked with the "DONE" keyword. The only problem is that archiving changes the structure of the file you're operating on, so if you have test.org: * DONE A * DONE B * DONE C * DONE D A will be archived, moving [B, C, D] up, with point on B. Then, point is advanced to the next heading, so B gets skipped in favor of C getting archived. The end result is B and D remaining in the file instead of being archived. In Org 9.4.4, you can fix this issue with a snippet like this: (defun my-org-archive-done-tasks () "Archive all top-level tasks with the DONE keyword in the current file." (interactive) (org-map-entries (lambda () (org-archive-subtree) (setq org-map-continue-from (org-element-property :begin (org-element-at-point)))) "LEVEL=1/DONE" 'file)) ...where you set org-map-continue-from in order to avoid skipping every other heading. However, upon updating to Org 9.5.2-gd01235, this function no longer works - if you have a file like test.org above, eval "my-org-archive-done-tasks", and try to run it on the file, every other heading is still skipped. I verified this by trying this function on test.org twice, first after running "emacs -Q", and then after doing "emacs -Q -l ~/.emacs.d/straight/repos/straight.el/bootstrap.el" and "M-x straight-use-package org" I believe this is a result of recent additions in org-scan-tags - I hit a dead end there while trying to determine the exact cause of the change (the caching stuff that was added is spooky for a new user like me). Is the snippet above no longer expected to work in Org 9.5.2 due to the logic for mapping over entries having changed, or is this a bug? If it's the former, what's the intended way of archiving all DONE tasks in a file now? Emacs : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.17.4) of 2021-03-26 Package: Org mode version 9.5.2 (9.5.2-gd01235 @ /home/john/.emacs.d/straight/build/org/) (And the function above *does* work in Package: Org mode version 9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/)) Best, John --0000000000008f039e05d4377765 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It's a common workflow to iterate over all Org he= adings in a given file, archiving those marked with the "DONE" ke= yword. The only problem is that archiving changes the structure of the file= you're operating on, so if you have test.o= rg:

=C2=A0 =C2=A0 * DONE A
=C2=A0 =C2=A0 * DONE B
=C2=A0 = =C2=A0 * DONE C
=C2=A0 =C2=A0 * DONE D

A will be archived, moving= [B, C, D] up, with point on B. Then, point is advanced to the next heading= , so B gets skipped in favor of C getting archived. The end result is B and= D remaining in the file instead of being archived.

In Org 9.4.4, yo= u can fix this issue with a snippet like this:

(defun my-org-archive= -done-tasks ()
=C2=A0 "Archive all top-level tasks with the DONE ke= yword in the current file."
=C2=A0 (interactive)
=C2=A0 (org-map= -entries
=C2=A0 =C2=A0(lambda ()
=C2=A0 =C2=A0 =C2=A0(org-archive-sub= tree)
=C2=A0 =C2=A0 =C2=A0(setq org-map-continue-from (org-element-prope= rty :begin (org-element-at-point))))
=C2=A0 =C2=A0"LEVEL=3D1/DONE&q= uot;
=C2=A0 =C2=A0'file))

...where you set org-map-continue-f= rom in order to avoid skipping every other heading. However, upon updating = to Org 9.5.2-gd01235, this function no longer works - if you have a file li= ke test.org above, eval "my-org-archiv= e-done-tasks", and try to run it on the file, every other heading is s= till skipped. I verified this by trying this function on test.org twice, first after running "emacs -Q", and= then after doing "emacs -Q -l ~/.emacs.d/straight/repos/straight.el/b= ootstrap.el" and "M-x straight-use-package org"

I believe this is a result of recent additions in org-scan= -tags - I hit a dead end there while trying to determine the exact cause of= the change (the caching stuff that was added is spooky for a new user like= me).

Is the snippet above no longer expected to work in Org 9.5.2 d= ue to the logic for mapping over entries having changed, or is this a bug? = If it's the former, what's the intended way of archiving all DONE t= asks in a file now?

Emacs =C2=A0 : GNU Emacs 27.2 (build 1, x86_64-p= c-linux-gnu, GTK+ Version 3.24.27, cairo version 1.17.4) of 2021-03-26
P= ackage: Org mode version 9.5.2 (9.5.2-gd01235 @ /home/john/.emacs.d/straigh= t/build/org/)

(And the function above *does* work in Package: Org mo= de version 9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/))

Best,
John
--0000000000008f039e05d4377765--