emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fixing a regression in org-persists ability to handle non-list container arguments.
@ 2024-09-18  0:24 lra
       [not found] ` <O71W8io--B-9@phdk.org-O71WWax----9>
  0 siblings, 1 reply; 2+ messages in thread
From: lra @ 2024-09-18  0:24 UTC (permalink / raw)
  To: Emacs Orgmode

Hello org-mode mailing list

Long time, first time. This is just a tiny patch fixing a regression
in org-persist--find-index that was missed in the 95f77669e0 bugfix. It affects
calls to org-persist-read that don't use a list of containers,
e.g. those in ox-latex's precompile function.

I was having some issues getting the org-latex-preview branch to run
smoothly when the xref-find-def trail led me to realize that it wasn't
just my setup causing trouble. In the process of compiling a bug
report I ended up fixing it on my end and thought I might as well send
it your way and save sombody else the trouble. I took the liberty of
clarifying a related comment that confused me a bit while working out
the logic of the function.

(This is just a quick fix of the specific regression, a more proper
solution would probably move all the logic concerning container lists
further up in the chain. However, actually doing something like
rewriting o-p--normalize-container to achieve that is above my
pay-grade. My experience writing elisp basically comes from writing a
few advice-hacks to get stuff to do what I want, so feel free to
reject and forget if you think this deserves a full treatment.)

MWE running with -Q and org compiled from git (taken from the
examples in org-persist documentation):
  (let ((info1 "test")
        (info2 "test 2"))
    (org-persist-register
     `("Named data" (elisp info1 local) (elisp info2 local))
     nil :write-immediately t))
  (org-persist-read
   "Named data"
   nil nil nil :read-related t)

Expected result: org-persist-read will return ("Named data" "test" "test 2")
Current result: it returns nil

Kind regards,
LRA

P.S. Thank you all for all the hard work you put into this
wonderful tool. It does not go unappreciated!



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-18  0:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-18  0:24 [PATCH] Fixing a regression in org-persists ability to handle non-list container arguments lra
     [not found] ` <O71W8io--B-9@phdk.org-O71WWax----9>
2024-09-18  0:29   ` lra

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).