From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Bug: org-map-entries infinite loop for org file with tags [9.2.6 (9.2.6-elpa @ /home/ian/.emacs.d/elpa/org-9.2.6/)] Date: Thu, 24 Oct 2019 08:12:50 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007ffef40595a6f4b2" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:44795) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNbzH-0001AJ-Bk for emacs-orgmode@gnu.org; Thu, 24 Oct 2019 08:13:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNbzF-000245-4g for emacs-orgmode@gnu.org; Thu, 24 Oct 2019 08:13:07 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:39161) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNbzE-00023o-Il for emacs-orgmode@gnu.org; Thu, 24 Oct 2019 08:13:05 -0400 Received: by mail-wm1-x331.google.com with SMTP id r141so2350697wme.4 for ; Thu, 24 Oct 2019 05:13:04 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: ian martins Cc: org-mode-email --0000000000007ffef40595a6f4b2 Content-Type: text/plain; charset="UTF-8" This worked fine for me with org 9.2.3 and 9.2.6 with emacs 26.1. John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Thu, Oct 24, 2019 at 8:02 AM ian martins wrote: > Running org-map-entries on an org file with tags results in an infinite > loop. > > Example function using org-map-entries: > > (defun org-map-entries-test () > (interactive) > (org-map-entries '(lambda () (message "%s" (org-entry-properties > (point) 'standard)))) > (message "done")) > > Example org file: > > * one > * two > * three > :noexport: > > expected result: visit each headline once then print "done" > actual result: visits headlines in an infinite loop and never prints "done" > > It fails with: Org mode version 9.2.6 (9.2.6-elpa @ > /home/ian/.emacs.d/elpa/org-9.2.6/) > It works with: Org-mode version 8.2.10 (release_8.2.10 @ > /usr/share/emacs/24.5/lisp/org/) > It also works if the org file has no tags. > > > Emacs : GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) > of 2017-09-20 on lcy01-07, modified by Debian > Package: Org mode version 9.2.6 (9.2.6-elpa @ > /home/ian/.emacs.d/elpa/org-9.2.6/) > > current state: > ============== > (setq > org-table-export-default-format "orgtbl-to-csv" > org-hide-leading-stars 'hidestars > org-tab-first-hook '(org-babel-hide-result-toggle-maybe > org-babel-header-arg-expand) > org-speed-command-hook '(org-speed-command-activate > org-babel-speed-command-activate) > org-occur-hook '(org-first-headline-recenter) > org-metaup-hook '(org-babel-load-in-session-maybe) > org-log-done t > org-confirm-shell-link-function 'yes-or-no-p > org-startup-folded 'content > org-from-is-user-regexp "\\" > org-src-mode-hook '(org-src-babel-configure-edit-buffer > org-src-mode-configure-edit-buffer) > org-agenda-before-write-hook '(org-agenda-add-entry-text) > org-babel-pre-tangle-hook '(save-buffer) > org-mode-hook '(#[0 "\300\301\302\303\304$\207" > [add-hook change-major-mode-hook org-show-all append > local] > 5 "\n\n(fn)"] > #[0 "\300\301\302\303\304$\207" > [add-hook change-major-mode-hook > org-babel-show-result-all append local] > 5 "\n\n(fn)"] > org-babel-result-hide-spec org-babel-hide-all-hashes) > org-bibtex-headline-format-function #[257 "\300.\236A\207" [:title] 3 > "\n\n(fn ENTRY)"] > org-archive-hook '(org-attach-archive-delete-maybe) > org-cycle-hook '(org-cycle-hide-archived-subtrees > org-cycle-show-empty-lines > org-optimize-window-after-visibility-change) > org-babel-tangle-lang-exts '(("python" . "py") ("java" . "java") > ("emacs-lisp" . "el") ("elisp" . "el")) > org-confirm-elisp-link-function 'yes-or-no-p > org-metadown-hook '(org-babel-pop-to-session-maybe) > org-link-parameters '(("id" :follow org-id-open) > ("eww" :follow eww :store org-eww-store-link) > ("rmail" :follow org-rmail-open :store > org-rmail-store-link) > ("mhe" :follow org-mhe-open :store > org-mhe-store-link) > ("irc" :follow org-irc-visit :store > org-irc-store-link :export org-irc-export) > ("info" :follow org-info-open :export > org-info-export :store org-info-store-link) > ("gnus" :follow org-gnus-open :store > org-gnus-store-link) > ("docview" :follow org-docview-open :export > org-docview-export :store org-docview-store-link) > ("bibtex" :follow org-bibtex-open :store > org-bibtex-store-link) > ("bbdb" :follow org-bbdb-open :export > org-bbdb-export :complete org-bbdb-complete-link > :store org-bbdb-store-link) > ("w3m" :store org-w3m-store-link) ("file+sys") > ("file+emacs") ("doi" :follow org--open-doi-link) > ("elisp" :follow org--open-elisp-link) > ("file" :complete org-file-complete-link) > ("ftp" :follow > (lambda (path) (browse-url (concat "ftp:" path)))) > ("help" :follow org--open-help-link) > ("http" :follow > (lambda (path) (browse-url (concat "http:" path)))) > ("https" :follow > (lambda (path) (browse-url (concat "https:" > path)))) > ("mailto" :follow > (lambda (path) (browse-url (concat "mailto:" > path))) > ) > ("news" :follow > (lambda (path) (browse-url (concat "news:" path)))) > ("shell" :follow org--open-shell-link)) > org-babel-load-languages '((java . t) (python . t) (emacs-lisp . t) > (calc . t) (org . t) (screen . t) (dot . t) > (plantuml . t) (gnuplot . t)) > org-clock-out-hook '(org-clock-remove-empty-clock-drawer) > ) > --0000000000007ffef40595a6f4b2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
This worked fine for me with org 9.2.3 and 9.2.6 with emac= s 26.1.

