Mac – How to install both Cocoa and X11 of Emacs (preferably with Homebrew)

cocoaemacshomebrewx11

I want to try out and compare both the Cocoa- and X11-based versions of Emacs.

In general, I try to install all such packages through Homebrew, but in this case it looks like I Homebrew requires me to choose one of the two versions.

Is there a way for Homebrew to install and simultaneously manage two parallel installations of Emacs?

If not, I suppose that I'd install/manage one of the two versions with Homebrew, and the other one "by hand". In this case, however, I'd like the non-Homebrew installation to be configured and built exactly as Homebrew would. This means configuring the build in the same way as Homebrew does, except for those aspects of the installation (e.g. locations of runtime files) that would directly conflict with Homebrew's Emacs installation.

What's the simplest way to generate an installation script that would faithfully replicate Homebrew's build for one of these two versions of Emacs?

(I imagine that the task mentioned in the last question would be a triviality for Ruby programmers, but I don't know the first thing about Ruby. I write code for a living, though, so solutions involving some programming–say, python/perl/bash scripting–would be fine with me.)

BTW, the solution does not have to be "super maintainable", since I expect that after running this side-by-side comparison for at most a few months I'll pick one of the two versions, and stick with it from then on.


Background
For many, many years I've been happily running Emacs on Terminal, in text-only mode. What makes this set-up less ideal than it has been so far is that now I want to start using Emacs' Org Mode, which has many key combinations that don't get correctly transmitted by Terminal. For example, when I type M-S-<right>, what Emacs actually receives—via Terminal—is M-<right>. This is a known issue, and there are official work-arounds for it, but I'd prefer to avoid them altogether if I can. My hope is that one or both of the versions of Emacs mentioned in this question will do this. But, since I've been using Emacs 5-10 hrs/day for almost three decades now, I've become quite sensitive to the details of my interaction with it. This is why I want to try both the Cocoa- and X11-based versions of it side-by-side before settling for one. If neither fits the bill, I'll try AquamacsEmacs. I tried AE several years ago, but it did not win me over (for reasons I can no longer remember), so I see AE as a distant third choice.

Best Answer

In this case I would install Aquamacs or Emacs for OS X to get the Cocoa version and Homebrew for the X11 version.

Aquamacs is tuned to appear more Mac like so might not do exactly what you want - but all this is done in configuration so easy to change for an emacs veteran