all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* org-id-locations-load should probably abbreviate file names
@ 2024-09-26 19:45 Martin Edström
  2024-12-15 14:14 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Edström @ 2024-09-26 19:45 UTC (permalink / raw)
  To: emacs-orgmode

This is not a bug that breaks normal use of org-id, but it may affect downstream uses.

An example is my package org-node, which checks file names known to org-id, and combines that with other sources of information, to build a big file list.

This list is automatically de-duplicated because I can normally assume the names are abbreviated. However, reading the source, it seems that it will not ensure this if `org-id-locations-file-relative` is t.  Then `org-id-locations-load` merely uses `expand-file-name`.  So a path that used to be ~/org/file.org becomes /home/me/org/file.org after loading back from disk.

This can be tested by evalling these sexps (if you replace "/home/me" with your own home):

(org-id-add-location "id1234" "/home/me/org/file.org")
(gethash "id1234" org-id-locations)
;; => "~/org/file.org"

(setq org-id-locations-file-relative t)
(org-id-locations-save)
(org-id-locations-load)
(gethash "id1234" org-id-locations)
;; => "/home/me/org/file.org"

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

end of thread, other threads:[~2024-12-15 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-26 19:45 org-id-locations-load should probably abbreviate file names Martin Edström
2024-12-15 14:14 ` Ihor Radchenko

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.