emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Samuel Wales <samologist@gmail.com>
To: "Victor A. Stoichita" <victor@svictor.net>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Reciprocal links between items
Date: Thu, 1 Oct 2020 14:53:52 -0700	[thread overview]
Message-ID: <CAJcAo8vyTBEcXFqv4M1Ynfi05311t8mOZ7vw3HNfRBjyz2Ku-w@mail.gmail.com> (raw)
In-Reply-To: <87362xvs55.fsf@svictor.net>

Hi Victor,

Currently Org-ID can only be placed on entries.  This uses the
properties drawer.  When we are talking about entries, what I do is,
use Org-ID links to entries to go in one direction, and an agenda
search to go in the opposite direction as follows.


(define-key org-mode-map (kbd "C-c w") 'alpha-org-what-links-here)
(defun alpha-org-what-links-here ()
  "Show all links that point to the current node.
Possibly also show the target node itself.

I think this gets all archive files in $dorg, including ones with
no corresponding .org file.  See `alpha-org-all-org-files'.

  - fixme produce error if no id or fix non-id search
  - fixme Bug in Org: g in agenda removes entries =maybe fixed
  - fixme org text search does not work in non-org-mode files or
    in org files text above the outline tree ka
    - we might want to search in del and dsh also via grep

This makes Org ID links quasi-bidirectional.
"
  (interactive)
  (let ((org-agenda-files (alpha-org-all-org-files))

        org-agenda-skip-comment-trees
        org-agenda-skip-archived-trees

        (search-string (or
                        ;; inherits id from ancestors
                        ;; raw id so it will pick up target
                        (alpha-awhen (org-entry-get nil "ID" t)
                          (regexp-quote it))
                        (concat "{\\("
                                ;; tries searching a link to id
                                ;; not sure if useful
                                (regexp-quote (org-store-link nil))
                                "\\|\\<"
                                ;; not sure if useful
                                (regexp-quote (org-get-heading))
                                "\\>\\)}"))))
    (org-search-view nil search-string)))


When you say item, do you mean list item, or thing?  In either case,
Org cannot currently do this.

To do that, you can search the mailing list for ID markers and
implement them, which pretty much do what you want, or try
implementing something with the new link mechanism to include Org-ID.
This would allow them as link targets.

I think Org-ID is likely to be part of your mix, regardless of what
you do to implement this, if you do.

One concern I have is that Org-ID is already slow in searching.
Making it search for anything of a lower syntactic status than entries
might or might not make it slower.  Perhaps it would be necessary to
tell the search engine what it is looking for.


On 10/1/20, Victor A. Stoichita <victor@svictor.net> wrote:
>
> Le 01 Oct 2020, Alan Schmitt <alan.schmitt@polytechnique.org>
> a écrit :
>> You might want to have a look at org-roam, that implements such
>> backlinks.
>
> Thanks Alan! That’s interesting!
>
> I watched the introductory video and started reading the org-roam
> docs. They begin with the rationale of Zettelkasten note taking,
> which implies one org file per note, and an sqlite database…
> I think that org-roam can be a great tool, but it takes too big
> a change for what I need (basically just the ability to insert
> backlinks).
>
> I guess that if I want something simple which avoids using an
> external database, I could write a function that inserts and
> deletes the links in both items. Maybe a good way to train my
> lisp-foo.
>
> Kind regards,
> Victor
>
>
>
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html


  reply	other threads:[~2020-10-01 21:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01  8:53 Victor A. Stoichita
2020-10-01  9:49 ` Alan Schmitt
2020-10-01 16:16   ` Victor A. Stoichita
2020-10-01 21:53     ` Samuel Wales [this message]
2020-10-02  8:29       ` Victor A. Stoichita
2020-10-02  1:42     ` Ihor Radchenko
2020-10-02  8:16       ` Victor A. Stoichita

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=CAJcAo8vyTBEcXFqv4M1Ynfi05311t8mOZ7vw3HNfRBjyz2Ku-w@mail.gmail.com \
    --to=samologist@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=victor@svictor.net \
    --subject='Re: Reciprocal links between items' \
    /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

Code repositories for project(s) associated with this 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).