Org-protocol broken after upgrade to M1 Macbook

Hey all. Did anyone else experience the problem of their org protocol links breaking after upgrading either to the latest MacOS or to the latest Apple Silicon processor?

I upgraded via migrating from my old laptop to my new one, and all the files got copied over, including the OrgProtocolClient.app, with all its configuration from

intact. But when I try to use it, nothing happens (at least it doesn’t look like anything happened).

Thanks for any suggestions!
Greg

How about this part:

You may need to manually register your handler, like this:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -R -f /Applications/OrgProtocolClient.app

The manual also talks about how to test the register for Mac.

Or your Emacs Server is not active? (server-mode, I believe).

Thank you Nobiot for offering your advice :slight_smile:

Yes, I ran that command on the new Mac before posting

Yes, when I run the testing command:

open org-protocol://roam-ref\?template=r\&ref=test\&title=this

nothing happens

I believe server mode is on, because

emacsclient foo.txt

works correctly. Is that assumption of mind correct – that if emacsclient works, emacs server-mode is working?

This back and forth has inspired me to check the value of org-protocol-protocol-alist. which I found to be nil. Well, that seems like it might be the problem. I will now investigate where these handlers are supposed to be registered and figure out why they aren’t.

OK I think I’ve solved the problem but going pretty deep into the rabbit hole but I’m not sure what exactly was wrong.

When I tried to evaluate

(require org-protocol)

I got an error along the lines of “org-roam-protocol not found”. When I checked my org-roam repo, I saw that org-roam-protocol was in the extensions folder, but I wasn’t sure how long ago it had moved there. So “to be safe” I deleted Doom’s directory of pre-compiled elc files and tried rerunning emacs, but then emacs didn’t start at all anymore.

doom sync and doom doctor didn’t work either, and they were failing with an “illegal instruction” error. I traced this to the fact that the emacs that doom was trying to run was the x86 executable, but in that same directory there was an arm64 executable, which from reading the doom shell script, I figured out I could use by setting the EMACS environment variable to the arm64 executable.

Once i set that env var, I was able to doom sync, rebuild the elc files, and then run emacs, and once I ran it, org-protocol could be loaded and now the browser based org-protocol links worked.

Whew!

This sounds like something the Doom community would benefit from :slight_smile:

Yes I’ve been posting over there too – and now have posted the solution I found as well :slight_smile:

1 Like