Emacs on macOS?

Hi,

I’m in the midst of switching jobs. I’m a developer and I use Emacs for pretty much all my development. At my old job I had the luxury of using Guix to setup my dev environment.

I wont have that luxury at my new one as I’ll be getting a MacBook to use (unclear of what model). So I’m thinking on how to best setup Emacs on that machine. I haven’t used macOS in probably 15 years so just using a Mac will be an adventure in itself.

The way I see it is that I have three options:

  1. Use homebrew to install Emacs, then let Emacs’ package manager handle the emacs packages. However there will be packages that require external tools that I need to install.
  2. Port my guix home configuration to Nix and use that to setup Emacs. I need to learn Nix though.
  3. Install a virtual machine of my current guix system and use that. Unclear how well that will work on macOS. Was not the most stable experience when I tried it on my steam deck using GNOME Boxes.

Any Mac users here that can share their wisdom?

For reference here is my current Emacs configuration using guix home: plt/home/emacs.scm

Thanks

Hi, I am working on a Mac as main machine. I use the native Emacs package for MacOS, but other than that just a standard Emacs installation with my ~/.emacs.d containing all configurations, packages etc.

I also work on linux and on windows, and I had no trouble just porting my ~/.emacs.d over to those platforms and also have everything working, so I expect you will be fine :slight_smile:

Thanks for sharing your Emacs configuration, I will try to have a look at some point.

Cheers,
Marc

Hi,

Ah ok. Maybe I was overthinking this. :sweat_smile: Nice to know that you can seamlessly switch between all of the major platforms.

No problem, this link might be better to get a better understanding how my Emacs configuration is setup: dotemacs

Edit: Sticky ctrl got in the way so I posted before I had finished my reply…

I use the Build Emacs for macOS script 1, it works very well. I started using it because the homebrew version exhibited a bug.

1 Like

I am in the same position as you. I switched from Mac OS X 10.4 to Linux about 15 years ago (2008-ish) and now I have a new job and they didn’t give me a choice, they just shoved a MacBook Pro M2 under my nose. The hardest thing is getting used to the keyboard layout, especially the modifier keys (Command, Option, Control). I swapped Command and Option, and made Capslock another Control key, that helped a lot.

Oh, and my awesome mechanical keyboard won’t work without a dongle because it only has USB-C connectors on the chasis. The only good thing about Apple nowadays is their HiDPI (“Retina”) display.

So, I did install Emacs using homebrew. The only problem is that after doing a software update with Homebrew, it resets the permissions. Mac OS has something like SELinux that (near as I can tell) tags executables not from the Mac App store as dangerous and disallows things like access to the filesystem. I think this would also be a problem with packages installed by Nix. So every time you do a software update, you have to go into the control center, find the options for “full disk access”, and add the Emacs.app to the list of blessed apps.

Otherwise it seems to work pretty much the same as on Linux.

For what its worth, I installed Aarch64 Debian 12.5 “Bookworm” into a QEMU VM via the UTM app. I use the SPICE protocol and I set vector graphics rendering to 200% native resolution, it looks beautiful. I don’t think I can do without a HiDPI display anymore.

With QEMU, sometimes forget I am using a Mac, it works perfectly, except that video/audio decoding must be done on the CPU which sometimes slows it down. Otherwise it is just as fast as using apps natively on Mac OS.

Most of my Emacs work is done in my QEMU Debian install now, I don’t have to use Mac OS Emacs very often.

Yeah, I’m not looking forward to use the keyboard. I do have a SterlingKey that I use to hook up my mechanical keyboard to my steam deck and phone via bluetooth. So might just go with that to avoid the dongle madness (although I guess the StrelingKey would be considered a dongle).

Got it, I’ll keep that in mind if I go the homebrew or nix route.

This sounds like running a Guix VM for Emacs might be a viable solution for me. I’m definitely going to test the UTM app. Thanks for the tip!

And yeah, it is not pleasant to go to a normal DPI screen once you have used HiDPI ones. Got two 27" 4k monitors that I use at home since the text is just so much nicer to read on them compared to a 1080p or even a 1440p screen at the same size.

I’ve used Emacs on Mac OS for years using Homebrew Emacs-plus.

2 Likes

In macOS, you have to go the application (typically in /Applications), right click on it and choose “Open”. You will get a dialog box telling you the app is from an unknown developer, do you want to open. Click OK and macOS from now on remembers that you trust this app.

1 Like

If you have the means, I would install Emacs via MacPorts. There is a port of the Mitsuharu fork of Emacs (https://ports.macports.org/port/emacs-mac-app-devel/) that adds customizations to better integrate into macOS which includes:

  • Native support for org-protocol
  • Native support for appearance changes
  • Drag and drop support
  • macOS services integration
  • Touchpad gestures
  • macOS-native tab support

I’ve written about administering MacPorts which IMHO I prefer over Homebrew.

1 Like