Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .config/zsh/aliases.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ alias mkdir="mkdir -p"
# fd is installed as fdfind on Ubuntu/Debian
command -v fdfind > /dev/null && alias fd=fdfind

# Emacs client with proper socket
alias e="emacsclient -a 'emacs' --socket-name $EMACS_SOCKET_NAME"
# Emacs client. No --socket-name: emacsclient derives the same default socket
# path that server-start writes, so hardcoding it only creates a way for the
# two to disagree (they did, on macOS).
alias e="emacsclient -a 'emacs'"

# Deno web server
alias serve="deno run --allow-read --allow-net jsr:@std/http/file-server"
Expand Down
18 changes: 5 additions & 13 deletions .config/zsh/tools.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,11 @@ if [[ -z "$XDG_RUNTIME_DIR" ]]; then
fi
fi

# Configure Emacs socket name based on platform
# These paths must match Emacs's default server-socket-dir behavior
# Emacs checks XDG_RUNTIME_DIR first (on any platform), then falls back
if [[ -n "$XDG_RUNTIME_DIR" ]]; then
EMACS_SOCKET_NAME="${XDG_RUNTIME_DIR}/emacs/server"
elif [[ "$CURRENT_OS" = "Darwin" ]]; then
# Darwin fallback: $TMPDIR/emacs (no UID)
EMACS_SOCKET_NAME="${TMPDIR%/}/emacs/server"
else
# Linux fallback without XDG_RUNTIME_DIR: /tmp/emacs<uid>
EMACS_SOCKET_NAME="/tmp/emacs$(id -u)/server"
fi
export EMACS_SOCKET_NAME
# No EMACS_SOCKET_NAME here on purpose. This block used to re-derive Emacs's
# default server-socket-dir, and got it wrong on macOS: Emacs 30 uses
# $TMPDIR/user/<uid>/emacs, not $TMPDIR/emacs, so every `e' missed the running
# server and cold-started a new Emacs instead. emacsclient computes the same
# default the server does, so the right fix is to not pass --socket-name.

# Set up Java environment
export JAVA_OPTIONS="-Djava.awt.headless=true"
Expand Down
36 changes: 36 additions & 0 deletions .emacs.d/early-init.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
;;; early-init.el --- Runs before package.el and the first frame -*- lexical-binding: t; -*-

;; Emacs 27+ loads this before package initialization and before the initial
;; frame is created. Anything that changes frame geometry belongs here, so
;; the frame gets drawn once at its final size instead of flickering.

;; Effectively disable GC for the duration of startup. init.el restores a
;; sane working threshold on `emacs-startup-hook'.
(setq gc-cons-threshold most-positive-fixnum
gc-cons-percentage 0.6)

;; init.el drives package activation itself so it can guarantee that
;; dependencies are on the load-path before anything macro-expands against
;; them. Without this, a first run on a machine with an empty elpa/ fails
;; while activating packages that expand against compat.
(setq package-enable-at-startup nil)

;; Frame chrome. Setting these as frame parameters avoids drawing the bars
;; and then removing them.
(push '(tool-bar-lines . 0) default-frame-alist)
(push '(menu-bar-lines . 0) default-frame-alist)
(push '(vertical-scroll-bars) default-frame-alist)

;; Don't re-lay-out the frame every time the font or modeline changes size.
(setq frame-inhibit-implied-resize t)

;; Native compilation warnings come almost entirely from third-party
;; packages, where there is nothing useful to do about them.
(setq native-comp-async-report-warnings-errors 'silent)

;; Skip the regexp scan of `file-name-handler-alist' for every file loaded
;; during startup. init.el puts it back.
(defvar tl/file-name-handler-alist file-name-handler-alist)
(setq file-name-handler-alist nil)

;;; early-init.el ends here
Loading
Loading