From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id sJwXIxUf6maoLQEAqHPOHw:P1 (envelope-from ) for ; Wed, 18 Sep 2024 00:30:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id sJwXIxUf6maoLQEAqHPOHw (envelope-from ) for ; Wed, 18 Sep 2024 02:30:13 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1726619413; 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; bh=5b4iae3XN7XFGfep0k6YTL8sD2S5KU/KNCfibhJJKrg=; b=ER0a416xg4i+A+5ub1Yn2wy8yPXlVCGC/8g1MORr+yLnuu+RWGwGr/tFfKQBcNVxGfAQAl hddWg/arBp9g56HdozUpHulPDD642957/zxjIwpP+5lXWI7MtIE3YMG1y0RRYTjIscXU5j Q8LOxe19N9XJGyIdbZaFZ3sUKwVSXTxxGxGuXJ5mCBk154lfwbS4r7LzjXWBOWgUDHfUC+ 3STsIUCken1hXW3MmI0xskprdnOZbyelXGbzfuSxIAWZ4YzC2fvzss0a/AmYSrb48LJGy+ JybOUXJBHWdtdBjxre6ury9hMsqlVvOYE0Jw7JbWzzoDrAuRJuSskiZHI396cA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726619413; a=rsa-sha256; cv=none; b=cBoYYH7t4mzHfuAszqXmLfGYjGCBtDSpgssJIMol7wy9xvaYmx3ouu6y29QZjeCpRDPEem BdCffcvCy+z/LYqlsL1qckWLH9PIx0jnCqcxZUKWPbCuYKJ09eSFY9nUsVAgyXvbIRdkaF fTRB6SE6esikG8hdHjYPKooOaMqlfWnrbBvEYZON5YvBlv0k2+G/g0tEidDgjapKIHAwM2 Gk37a9EzFz5e48lycFZC9kreDG37MAYivMDQarWe2A4SVsmzqCbcs2ZkCV5dVLUvhj8l0K c/bCq9fPmDFughMrNmjnJgPkUYvXrhnUCw8CPNnlVKb3+Ep5qeS6yn5acIDV4A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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" 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 3962E77721 for ; Wed, 18 Sep 2024 02:30:13 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqiZp-0006iW-A9; Tue, 17 Sep 2024 20:29:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqiZn-0006iD-3X for emacs-orgmode@gnu.org; Tue, 17 Sep 2024 20:29:47 -0400 Received: from mail.w14.tutanota.de ([185.205.69.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqiZl-0000Lo-CD for emacs-orgmode@gnu.org; Tue, 17 Sep 2024 20:29:46 -0400 Received: from tutadb.w10.tutanota.de (w10.api.tuta.com [IPv6:fd:ac::d:10]) by mail.w14.tutanota.de (Postfix) with ESMTP id 871252268C57 for ; Wed, 18 Sep 2024 02:29:43 +0200 (CEST) Date: Wed, 18 Sep 2024 02:29:43 +0200 (CEST) From: lra@phdk.org To: Lra Cc: Emacs Orgmode Message-ID: In-Reply-To: References: Subject: Re: [PATCH] Fixing a regression in org-persists ability to handle non-list container arguments. MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_65139_1047679598.1726619383551" Received-SPF: pass client-ip=185.205.69.214; envelope-from=lra@phdk.org; helo=mail.w14.tutanota.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.41 X-Spam-Score: -4.41 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Queue-Id: 3962E77721 X-TUID: vqd/YFhnlFPe ------=_Part_65139_1047679598.1726619383551 Content-Type: multipart/alternative; boundary="----=_Part_65140_2124863296.1726619383551" ------=_Part_65140_2124863296.1726619383551 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable And it is *with* the attachment. Kind regards, LRA Sep 18, 2024, 02:26 by lra@phdk.org: > 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 a= ffects > 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): > =C2=A0 (let ((info1 "test") > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (info2 "test 2")) > =C2=A0=C2=A0=C2=A0 (org-persist-register > =C2=A0=C2=A0=C2=A0=C2=A0 `("Named data" (elisp info1 local) (elisp info2 = local)) > =C2=A0=C2=A0=C2=A0=C2=A0 nil :write-immediately t)) > =C2=A0 (org-persist-read > =C2=A0=C2=A0 "Named data" > =C2=A0=C2=A0 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! > > ------=_Part_65140_2124863296.1726619383551 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

And it is *with* the attachme= nt.

Kind regards,
LRA


Sep 18, 2024, 02:26 by lra@phdk.org:<= br>
Hello = org-mode mailing list

Long time, first time. This is just a tiny patch fixing a regression
<= /div>
in org-persist--find-index that was missed in the 95= f77669e0 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 t= rail led me to realize that it wasn't
just my se= tup causing trouble. In the process of compiling a bug
report I ended up fixing it on my end and thought I might as well se= nd
it your way and save sombody else the trouble= . I took the liberty of
clarifying a related com= ment that confused me a bit while working out
th= e logic of the function.

(This is just a quick fix of the specific regression, a more proper
solution would probably move all the logic concern= ing container lists
further up in the chain. How= ever, 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, s= o feel free to
reject and forget if you think th= is deserves a full treatment.)

MWE running with -Q and org compiled from git (taken from the
examples in org-persist documentation):
<= div dir=3D"auto">  (let ((info1 "test")
&nb= sp;       (info2 "test 2"))
    (org-persist-register
     `("Named data" (elisp info1 local) (elisp info2= local))
     nil :write-imm= ediately t))
  (org-persist-read
<= div dir=3D"auto">   "Named data"
 = ;  nil nil nil :read-related t)

<= div dir=3D"auto">Expected result: org-persist-read will return ("Named data= " "test" "test 2")
Current result: it returns ni= l

Kind regards,
<= /div>
LRA

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


------=_Part_65140_2124863296.1726619383551-- ------=_Part_65139_1047679598.1726619383551 Content-Type: text/x-patch; charset=us-ascii; name=0001-lisp-org-persist.el-Fix-regression-missed-by-7fd8099.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-lisp-org-persist.el-Fix-regression-missed-by-7fd8099.patch >From caf7ff050876c4e604c8d4e159e7c2d51ad7f897 Mon Sep 17 00:00:00 2001 From: Lukas Rudd Andersen Date: Wed, 18 Sep 2024 00:54:27 +0200 Subject: [PATCH] lisp/org-persist.el: Fix regression missed by 7fd8099 * lisp/org-persist.el: (org-persist--find-index): Fix regression that makes the function return nil when container in COLLECTION is not a list of containers. TINYCHANGE --- lisp/org-persist.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/org-persist.el b/lisp/org-persist.el index 8114fd5b9..7bae09f92 100644 --- a/lisp/org-persist.el +++ b/lisp/org-persist.el @@ -546,13 +546,15 @@ FORMAT and ARGS are passed to `message'." (and hash (gethash (cons cont (list :hash hash)) org-persist--index-hash)) (and key (gethash (cons cont (list :key key)) org-persist--index-hash)))) (when (and r - ;; Every element in CONTAINER matches - ;; COLLECTION. + ;; Every element in container group of + ;; COLLECTION matches returned CONTAINER. (seq-every-p (lambda (cont) (org-persist-collection-let r (member cont container))) - container)) + (if (listp (car container)) + container + (list container)))) (throw :found r)))))))) (defun org-persist--add-to-index (collection &optional hash-only) -- 2.45.2 ------=_Part_65139_1047679598.1726619383551--