all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Morgan Smith <morgan.j.smith@outlook.com>
To: emacs-orgmode@gnu.org
Subject: Re: `org-element-cache-map' misses elements at end of buffer
Date: Fri, 19 Apr 2024 07:39:15 -0400	[thread overview]
Message-ID: <CH3PR84MB342450FE12DC716A9FA65EADC50D2@CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CH3PR84MB3424D0A23BF26817B248C647C50E2@CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM> (Morgan Smith's message of "Thu, 18 Apr 2024 09:33:02 -0400")

So I found another bug in `org-element-cache-map'.

Executing the following code just freezes up.  I am struggling to work
through the logic of `org-element-cache-map'.  If no-one else magically
solves my issues, I'll figure it out eventually.  But I would appreciate
some advice on how to debug this stuff (both my issue of missing
elements and freezing).

I guess my next current step is to read the manual on breakpoints.  I'm
getting a little tired of just shoving print statements everywhere.

#+BEGIN_SRC elisp
;; I get that this use case looks weird but in a more complicated
;; situation I also experienced freezing so I'm hoping solving this case
;; will also solve my other situation.
(require 'org-test)
(org-test-with-temp-text "* headline\nCLOCK: => 23:43\n"
    (let ((headline (progn (goto-char (point-min)) (org-element-at-point))))
     (org-element-cache-map
     #'car
     :granularity 'element
     :next-re org-element-clock-line-re
     :after-element headline)))
#+END_SRC


  reply	other threads:[~2024-04-19 11:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18 13:33 `org-element-cache-map' misses elements at end of buffer Morgan Smith
2024-04-19 11:39 ` Morgan Smith [this message]
2024-04-21 11:48   ` Ihor Radchenko
2024-04-21 16:06     ` Morgan Smith
2024-04-21 17:31       ` Ihor Radchenko
2024-04-19 13:29 ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CH3PR84MB342450FE12DC716A9FA65EADC50D2@CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM \
    --to=morgan.j.smith@outlook.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.