John

-----------------------------------
Professor John Kitchin= =C2=A0
Doherty Hall A207F
Department of Chemical Engineering
Carne= gie Mellon University
Pittsburgh, PA 15213
412-268-7803


On Thu, Oct 24, 2019 at 8:02 AM ian martins <ianxm@jhu.edu> wrote:
Running org-map= -entries on an org file with tags results in an infinite loop.

Examp= le function using org-map-entries:

=C2=A0 =C2=A0 (defun org-map-entr= ies-test ()
=C2=A0 =C2=A0 =C2=A0 (interactive)
=C2=A0 =C2=A0 =C2=A0 (= org-map-entries '(lambda () (message "%s" (org-entry-properti= es (point) 'standard))))
=C2=A0 =C2=A0 =C2=A0 (message "done&qu= ot;))

Example org file:

=C2=A0 =C2=A0 * one
=C2=A0 =C2=A0 = * two
=C2=A0 =C2=A0 * three =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0:noexport:

expected result: visit each headline = once then print "done"
actual result: visits headlines in an i= nfinite loop and never prints "done"

It fails with: Org mo= de version 9.2.6 (9.2.6-elpa @ /home/ian/.emacs.d/elpa/org-9.2.6/)
It wo= rks with: Org-mode version 8.2.10 (release_8.2.10 @ /usr/share/emacs/24.5/l= isp/org/)
It also works if the org file has no tags.


Emacs = =C2=A0: GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
=C2= =A0of 2017-09-20 on lcy01-07, modified by Debian
Package: Org mode versi= on 9.2.6 (9.2.6-elpa @ /home/ian/.emacs.d/elpa/org-9.2.6/)

current s= tate:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(setq
=C2=A0org-t= able-export-default-format "orgtbl-to-csv"
=C2=A0org-hide-lead= ing-stars 'hidestars
=C2=A0org-tab-first-hook '(org-babel-hide-r= esult-toggle-maybe
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 org-babel-header-arg-expand)
=C2=A0org-speed-co= mmand-hook '(org-speed-command-activate
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 org-babel-sp= eed-command-activate)
=C2=A0org-occur-hook '(org-first-headline-rece= nter)
=C2=A0org-metaup-hook '(org-babel-load-in-session-maybe)
= =C2=A0org-log-done t
=C2=A0org-confirm-shell-link-function 'yes-or-n= o-p
=C2=A0org-startup-folded 'content
=C2=A0org-from-is-user-rege= xp "\\<ian\\>"
=C2=A0org-src-mode-hook '(org-src-bab= el-configure-edit-buffer
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0org-src-mode-configure-edit-buffer)
=C2= =A0org-agenda-before-write-hook '(org-agenda-add-entry-text)
=C2=A0o= rg-babel-pre-tangle-hook '(save-buffer)
=C2=A0org-mode-hook '(#[= 0 "\300\301\302\303\304$\207"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[add-hook change-major-mode-hook org-= show-all append
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 local]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A05 "\n\n(fn)"]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#[0 "\300\301\302\303\304$\207"=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[a= dd-hook change-major-mode-hook
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 org-babel-show-result-all append local]
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A05 "\= n\n(fn)"]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0org-babel-result-hide-spec org-babel-hide-all-hashes)
=C2=A0org-bi= btex-headline-format-function #[257 "\300.\236A\207" [:title] 3 &= quot;\n\n(fn ENTRY)"]
=C2=A0org-archive-hook '(org-attach-archi= ve-delete-maybe)
=C2=A0org-cycle-hook '(org-cycle-hide-archived-subt= rees
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 org-= cycle-show-empty-lines
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 org-optimize-window-after-visibility-change)
=C2=A0org-bab= el-tangle-lang-exts '(("python" . "py") ("java= " . "java")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("emacs-li= sp" . "el") ("elisp" . "el"))
=C2=A0o= rg-confirm-elisp-link-function 'yes-or-no-p
=C2=A0org-metadown-hook = '(org-babel-pop-to-session-maybe)
=C2=A0org-link-parameters '((&= quot;id" :follow org-id-open)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("eww" :follow ew= w :store org-eww-store-link)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("rmail" :follow org-rma= il-open :store
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 org-rmail-store-link)
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("mhe&qu= ot; :follow org-mhe-open :store
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 org-mhe-store-link)
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0("irc" :follow org-irc-visit :store
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 org-irc-stor= e-link :export org-irc-export)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("info" :follow org-inf= o-open :export
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 org-info-export :store org-info-store-link)
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0("gnus" :follow org-gnus-open :store
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 org-g= nus-store-link)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0("docview" :follow org-docview-open :e= xport
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 org-docview-export :store org-docview-store-link)
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0("bibtex" :follow org-bibtex-open :store
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 org-b= ibtex-store-link)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("bbdb" :follow org-bbdb-open :exp= ort
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 org-bbdb-export :complete org-bbdb-complete-link
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 :store org-bbdb-store-link)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("w3m" :store org= -w3m-store-link) ("file+sys")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("file+emacs"= ) ("doi" :follow org--open-doi-link)
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("elisp&quo= t; :follow org--open-elisp-link)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("file" :complete or= g-file-complete-link)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("ftp" :follow
=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lam= bda (path) (browse-url (concat "ftp:" path))))
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("= ;help" :follow org--open-help-link)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("http" :foll= ow
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 (lambda (path) (browse-url (concat "http:" path)))= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0("https" :follow
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (path) (browse= -url (concat "https:" path))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("mailto" :fo= llow
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (lambda (path) (browse-url (concat "mailto:" pa= th)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("news" :follow
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lamb= da (path) (browse-url (concat "news:" path))))
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("= ;shell" :follow org--open-shell-link))
=C2=A0org-babel-load-languag= es '((java . t) (python . t) (emacs-lisp . t)
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (calc . t) (org . t) (screen . t) (dot . t)
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= plantuml . t) (gnuplot . t))
=C2=A0org-clock-out-hook '(org-clock-re= move-empty-clock-drawer)
=C2=A0)
--0000000000007ffef40595a6f4b2--