Ask HN: How to tune Emacs config for portability: Linux, macOS and Windows? I've been a GNU/Linux-only Emacs user for years, and most of my configuration has naturally evolved around that environment. Now I may need to start using macOS and Windows as well, and I'm realizing that "Emacs is cross-platform" and "my Emacs configuration is cross-platform" are two rather different things. I'm curious how people who maintain a substantial Emacs configuration approach this. My config is fairly modular and tries to stay close to vanilla Emacs where possible, using things like Elpaca, Corfu, Vertico, Eglot, etc. The Linux setup is fast and works exactly the way I want, but I don't want to end up with a giant collection of OS-specific conditionals every time I move between machines. This is my config by the way: https://codeberg.org/jjba23/heks-emacs Some things I'm particularly wondering about: - How do you handle filesystem paths and environment variables cleanly? - Do you abstract OS-specific functionality, or simply use `system-type` / `executable-find` where necessary? - How much do you rely on external Unix tools that aren't naturally available on Windows? - What's the best strategy for subprocesses and shell integration? - How do you handle fonts, GUI differences, clipboard behavior, notifications, and native window-system quirks? - Are there packages that you deliberately avoid because they make portability painful? - Do you maintain one config everywhere, or have a small portable core with platform-specific modules? - For Windows specifically, do you target native Emacs, WSL, MSYS2, or something else? - For macOS, are there particular pitfalls around GUI Emacs, Homebrew, PATH handling, or system services? I'm especially interested in lessons from people who have been maintaining the same Emacs configuration across multiple operating systems for years. What abstractions or conventions ended up being worth it? What things did you initially think would be portable but turned out to be surprisingly OS-specific? I'd also be interested in seeing examples of configuration architecture that make this manageable. The goal isn't necessarily "make every feature work identically everywhere." I'd rather have a portable core with sensible degradation than turn the config into an enormous pile of conditionals. What does a battle-tested cross-platform Emacs setup look like? |