girzel / ebdb

An EIEIO port of BBDB, Emacs' contact-management package
67 stars 12 forks source link

Create an EBDB link in org-mode? #114

Closed davidpiano closed 5 months ago

davidpiano commented 5 months ago

I'm using the EBDB version from ELPA, and the built-in org-mode 9.6.11 on Emacs 30.0. In case it matters, this is a native Android version that came from this Sourceforge page.

I have one org-mode headline for each of a list of people, and somewhere under each headline I'd like to have a link to that person's EBDB record. Formerly, using BBDB, I was able to put [[bbdb:Firstname Lastname][Display Text]], so my first failed attempt was simply to change every bbdb to ebdb and cross my fingers.

Then I looked in EBDB's manual šŸ˜ƒ, where it explains that the format of links to EBDB is different, and it says links based on the uuid should run faster and be more reliable. That makes sense to me, and I change my links to be like this: [[ebdb:uuid/paste-uuid-here][Display Text]] But when I click on the result, org-mode still says "No match - create this as a new heading?"

When I'm in an EBDB buffer, I also can't find any command that looks like it would create a link. When I try C-c l, it says "No method for storing a link from this buffer". (The same message appears if I do M-x org-store-link inside an EBDB buffer.)

Other org-mode links are working fine, both to create and to use, and the hand-written bbdb links were working fine on this setup too.

Am I making my EBDB links in the wrong format because I've misunderstood the manual?

Is there maybe something else I need to install (or require something in my init file)?

girzel commented 5 months ago

This just sounds like ebdb-org.el has not been loaded. Can you require it and try both things (creating a link from EBDB, and following a link from an Org file) again?

I started off EBDB with a bad design approach, that asked users to require libraries to enable additional functionality. This isn't very Elispy -- a better approach is asking them to set custom variables, or autoloading commands. In the case of ebdb-org I see I haven't done that! The call to org-link-set-parameters, which does the hookup, is at the top level of the library, so you still need to require.

I should come up with a different approach to this, but in the meantime I should at least document that this is necessary.

Please let me know if your immediate problem is fixed -- if so I'll close this issue, and make another one about fixing the extra-library problem.

davidpiano commented 5 months ago

Thank you - you were right. I added (require 'ebdb-org) to my init file, restarted Emacs, and org links to EBDB are working as described in the manual, including the ability to create them from within EBDB.

I personally don't think it's very important to switch your methods for extra libraries, if the first line in each such section of the manual (such as the "Org Integration" section) explicitly mentions what will need require-ing to make it work.

I also accidentally discovered that the ebdb: inside the links is case sensitive. If it's uppercase, the link stops working.

girzel commented 5 months ago

Okay, good to know, thanks for testing.

I don't think it's a huge tragedy to require require, but I should work towards a different solution. I'll document this for now.

Noted re. link case sensitivity. I think that's out of EBDB's hands, though -- that's all Org.

Thanks again, closing.