emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-id: implement arbitrary cross-file references
@ 2023-05-25 12:29 Sergei Kosyrev
  2023-05-27 12:51 ` Sergei Kosyrev
  0 siblings, 1 reply; 10+ messages in thread
From: Sergei Kosyrev @ 2023-05-25 12:29 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 341 bytes --]

Good day list!

This extends org-id in a way that allows table formulae to reference
table content in other files.

Patch is attached, and can be alternatively observed via github:

https://github.com/deepfire/org-mode/pull/1/files

This is my first contribution, so caveat emptor!

Thank you!

-- 
best regards,
Serge Kosyrev

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-id-implement-arbitrary-cross-file-references.patch --]
[-- Type: text/x-patch; name=0001-org-id-implement-arbitrary-cross-file-references.patch, Size: 4967 bytes --]

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
---
 etc/ORG-NEWS      | 10 +++++++++
 lisp/org-id.el    | 57 ++++++++++++++++++++++++++++++++++++++---------
 lisp/org-table.el |  2 +-
 3 files changed, 58 insertions(+), 11 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 6b40198b5..311067628 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -221,6 +221,16 @@ Running shell blocks with the ~:session~ header freezes Emacs until
 execution completes.  The new ~:async~ header allows users to continue
 editing with Emacs while a ~:session~ block executes.
 
+*** ~remote~ ~org-table~ can now refer to variables in other files
+
+Table formulae can now refer to data from tables in other files.
+
+Example:
+
+#+BEGIN_src org
+#+TBLFM: $2='(identity remote(file:./org-wile-with-tables.org,@@#$Value))
+#+END_src
+
 ** Miscellaneous
 *** =org-crypt.el= now applies initial visibility settings to decrypted entries
 
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)))))
+
+(defun org-id-find-remote (file table-id markerp)
+  (if (file-exists-p file)
+      (let ((buffer (let ((query-about-changed-file nil))
+                      (find-file-noselect file))))
+        (unwind-protect
+	    (with-current-buffer buffer
+              (goto-char (point-min))
+	      (let ((pos (progn
+                           (unless (string= table-id "")
+                             (let* ((ident (cl-subseq table-id 1))
+                                    (id-match (search-forward (concat "#+NAME: " ident) nil t)))
+                               (unless id-match
+                                 (error "org-id-find-remote: file \"%s\" has no table with NAME \"%s\"." file ident))
+                               (forward-line)))
+                           (re-search-forward "^|-")
+                           (move-beginning-of-line nil))))
+                (cond
+	         ((null pos) nil)
+	         (markerp (move-marker (make-marker) pos buffer))
+	         (t (cons file pos)))))
+	  ;; Remove opened buffer in the process.
+	  (unless markerp (kill-buffer buffer))))
+    (error "org-id-find-remote:  reference to missing file %s" file)))
+
 ;;;###autoload
 (defun org-id-find (id &optional markerp)
   "Return the location of the entry with the id ID.
@@ -346,16 +380,19 @@ With optional argument MARKERP, return the position as a new marker."
   (cond
    ((symbolp id) (setq id (symbol-name id)))
    ((numberp id) (setq id (number-to-string id))))
-  (let ((file (org-id-find-id-file id))
-	org-agenda-new-buffers where)
-    (when file
-      (setq where (org-id-find-id-in-file id file markerp)))
-    (unless where
-      (org-id-update-id-locations nil t)
-      (setq file (org-id-find-id-file id))
-      (when file
-	(setq where (org-id-find-id-in-file id file markerp))))
-    where))
+  (let ((remote-match (org-id-parse-remote-table-ref id)))
+    (if remote-match
+        (org-id-find-remote (car remote-match) (cadr remote-match) markerp)
+      (let ((file (org-id-find-id-file id))
+	    org-agenda-new-buffers where)
+        (when file
+          (setq where (org-id-find-id-in-file id file markerp)))
+        (unless where
+          (org-id-update-id-locations nil t)
+          (setq file (org-id-find-id-file id))
+          (when file
+	    (setq where (org-id-find-id-in-file id file markerp))))
+        where))))
 
 ;;; Internal functions
 
diff --git a/lisp/org-table.el b/lisp/org-table.el
index ac685c41e..e894d563a 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -6281,7 +6281,7 @@ list of the fields in the rectangle."
     (let ((case-fold-search t) (id-loc nil)
 	  ;; Protect a bunch of variables from being overwritten by
 	  ;; the context of the remote table.
-	  org-table-column-names org-table-column-name-regexp
+          org-table-column-names (org-table-column-name-regexp org-table-column-name-regexp)
 	  org-table-local-parameters org-table-named-field-locations
 	  org-table-current-line-types
 	  org-table-current-begin-pos org-table-dlines
-- 
2.40.1


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

* [PATCH] org-id: implement arbitrary cross-file references
  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.
  0 siblings, 1 reply; 10+ messages in thread
From: Sergei Kosyrev @ 2023-05-27 12:51 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 341 bytes --]

Good day list!

This extends org-id in a way that allows table formulae to reference
table content in other files.

Patch is attached, and can be alternatively observed via github:
 
https://github.com/deepfire/org-mode/pull/1/files

This is my first contribution, so caveat emptor!

Thank you!

--
best regards,
Serge Kosyrev

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-id-implement-arbitrary-cross-file-references.patch --]
[-- Type: text/x-patch; name=0001-org-id-implement-arbitrary-cross-file-references.patch, Size: 4967 bytes --]

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
---
 etc/ORG-NEWS      | 10 +++++++++
 lisp/org-id.el    | 57 ++++++++++++++++++++++++++++++++++++++---------
 lisp/org-table.el |  2 +-
 3 files changed, 58 insertions(+), 11 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 6b40198b5..311067628 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -221,6 +221,16 @@ Running shell blocks with the ~:session~ header freezes Emacs until
 execution completes.  The new ~:async~ header allows users to continue
 editing with Emacs while a ~:session~ block executes.
 
+*** ~remote~ ~org-table~ can now refer to variables in other files
+
+Table formulae can now refer to data from tables in other files.
+
+Example:
+
+#+BEGIN_src org
+#+TBLFM: $2='(identity remote(file:./org-wile-with-tables.org,@@#$Value))
+#+END_src
+
 ** Miscellaneous
 *** =org-crypt.el= now applies initial visibility settings to decrypted entries
 
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)))))
+
+(defun org-id-find-remote (file table-id markerp)
+  (if (file-exists-p file)
+      (let ((buffer (let ((query-about-changed-file nil))
+                      (find-file-noselect file))))
+        (unwind-protect
+	    (with-current-buffer buffer
+              (goto-char (point-min))
+	      (let ((pos (progn
+                           (unless (string= table-id "")
+                             (let* ((ident (cl-subseq table-id 1))
+                                    (id-match (search-forward (concat "#+NAME: " ident) nil t)))
+                               (unless id-match
+                                 (error "org-id-find-remote: file \"%s\" has no table with NAME \"%s\"." file ident))
+                               (forward-line)))
+                           (re-search-forward "^|-")
+                           (move-beginning-of-line nil))))
+                (cond
+	         ((null pos) nil)
+	         (markerp (move-marker (make-marker) pos buffer))
+	         (t (cons file pos)))))
+	  ;; Remove opened buffer in the process.
+	  (unless markerp (kill-buffer buffer))))
+    (error "org-id-find-remote:  reference to missing file %s" file)))
+
 ;;;###autoload
 (defun org-id-find (id &optional markerp)
   "Return the location of the entry with the id ID.
@@ -346,16 +380,19 @@ With optional argument MARKERP, return the position as a new marker."
   (cond
    ((symbolp id) (setq id (symbol-name id)))
    ((numberp id) (setq id (number-to-string id))))
-  (let ((file (org-id-find-id-file id))
-	org-agenda-new-buffers where)
-    (when file
-      (setq where (org-id-find-id-in-file id file markerp)))
-    (unless where
-      (org-id-update-id-locations nil t)
-      (setq file (org-id-find-id-file id))
-      (when file
-	(setq where (org-id-find-id-in-file id file markerp))))
-    where))
+  (let ((remote-match (org-id-parse-remote-table-ref id)))
+    (if remote-match
+        (org-id-find-remote (car remote-match) (cadr remote-match) markerp)
+      (let ((file (org-id-find-id-file id))
+	    org-agenda-new-buffers where)
+        (when file
+          (setq where (org-id-find-id-in-file id file markerp)))
+        (unless where
+          (org-id-update-id-locations nil t)
+          (setq file (org-id-find-id-file id))
+          (when file
+	    (setq where (org-id-find-id-in-file id file markerp))))
+        where))))
 
 ;;; Internal functions
 
diff --git a/lisp/org-table.el b/lisp/org-table.el
index ac685c41e..e894d563a 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -6281,7 +6281,7 @@ list of the fields in the rectangle."
     (let ((case-fold-search t) (id-loc nil)
 	  ;; Protect a bunch of variables from being overwritten by
 	  ;; the context of the remote table.
-	  org-table-column-names org-table-column-name-regexp
+          org-table-column-names (org-table-column-name-regexp org-table-column-name-regexp)
 	  org-table-local-parameters org-table-named-field-locations
 	  org-table-current-line-types
 	  org-table-current-begin-pos org-table-dlines
-- 
2.40.1


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

* Re: [PATCH] org-id: implement arbitrary cross-file references
  2023-05-27 12:51 ` Sergei Kosyrev
