Skip to main content

Emacs and MacOS Catalina

Catalina introduced a lot of security changes and the most intrusive is probably all the popups asking to give permission for apps to access directories under Home, like Documents. Worse still, apps which weren't written to handle the new security measures might just fail silently with no clues for the user.

A solution is to give apps like Emacs "Full Disk Access" under "Security & Privacy" in Preferences, to give unfettered access to your files and avoid all the popups and silent failures.

Sounds good, but that doesn't actually work for Emacs because "Emacs" in the app bundle is actually a Ruby script which decides which flavour of Emacs executable to run. This never mattered before, but it does under Catalina because MacOS thinks the executable is /usr/bin/ruby.

Conventional wisdom is therefore to give "Full Disk Access" to Ruby. While this does work, I've always been uncomfortable giving all Ruby scripts full access, particularly as I never write Ruby scripts myself.

I also recently realised the Ruby launcher causes other problems on Catalina:

  • Opening a file associated with Emacs from the Finder doesn't work if Emacs is already running.
  • Opening Emacs with Spotlight (e.g. with Cmd-Space e) doesn't work if Emacs is already running.

After some investigation, I was able to remove the dependency on the launcher and everything is now working fine.

Here are the steps:

  1. Use the Emacs executable rather than the Ruby launcher
$ cd /Applications/Emacs.app/Contents/MacOS
$ mv Emacs Emacs-launcher
$ ln -s Emacs-x86_64-10_14 Emacs
  1. Use the correct versions of bin & libexec
$ rm bin
$ ln -s bin-x86_64-10_14 bin
$ rm libexec
$ ln -s libexec-x86_64-10_14 libexec

Of course, this will have to be redone after upgrading Emacs.app to a different version.

Giving Emacs Full Disk Access
Giving Emacs.app Full Disk Access


Comments

Popular posts from this blog

Merging Git Repositories

No project of significant size that I've ever seen has retained its initial structure. Restructuring projects is a fact of life, but unfortunately Git doesn't make it easy. Fundamentally this stems from the way Git works, treating changes as a succession of snapshots and not storing any other metadata. Of course this is part of what makes Git fast and efficient, but at the expense of making some common operations more difficult for users. Git really is a perfect 21st century illustration of the classic  "Worse Is Better"  paradigm of successful software 😀 Previously I discussed how to split a Git project apart into separate repositories . Now I'm going to discuss how to do the opposite and merge separate repositories into one. On the face of it, this would seem a simpler task as Git has powerful support for merging... Let's take the opposite example to my splitting apart article - say you have a main Git repo (ProjA) and a second repo (ProjB) in...

My Work in new Top Trumps Birds of Prey Pack

The new Top Trumps "Birds of Prey" pack has my picture illustrating the Secretary Bird card 😀 Here's the original picture: From Flickr

Indian Summer Continues

The unseasonably warm weather continues with wildlife aplenty. I managed to get a little bit closer to one of the SparrowHawks that lives around here: Soaring SparrowHawk Nikon D300s, 70-200 f/2.8G VR II and TC-1.4E II converter. Still not close enough to get a decent shot though! A Grey Heron also flew over while I was watching out for the SparrowHawk. St Albans must be one of the best places in Britain to see Herons, as they are a common sight in the fields. Never mind the large breeding colony in Verulamium Park. Heron Flying Over Local Fields Also saw some more mundane wildlife, still enjoying the last vestiges of Summer: Bee Supping Nectar from a Wildflower Young Rabbit at Sunset