From: Ruijie Yu via "General discussions about Org-mode." <emacs-orgmode@gnu.org>
To: Sergei Kosyrev <kosejin@proton.me>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] org-id: implement arbitrary cross-file references
Date: Sat, 27 May 2023 21:51:11 +0800 [thread overview]
Message-ID: <sdvpm6lvq5s.fsf@netyu.xyz> (raw)
In-Reply-To: <Lau-nN0ddPo15EdvQd6gn3Ugx-U_6fLqr5hgkx7e5LcJ4rsfrOL7gdzPcOYSH-AW3xNITVfq9BWtrNOhzQNH7MwqWy5YN-O61wkstIIz5xE=@proton.me>
Thanks for the patch. Some in-line comments below.
Sergei Kosyrev <kosejin@proton.me> writes:
> From f712fa57a90c68d3d9066b10f49822ea0337b923 Mon Sep 17 00:00:00 2001
> From: Kosyrev Serge <serge.kosyrev@iohk.io>
> Date: Thu, 25 May 2023 19:30:01 +0800
> Subject: [PATCH] org-id: implement arbitrary cross-file references
>
> * Table formulae can now refer to data from tables in other files.
>
> TINYCHANGE
First of all, I believe this is not within the scope of TINYCHANGE,
because as you see below, you added 58 lines and removed 11. In this
case, the very first thing required before Org maintainers can consider
its inclusion is that you sign the FSF copyright assignment. If you
need more details, Ihor or Bastien could probably elaborate and/or send
you the form.
> ---
> etc/ORG-NEWS | 10 +++++++++
> lisp/org-id.el | 57 ++++++++++++++++++++++++++++++++++++++---------
> lisp/org-table.el | 2 +-
> 3 files changed, 58 insertions(+), 11 deletions(-)
>
> diff --git a/lisp/org-id.el b/lisp/org-id.el
> index aa9610f16..2fcecbb50 100644
> --- a/lisp/org-id.el
> +++ b/lisp/org-id.el
> @@ -337,6 +337,40 @@ Move the cursor to that entry in that buffer."
> (move-marker m nil)
> (org-fold-show-context)))
>
> +(defun org-id-parse-remote-table-ref (refstr)
> + (let ((match (string-match "^file:\\([^:]+\\)\\(\\|:.+\\)$" refstr)))
> + (unless (null match)
> + (let* ((m1 (match-string 1 refstr))
> + (m2 (match-string 2 refstr))
> + (filename (cl-remove-if (lambda (c) (member c '(40 41)))
> + (org-table-formula-substitute-names m1)))
> + (table-name (org-table-formula-substitute-names m2)))
> + (list filename table-name)))))
First, do we need to wrap it with `save-match-data'? In my personal
code I almost always do, but I need a second opinion on that.
Second, instead of the let-unless-null combination, you can just do this
instead:
(when-let ((match ...))
(let* (...)
...))
And, if those values can't ever be nil, you could even combine the
entirety of the `let*' form into the `when-let' form (and turn it into a
`when-let*' form).
No comments on the rest, so I didn't quote them from my response to save
bandwidth.
--
Best,
RY
next prev parent reply other threads:[~2023-05-27 13:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-25 12:29 [PATCH] org-id: implement arbitrary cross-file references Sergei Kosyrev
2023-05-27 12:51 ` Sergei Kosyrev
2023-05-27 13:51 ` Ruijie Yu via General discussions about Org-mode. [this message]
2023-05-27 15:19 ` Sergei Kosyrev
2023-05-29 8:52 ` Ihor Radchenko
2023-07-02 10:58 ` Ihor Radchenko
2023-07-02 13:51 ` Sergei Kosyrev
2023-07-02 15:39 ` Ihor Radchenko
2023-10-02 13:36 ` Ihor Radchenko
2024-04-07 9:52 ` 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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sdvpm6lvq5s.fsf@netyu.xyz \
--to=emacs-orgmode@gnu.org \
--cc=kosejin@proton.me \
--cc=ruijie@netyu.xyz \
/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 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).