@ 2023-05-27 13:51   ` Ruijie Yu via General discussions about Org-mode.
  2023-05-27 15:19     ` Sergei Kosyrev
  0 siblings, 1 reply; 10+ messages in thread
From: Ruijie Yu via General discussions about Org-mode. @ 2023-05-27 13:51 UTC (permalink / raw)
  To: Sergei Kosyrev; +Cc: emacs-orgmode

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


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

* Re: [PATCH] org-id: implement arbitrary cross-file references
  2023-05-27 13:51   ` Ruijie Yu via General discussions about Org-mode.
@ 2023-05-27 15:19     ` Sergei Kosyrev
  2023-05-29  8:52       ` Ihor Radchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Sergei Kosyrev @ 2023-05-27 15:19 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]

On Saturday, May 27th, 2023 at 8:51 AM, Ruijie Yu via "General discussions about Org-mode." <emacs-orgmode@gnu.org> wrote:
> 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.

Fair enough -- I'm open to sign the FSF copyright assignment.

> 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).

Thank you, all done, patch & GH PR updated.

--
regards,
Sergei Kosyrev

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-id-implement-arbitrary-cross-file-table-referenc.patch --]
[-- Type: text/x-patch; name=0001-org-id-implement-arbitrary-cross-file-table-referenc.patch, Size: 4990 bytes --]

From 960d864dd6587190a78353f27c2de10790560f31 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 table referencing

* Table formulae can now refer to data from tables in other files.

TINYCHANGE
---
 etc/ORG-NEWS      | 10 +++++++++
 lisp/org-id.el    | 57 ++++++++++++++++++++++++++++++++++++++---------
 lisp/org-table.el |  2 +-
 3 files changed, 58 insertions(+), 11 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 6b40198b5..311067628 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -221,6 +221,16 @@ Running shell blocks with the ~:session~ header freezes Emacs until
 execution completes.  The new ~:async~ header allows users to continue
 editing with Emacs while a ~:session~ block executes.
 
+*** ~remote~ ~org-table~ can now refer to variables in other files
+
+Table formulae can now refer to data from tables in other files.
+
+Example:
+
+#+BEGIN_src org
+#+TBLFM: $2='(identity remote(file:./org-wile-with-tables.org,@@#$Value))
+#+END_src
+
 ** Miscellaneous
 *** =org-crypt.el= now applies initial visibility settings to decrypted entries
 
diff --git a/lisp/org-id.el b/lisp/org-id.el
index aa9610f16..413babcd6 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)
+  (save-match-data
+    (when-let* ((match (string-match "^file:\\([^:]+\\)\\(\\|:.+\\)$" refstr))
+                (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))))
+
+(defun org-id-find-remote (file table-id markerp)
+  (if (file-exists-p file)
+      (let ((buffer (let ((query-about-changed-file nil))
+                      (find-file-noselect file))))
+        (unwind-protect
+	    (with-current-buffer buffer
+              (goto-char (point-min))
+	      (let ((pos (progn
+                           (unless (string= table-id "")
+                             (let* ((ident (cl-subseq table-id 1))
+                                    (id-match (search-forward (concat "#+NAME: " ident) nil t)))
+                               (unless id-match
+                                 (error "org-id-find-remote: file \"%s\" has no table with NAME \"%s\"." file ident))
+                               (forward-line)))
+                           (re-search-forward "^|-")
+                           (move-beginning-of-line nil))))
+                (cond
+	         ((null pos) nil)
+	         (markerp (move-marker (make-marker) pos buffer))
+	         (t (cons file pos)))))
+	  ;; Remove opened buffer in the process.
+	  (unless markerp (kill-buffer buffer))))
+    (error "org-id-find-remote:  reference to missing file %s" file)))
+
 ;;;###autoload
 (defun org-id-find (id &optional markerp)
   "Return the location of the entry with the id ID.
@@ -346,16 +380,19 @@ With optional argument MARKERP, return the position as a new marker."
   (cond
    ((symbolp id) (setq id (symbol-name id)))
    ((numberp id) (setq id (number-to-string id))))
-  (let ((file (org-id-find-id-file id))
-	org-agenda-new-buffers where)
-    (when file
-      (setq where (org-id-find-id-in-file id file markerp)))
-    (unless where
-      (org-id-update-id-locations nil t)
-      (setq file (org-id-find-id-file id))
-      (when file
-	(setq where (org-id-find-id-in-file id file markerp))))
-    where))
+  (let ((remote-match (org-id-parse-remote-table-ref id)))
+    (if remote-match
+        (org-id-find-remote (car remote-match) (cadr remote-match) markerp)
+      (let ((file (org-id-find-id-file id))
+	    org-agenda-new-buffers where)
+        (when file
+          (setq where (org-id-find-id-in-file id file markerp)))
+        (unless where
+          (org-id-update-id-locations nil t)
+          (setq file (org-id-find-id-file id))
+          (when file
+	    (setq where (org-id-find-id-in-file id file markerp))))
+        where))))
 
 ;;; Internal functions
 
diff --git a/lisp/org-table.el b/lisp/org-table.el
index ac685c41e..e894d563a 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -6281,7 +6281,7 @@ list of the fields in the rectangle."
     (let ((case-fold-search t) (id-loc nil)
 	  ;; Protect a bunch of variables from being overwritten by
 	  ;; the context of the remote table.
-	  org-table-column-names org-table-column-name-regexp
+          org-table-column-names (org-table-column-name-regexp org-table-column-name-regexp)
 	  org-table-local-parameters org-table-named-field-locations
 	  org-table-current-line-types
 	  org-table-current-begin-pos org-table-dlines
-- 
2.40.1


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

* Re: [PATCH] org-id: implement arbitrary cross-file references
  2023-05-27 15:19     ` Sergei Kosyrev
