emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Samuel Wales <samologist@gmail.com>
To: doltes <doltes512@gmail.com>
Cc: arozbiz@gmail.com, emacs-orgmode@gnu.org
Subject: Re: How can I keep Org-id links from breaking when moving files?
Date: Tue, 19 Jan 2021 17:13:46 -0700	[thread overview]
Message-ID: <CAJcAo8soVOniCUegvw6+rkYdB5CkPe3Rd8hEXwu7b8YbVOA1fA@mail.gmail.com> (raw)
In-Reply-To: <87ft2wvktj.fsf@gmail.com>

(defvar org-id-locations nil
  "List of files with IDs in those files.")

(defvar org-id-files nil
  "List of files that contain IDs.")

you are in a maze of twisty little passages.

you are in a twisty maze of little passages.

On 1/19/21, doltes <doltes512@gmail.com> wrote:
> arozbiz@gmail.com writes:
>> This question is in the context of using Org-id UUIDs for linking between
>> files. If I understand correctly, Org-id knows where to look for UUIDs
>> (generated by org-id-get-create) by looking at the org-id-locations
>> variable. But what if I move an .org file that I've generated a UUID into
>> another folder? I know I can run org-id-update-id-locations, and there's
>> an
>> org-id-extra-files variable, but is there a way to list all the folders
>> on
>> the system where Org-id should look for UUIDs?
>> Thanks,
>> Alan
> After reading the docstring of the function
> =org-id-update-id-locations=, I found that the files which are scanned
> are defined by 6 variables.
> The following was retrieved from the docstring
> #+begin_quote
> This will scan all agenda files, all associated archives, and all
> files currently mentioned in ‘org-id-locations’.
> #+end_quote
> This implies that when that function is executed, the files whose
> content is searched for IDs (i.e. they are scanned) are
> + The files mentioned in =org-agenda-files=.
> + The archives associated to the files in =org-agenda-files=.
> + The files mentioned in =org-id-locations=.
> + The files provided as arguments to the =org-id-update-id-locations=.
> The following are not mentioned in the documentation of
> =org-id-update-id-locations=, but when looking at the source code, you
> can see that the value of the following variables is used
> + =org-id-extra-files=
> + =org-id-files=
> As we could see, the files which are scanned are defined by 6 variables.
> Now, apparently, you want to get a list of the files which are
> scanned. You can do that by executing what
> =org-id-update-id-locations= executes in order to get the list of
> files to scan. The following was retrieved from that function with
> some modifications
> #+begin_src elisp :results output
> (let ((files (delete-dups
> 	       (mapcar #'file-truename
> 		       (append
> 			(org-agenda-files t org-id-search-archives)
> 			(unless (symbolp org-id-extra-files)
> 			  org-id-extra-files)
> 			org-id-files)))))
>   (dolist (file files) (princ (format "%s\n" file))))
> #+end_src
> #+begin_example
> /home/username/my/org/Statistics.org
> /home/username/my/org/Programming languages/Elisp.org
> /home/username/my/org/Programming languages/R.org
> #+end_example
> Hope that helps. Let me know if that answers your question.

The Kafka Pandemic

Please learn what misopathy is.

  reply	other threads:[~2021-01-20  0:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19  2:52 arozbiz
2021-01-19 18:32 ` doltes
2021-01-20  0:13   ` Samuel Wales [this message]
2021-01-20 11:39     ` doltes
2021-01-21 13:14       ` arozbiz
2021-01-22 19:16         ` TRS-80

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:

  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=CAJcAo8soVOniCUegvw6+rkYdB5CkPe3Rd8hEXwu7b8YbVOA1fA@mail.gmail.com \
    --to=samologist@gmail.com \
    --cc=arozbiz@gmail.com \
    --cc=doltes512@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: How can I keep Org-id links from breaking when moving files?' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


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