These instructions originally came from [[https://jherrlin.github.io/posts/emacs-on-macos-monterey/][this essay]], as it runs Emacs as dæmon with LaunchAgent. Also fetch mails periodically with =mbsync= via LaunchAgent.
No longer need to install [[https://apps.apple.com/us/app/xcode/id497799835?mt=12][Apple XCode]], as these instructions require [[https://brew.sh][Homebrew]].
To get the native compilation for Emacs working, install:
#+begin_src sh
brew install libgccjit
#+end_src
Oh, and if we are still building with [[https://imagemagick.org/][ImageMagick]], install that first:
#+begin_src sh
brew install imagemagick
#+end_src
Best success comes from using the [[https://github.com/d12frosted/homebrew-emacs-plus][emacs-plus]] installation. To begin, add the /cask/:
I find that I need to … at least, on my work computer, install two different versions of Emacs that I use to distinguish one for “work” and the other for other activities, like IRC and [[file:ha-feed-reader.org][elfeed]]. To that end, I run the following commands to install Emacs:
And [[https://duckduckgo.com/?q=brew+ld%3A+symbol(s)+not+found+for+architecture+x86_64&t=ffab&ia=web][web searches]] yield mixed results. To solve, first /re-touch/ the environment (as it appears the problem is that some dependent library is now out-of-date compared to operating system installation):
#+begin_src sh
brew update
brew upgrade
#+end_src
Next make sure that all the dependencies are /reinstalled/ with the current operating system:
#+begin_src sh
brew reinstall $(brew deps emacs-plus@29)
#+end_src
Then reinstall the =libgccjit= (as it doesn’t seem to get picked up with the /deps/ listing):
On the Mac, =cron= has been removed and replaced with =LaunchAgent=. I find my [[file:ha-capturing-notes.org::*Push MacOS-Specific Content][ICanHazShortcut]] process pretty simple to start Emacs, so I’m not sure about this dæmon, but …
** Emacs dæmon via LaunchAgent
Notice that =UserName= section should be your =$USER= value.
#+begin_src xml :tangle ~/Library/LaunchAgents/gnu.emacs.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
Simple /Automator/ script that's wrapped into an application and placed in the =Applications= folder. Select *New Document*, then select *Application*. Open the *Library*, and drag the *Run Shell Script* to the /workflow/. In the box, add this:
#+begin_src sh
/usr/local/bin/emacsclient -nc --socket-name work $*
#+end_src
Change the *Pass Input* to =as arguments=.
Select to *Save* as =Emacsclient= into the *Applications* folder.
** Utils
Convert a plist XML file into a JSON file. Not sure why this is important to know…