@ 2023-05-29  8:52       ` Ihor Radchenko
  2023-07-02 10:58         ` Ihor Radchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Ihor Radchenko @ 2023-05-29  8:52 UTC (permalink / raw)
  To: Sergei Kosyrev; +Cc: emacs-orgmode

Sergei Kosyrev <kosejin@proton.me> writes:

> Fair enough -- I'm open to sign the FSF copyright assignment.

Thanks for your interest to contribute to Org mode!
See https://orgmode.org/worg/org-contribute.html#copyright for the
details how to get started with FSF copyright assignment.

FSF generally replies within 5 working days. If not, let us know.

> +#+BEGIN_src org
> +#+TBLFM: $2='(identity remote(file:./org-wile-with-tables.org,@@#$Value))
> +#+END_src

Would it not be more reasonable to allow generic file links here? Like
in 4.4 External Links section of the manual:

             ‘file:projects.org’
             ‘file:projects.org::some words’ (text search)(1)
             ‘file:projects.org::*task title’ (headline search)
             ‘file:projects.org::#custom-id’ (headline search)

> +(defun org-id-parse-remote-table-ref (refstr)
> +  (save-match-data
> +    (when-let* ((match (string-match "^file:\\([^:]+\\)\\(\\|:.+\\)$" refstr))
> +                (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))))

The format of file:... has nothing at all to do with org-id.el library.
You should instead modify how org-table.el parses remote references
instead of abusing ID resolution mechanisms.

> +                             (let* ((ident (cl-subseq table-id 1))
> +                                    (id-match (search-forward (concat "#+NAME: " ident) nil t)))
> +                               (unless id-match
> +                                 (error "org-id-find-remote: file \"%s\" has no table with NAME \"%s\"." file ident))

Be aware that not all the things with #+NAME in Org files are tables.
You can use `org-element-at-point' to check element type you are looking at.

> -	  org-table-column-names org-table-column-name-regexp
> +          org-table-column-names (org-table-column-name-regexp org-table-column-name-regexp)

I fail to see the reason behind this change. May you explain why you had
to protect the global value here?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [PATCH] org-id: implement arbitrary cross-file references
  2023-05-29  8:52       ` Ihor Radchenko
@ 2023-07-02 10:58         ` Ihor Radchenko
  2023-07-02 13:51           ` Sergei Kosyrev
  0 siblings, 1 reply; 10+ messages in thread
From: Ihor Radchenko @ 2023-07-02 10:58 UTC (permalink / raw)
  To: Sergei Kosyrev; +Cc: emacs-orgmode

Hello,

It has been over one month since the last message in this thread.
May I know if you had a chance to look at my comments?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [PATCH] org-id: implement arbitrary cross-file references
  2023-07-02 10:58         ` Ihor Radchenko
@ 2023-07-02 13:51           ` Sergei Kosyrev
  2023-07-02 15:39             ` Ihor Radchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Sergei Kosyrev @ 2023-07-02 13:51 UTC (permalink / raw)
  To: yantar92; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 685 bytes --]

Hello,

Yes, I saw your comments, thank you for them.

Since they imply a non-trivial reformulation, it would require another deep dive, which I cannot commit to right now.

On Sun, Jul 2, 2023 at 13:58, Ihor Radchenko <[yantar92@posteo.net](mailto:On Sun, Jul 2, 2023 at 13:58, Ihor Radchenko <<a href=)> wrote:

> Hello,
>
> It has been over one month since the last message in this thread.
> May I know if you had a chance to look at my comments?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>

[-- Attachment #2: Type: text/html, Size: 1006 bytes --]

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

* Re: [PATCH] org-id: implement arbitrary cross-file references
  2023-07-02 13:51           ` Sergei Kosyrev
@ 2023-07-02 15:39             ` Ihor Radchenko
  2023-10-02 13:36               ` Ihor Radchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Ihor Radchenko @ 2023-07-02 15:39 UTC (permalink / raw)
  To: Sergei Kosyrev; +Cc: emacs-orgmode

Sergei Kosyrev <kosejin@proton.me> writes:

> Yes, I saw your comments, thank you for them.
>
> Since they imply a non-trivial reformulation, it would require another deep dive, which I cannot commit to right now.

Thanks for the update!
If you need any help with Org internals, feel free to ask questions.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [PATCH] org-id: implement arbitrary cross-file references
  2023-07-02 15:39             ` Ihor Radchenko
@ 2023-10-02 13:36               ` Ihor Radchenko
  2024-04-07  9:52                 ` Ihor Radchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Ihor Radchenko @ 2023-10-02 13:36 UTC (permalink / raw)
  To: Sergei Kosyrev; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> Sergei Kosyrev <kosejin@proton.me> writes:
>
>> Yes, I saw your comments, thank you for them.
>>
>> Since they imply a non-trivial reformulation, it would require another deep dive, which I cannot commit to right now.
>
> Thanks for the update!

It has been a couple of months since the last activity in this thread.
May I know if you are still interested to work on this feature?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [PATCH] org-id: implement arbitrary cross-file references
  2023-10-02 13:36               ` Ihor Radchenko
@ 2024-04-07  9:52                 ` Ihor Radchenko
  0 siblings, 0 replies; 10+ messages in thread
From: Ihor Radchenko @ 2024-04-07  9:52 UTC (permalink / raw)
  To: Sergei Kosyrev; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> It has been a couple of months since the last activity in this thread.
> May I know if you are still interested to work on this feature?

No followup has been received within over half a year.
I am thus closing this ticket.
Canceled.

Feel free to re-open if there is any progress.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

end of thread, other threads:[~2024-04-07  9:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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.
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

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).