emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Martin Edström" <meedstrom@runbox.eu>
To: "emacs-orgmode" <emacs-orgmode@gnu.org>
Subject: org-id-locations-load should probably abbreviate file names
Date: Thu, 26 Sep 2024 21:45:10 +0200 (CEST)	[thread overview]
Message-ID: <E1stuQI-0006YG-64@rmmprod06.runbox> (raw)

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"

                 reply	other threads:[~2024-09-26 19:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=E1stuQI-0006YG-64@rmmprod06.runbox \
    --to=meedstrom@runbox.eu \
    --cc=emacs-orgmode@gnu.org \
    /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).