novoid/Memacs

org-link-abbrev-alist example not working as expected

squarepegsys opened this issue · 1 comments

Maybe my org/emacs magic isn't as strong as yours. Or maybe it's my OSX

I used your example:

(setq org-link-abbrev-alist
      '(
	("tsfile" . "~/path/to/memacs/files.org_archive::/\*.*%s/")
	))

And then when I clicked on my test link, I got Finder (the OSX file browser) popped up in that folder and I still had to find the file.

I change it to this:

(setq org-link-abbrev-alist
      '(
	("tsfile" . "~/path/to/memacs/files.org_archive/%s")
	))

And that worked fine

The only difference I see between the two definitions in your comment is that my example is only looking for headings containing the string %s somewhere. Your definition is looking for an occurrence somewhere in the file or at a beginning of a line (I don't know).

https://www.gnu.org/software/emacs/manual/html_node/org/Link-abbreviations.html explains the basic concept, https://www.gnu.org/software/emacs/manual/html_node/org/Search-options.html#Search-options does so for the links to Org-mode headings. According to this, you just removed the regular expression and simplified the rule. To my knowledge, both should work. And no, my emacs magic is never stronger than anybody who is also able to read documentation because this is what I do because I don't know Emacs or lisp to any deeper level than this. ;-P

FYI: My current situation changed a bit:

https://github.com/novoid/dot-emacs/blob/master/config.org#links shows that I disabled the tsfile definition compared to the one above.

https://github.com/novoid/dot-emacs/blob/master/config.org#handling-tsfile-links-memacs is my current method to access tsfile links.