TooflessSnek · 2022-01-27 21:15
I'm brand new to macos, emacs, brew, cask, etc. I come from Windows support, and have some Unix command line and scripting background. But the brew installation framework is confusing as hell to me. After some research, it seems like I should use something like one of the following to install emacs:
- brew tap railwaycat/emacsmacport
brew install emacs-mac
OR
- brew tap railwaycat/emacsmacport
brew install --cask emacs-mac.
What's the difference? Also, are there any other options that I should include when installing? (Also note that I want to learn org-mode.)
A couple people on another thread suggested I install like one of these:
- brew install emacs-mac --with-rsvg --with-natural-title-bar --with-starter --with-mac-metal --with-glib --with-imagemagick
- https://github.com/mclear-tools/build-emacs-macos
Note: I don't really understand the above options very well. I don't know what --whit-mac-metal means.
Doomer1999 · 2022-01-28 00:02
I'd suggest cask. I had emacs via nix for native comp and it was alright but I recently went back to emacs- mac --with-metal. Can't wait for emacs Mac 28!
TooflessSnek · 2022-01-28 00:22
Note: ELI5, pretend I'm a newbie. So you're comparing cask with the nix package manager? What's the difference between "brew install emacs-mac" and "brew install **cask** emacs-mac"? Why do you prefer cask? Is that better than non-cask, aka "brew install emacs-mac"?
What is --with-mac-metal? Why do you like it?
What will be so good about emacs Mac 28?
c256 · 2022-01-28 05:35
Note: I moved away from macOS a few years back, so I might be a little out of date.
‘brew’ is the command for invoking homebrew, a package manager for macOS (there are variants for other OS’s; you don’t care). It originally worked via ‘formulas’, which were sets of instructions for how to install (download, unpack, enable, etc.) various command-line programs. Over time, it grew the ability to also manage GUI applications, not just CLI stuff. That ability was named ‘cask’. As of a few years back, this ability was made (more or less) the default, but once upon a time you had to ask for it specifically.
A ‘tap’ is a way to tell homebrew how to find software outside of the central homebrew repository. This is useful for things that change faster than homebrew wants, for things too niche to add to the central repository, and for taking things that aren’t yet fully released and making them available via homebrew. Since Emacs releases every couple years, and lots of work happens well before the official releases, this is useful for getting newer versions of emacs without building it yourself.
Emacs itself is a very old and stable codebase (I’ve personally been using it for more than 30 years), and it supports lots of platforms. For the Mac, it originally added graphical support using the gui apis that descended from NextStep, called “the ns port”. After a while, macOS added a new set of graphics frameworks itself, and someone added support to Emacs (“the mac port”). This supports some nicer features missing from the ns port, but the ns port also works with a non-mac toolkit called GNUStep (an effort to replicate the NextStep interface code in free software), so the default emacs codebase stuck with the ns port. (There are a bunch of de&ails here that aren’t important to your question.) This is indicated in your Q by ‘emacs-mac’.
Even more recently, Apple added a new way to do low-level graphics called Metal. This lets Mac’s and iOS devices use the same code to do fast&fancy graphics on modern GPUs (which weren’t really a thing when NextStep was created).
Important aside: ImageMagick is a set of programs from the early days of the ‘net that aim to convert and display a very wide variety of image formats, including a large swath that you’ve never heard of and should never find. Emacs has support for using these tools in the background for making any of those relics that you happen across be viewable. This is a fine idea in theory, but in practice that code base was not written to be used on malicious data — that is, it’s not safe to run those programs on random images you might find on the internet. Emacs itself (either ns port or Carbon) can handle all of the images you’re likely to care about, and ImageMagick eventually garnered so many security warnings that the right answer these days is “don’t use ImageMagick unless you’re _really_ sure you know what you’re doing”.
RSVG adds support for scalable vector graphics that is is used in a few places here and there; not common enough to be supported directly, but in the modern world of HiDPI displays, it’s nice to be able to scale visuals and have them look good.
Finally, the “mclear-tools” link is for instructions to build emacs yourself. This isn’t crazy difficult or anything, but probably not what you want.
So, let’s go over the options:
The first two brew invocations should do the same thing: install the Mac port of emacs as a graphical application. The rest of the “-with-XXX” options in your third invocation add some optional features. You can leave them off for now, or add them in and see if you like them, but I suggest leaving out -with-imagemagick and -with-glib. Starter is a package of alternative settings that some people think make it easier to get started with Emacs (which is notoriously somewhat hard at the start, perhaps unsurprising for software designed a half-century ago). I don’t recognize -with-natural-title-bar, but I assume it changes the default appearance of the title bar to make it better fit the macOS ui; I wouldn’t worry about it for now.
Whew! Hope that helps.
Lowki1993 · 2022-01-28 05:45
I’m a fairly novice emacs user but I will do my best here to help.
The cask option is specific to homebrew and means that the download will be the GUI option (graphical user interface) as opposed to downloading the TUI option (terminal user interface). Check out this page for a little more information on the homebrew options:
https://mac.install.guide/homebrew/index.html
You’ll notice on that link that it describes what the tap process does too.
The difference between the TUI and GUI emacs application can be found with a simple google search. I use the GUI application and run it on an M1 Mac (non M1 too previously).
Your question around —with-metal is the one I’m probably not able to offer much help with but my assumption is that the developer has added some additional integration features. I personally didn’t add it on the premise of not understanding what it offered and have seen great performance any ways.
Finally, emacs 28 is the next stable release of emacs and will be providing native compilation (this I believe is the translation of emacs lisp into native code with some compilation magickery). This should offer a great improvement on speed, however, the emacsmacport has yet to implement this. An alternative would be to use emacs-plus by d12frosted if you want to experience this.
From the research I did, which you choose is personal preference. Emacsport has a great reputation for fantastic macOS integration but emacs plus offers the updated native compilation. I use emacsport with emacs 27 on an M1 and the start up time is less than 1 second, but your mileage may vary.
Hope that helps and I hope others in the forum will correct me if I’m wrong in any of what I’ve written.
TooflessSnek · 2022-01-28 06:01
Wow, amazing reply, thanks!
TooflessSnek · 2022-01-28 06:03
Great info, thanks!