{"id":15663840,"url":"https://github.com/keyz/c311-get-started","last_synced_at":"2025-04-23T22:42:17.600Z","repository":{"id":84513673,"uuid":"41509800","full_name":"keyz/c311-get-started","owner":"keyz","description":"An opinionated guide for setting up Racket and Emacs on a Mac","archived":false,"fork":false,"pushed_at":"2016-02-10T13:41:22.000Z","size":16,"stargazers_count":17,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-22T17:10:37.902Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keyz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-27T20:29:47.000Z","updated_at":"2023-10-07T09:38:39.000Z","dependencies_parsed_at":"2023-03-07T21:15:11.141Z","dependency_job_id":null,"html_url":"https://github.com/keyz/c311-get-started","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyz%2Fc311-get-started","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyz%2Fc311-get-started/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyz%2Fc311-get-started/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyz%2Fc311-get-started/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keyz","download_url":"https://codeload.github.com/keyz/c311-get-started/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250528681,"owners_count":21445511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T13:40:09.770Z","updated_at":"2025-04-23T22:42:17.580Z","avatar_url":"https://github.com/keyz.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# c311-get-started\n\nThis document will serve as an (opinionated) guide for setting up Racket and Emacs on a Mac OS X. If you are on a Windows machine, [@jasonhemann](https://github.com/jasonhemann)'s [note](https://cgi.soic.indiana.edu/~c311/lib/exe/fetch.php?media=windows.pdf) should help.\n\n## 1. Get Racket\n1. Download the latest version of Racket from http://download.racket-lang.org/. Make sure you choose \"Racket\" as the distribution; the platform should probably just be \"Mac OS X (Intel 64-bit)\".\n2. Open the downloaded `racket-blabla.dmg`. Drag the entire `Racket v6.x.x` folder to `Applications` as instructed.\n3. Add `racket` and `raco` to your `$PATH` so that they can be easily found.\n   - Edit your `~/.bash_profile` (or `~/.zshrc` if you use zsh). Run the following line in your terminal:\n   - `echo 'export PATH=\"/Applications/Racket v6.4/bin\":$PATH' \u003e\u003e ~/.bash_profile`\n     - As of February 2016, the latest version of Racket is v6.4; if you download a newer version of Racket, make sure you to edit the version above.\n4. Activate these changes. Open a terminal window — Mac comes with `Terminal.app` by default; it's not bad but [iTerm2](https://www.iterm2.com/) is a better and free alternative.\n   - Run the following commands in your terminal:\n   - `source ~/.bash_profile`\n   - `echo \"(require xrepl)\" \u003e ~/.racketrc` (Optional, but recommended. This will enable Racket's [XREPL](http://pkg-build.racket-lang.org/doc/xrepl/index.html) in the command line)\n5. Try running `racket` in your terminal. You should be able to see a working REPL.\n\n## 2. Get Emacs\nThere are quite a few Emacs versions for Mac. However, the most handy one I've found is Yamamoto Mitsuharu's port: a GitHub mirror of it can be found [here](https://github.com/railwaycat/mirror-emacs-mac). The following part will be a walk-through of installing it via [brew](http://brew.sh/) (a package manager for Mac that just works™). You may also grab the pre-built binary files from https://github.com/railwaycat/mirror-emacs-mac/releases, but updating it won't be as convenient as using brew.\n\n1. Get brew.\n  - Go to http://brew.sh/\n  - Follow the instruction (paste the one-liner at a terminal prompt).\n2. Update brew.\n  - `brew update`\n3. Install Emacs via brew.\n  - `brew tap railwaycat/emacsmacport`\n  - `brew install emacs-mac` (or `brew install emacs-mac --with-modern-icon` if you don't like the default icon)\n  - `brew linkapps emacs-mac`\n4. You should be able to find `Emacs.app` in your `Applications` folder.\n5. If you want to be able to launch **GUI** Emacs via the terminal, add `alias e='open -a /Applications/Emacs.app'` to your `.bash_profile`.\n5. In the future, to upgrade your Emacs, run `brew update \u0026\u0026 brew upgrade emacs-mac`.\n\n## 3. Configure Emacs\nConfiguring Emacs from scratch could take you a loooong time. For your convenience, we've uploaded a minimal `init.el` file that provides some basic functionalities (for `racket-mode`) and fixes.\n\n1. Grab the file [`init.el`](./init.el) from this repo\n2. Put it in the `~/.emacs.d/` folder\n3. Restart your Emacs.app and wait for it to install packages (warnings are normal).\n\n### What's included in this `init.el`?\n- Automatic package installation, including:\n  - `racket-mode` for all the greatness.\n    - We rebind the `racket-run` command to `meta-enter` (`option-enter`). This is basically equivalent with DrRacket's `Run` button. If you don't like the keybinding, just modify it in `init.el`.\n  - `helm` cuz nobody can memorize all the emacs functions.\n  - `company` for auto completion.\n  - `rainbow-delimiters` so we won't need to get LASIK.\n  - `paredit` is included but disabled by default.\n    - We highly recommend activating paredit for Scheme/Racket/Lisp modes, but we understand that it could take a while to get used to it.\n    - Please read http://danmidwood.com/content/2014/11/21/animated-paredit.html first; when you are ready, change the line `(setq paredit-enabled nil)` to `(setq paredit-enabled t)` in `init.el` to activate paredit.\n- Fixes\n  - All the temporary files will be placed under `~/.emacs.d/bkup` so you won't see annoying `bla~` files in your working folder again.\n  - The Mac `option` key becomes `meta`.\n  - Perserve some OS X default system shortcuts in Emacs. To name a few:\n    - `Command-a` = \"Select All\"\n    - `Command-x` = \"Cut\", `Command-c` = \"Copy\", and `Command-v` = \"Paste\"\n    - `Command-s` = \"Save\"\n    - `Command-z` = \"Undo\"\n  - `recentf-mode`: use `C-x C-r` to access a list of recently edited files.\n  - Emacs grabs the `$PATH` variable from your shell.\n\nThat's it! Now you when you open a `.rkt` file, `racket-mode` will start working. The shortcut `option-enter` acts like DrRacket's `Run` button — make some changes, press `option-enter`, and you'll see some new stuff in the REPL.\n\n## Others (a.k.a. I wish we could write more)\nCustomizing Emacs is beyond the scope of this guide. You'll find tons of information on http://emacswiki.org/ and stackoverflow. http://emacsrocks.com/ also has some good staff to watch.\n\nFeel free to modify the `init.el` file (it's fun!). For more questions, please open a GitHub issue here: https://github.com/keyanzhang/c311-get-started/issues. If you find a better way to do things, pull requests are more than welcome!\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyz%2Fc311-get-started","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeyz%2Fc311-get-started","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyz%2Fc311-get-started/lists"}