Shell wrapper for emacsclient communication with running Emacs.
3-state circuit breaker (closed/open/half-open) with exponential backoff and structured telemetry prevent cascading failures when Emacs dies. structured data for observability.
Shell wrapper for emacsclient communication with running Emacs. 3-state circuit breaker (closed/open/half-open) with exponential backoff and structured telemetry prevent cascading failures when Emacs dies. structured data for observability.
Minimum time (ms) the circuit stays open before a recovery probe is allowed. Prevents thundering-herd probes right after a crash.
Minimum time (ms) the circuit stays open before a recovery probe is allowed. Prevents thundering-herd probes right after a crash.
Default timeout for emacsclient calls in milliseconds.
Default timeout for emacsclient calls in milliseconds.
Emacs daemon socket name. When set, emacsclient calls include -s <name>.
Resolved via hive-emacs.config (env EMACS_SOCKET_NAME).
nil = default daemon (no -s flag).
Emacs daemon socket name. When set, emacsclient calls include `-s <name>`. Resolved via hive-emacs.config (env EMACS_SOCKET_NAME). nil = default daemon (no -s flag).
Path to emacsclient binary. Resolved via hive-emacs.config (env EMACSCLIENT).
Path to emacsclient binary. Resolved via hive-emacs.config (env EMACSCLIENT).
Hard ceiling for any emacsclient call. The client layer is the last line of defense — no call may exceed this regardless of what callers request.
Hard ceiling for any emacsclient call. The client layer is the last line of defense — no call may exceed this regardless of what callers request.
(buffer-content buffer-name)Get content of a buffer by name.
Get content of a buffer by name.
3-state circuit breaker for emacsclient calls. :state — :closed, :open, or :half-open :tripped-at — System/currentTimeMillis when circuit last opened :backoff-ms — current backoff duration (doubles on repeated failures) :crash-count — total crash detections since JVM start :last-error — last daemon-death stderr string :last-tag — last daemon-death keyword tag :recovery-at — last time circuit transitioned to :closed
3-state circuit breaker for emacsclient calls. :state — :closed, :open, or :half-open :tripped-at — System/currentTimeMillis when circuit last opened :backoff-ms — current backoff duration (doubles on repeated failures) :crash-count — total crash detections since JVM start :last-error — last daemon-death stderr string :last-tag — last daemon-death keyword tag :recovery-at — last time circuit transitioned to :closed
(circuit-breaker-state)Get the current circuit breaker state. Public for monitoring/testing.
Get the current circuit breaker state. Public for monitoring/testing.
(current-buffer)Get current buffer name.
Get current buffer name.
(current-file)Get current file path, or nil if buffer is not visiting a file.
Get current file path, or nil if buffer is not visiting a file.
(emacs-running?)Check if Emacs server is running. Returns false on timeout.
Check if Emacs server is running. Returns false on timeout.
(eval-elisp code)Execute elisp code in running Emacs and return the result. Returns a map with :success, :result or :error keys. Includes timing information for observability. Enforces default-timeout-ms (clamped to max-timeout-ms) automatically.
Execute elisp code in running Emacs and return the result. Returns a map with :success, :result or :error keys. Includes timing information for observability. Enforces *default-timeout-ms* (clamped to *max-timeout-ms*) automatically.
(eval-elisp! code)Execute elisp and return result string, or throw on non-timeout error. On timeout, returns {:error :timeout :msg "..."} instead of throwing, so callers can degrade gracefully.
Execute elisp and return result string, or throw on non-timeout error.
On timeout, returns {:error :timeout :msg "..."} instead of throwing,
so callers can degrade gracefully.(eval-elisp-with-timeout code)(eval-elisp-with-timeout code timeout-ms)Execute elisp code with a timeout. Returns immediately if the operation takes longer than timeout-ms milliseconds. Clamps timeout-ms to max-timeout-ms (30s) as a hard ceiling.
CIRCUIT BREAKER GUARD: Checks breaker state BEFORE spawning any process. When breaker is :open and backoff hasn't elapsed, returns a sentinel failure immediately — no future, no sh process, no resource consumption.
IEmacsDaemon integration: On daemon death detection (matching daemon-dead-patterns), reports the error to the daemon store for lifecycle tracking.
Returns a map with :success, :result or :error keys. On timeout, returns {:success false :error "Timeout..." :timed-out true} On circuit-open, returns {:success false :error "Circuit breaker open..." :circuit-open true}
Execute elisp code with a timeout. Returns immediately if the operation
takes longer than timeout-ms milliseconds.
Clamps timeout-ms to *max-timeout-ms* (30s) as a hard ceiling.
CIRCUIT BREAKER GUARD: Checks breaker state BEFORE spawning any process.
When breaker is :open and backoff hasn't elapsed, returns a sentinel
failure immediately — no future, no sh process, no resource consumption.
IEmacsDaemon integration: On daemon death detection (matching daemon-dead-patterns),
reports the error to the daemon store for lifecycle tracking.
Returns a map with :success, :result or :error keys.
On timeout, returns {:success false :error "Timeout..." :timed-out true}
On circuit-open, returns {:success false :error "Circuit breaker open..." :circuit-open true}(executor-stats)Return bounded emacsclient pool stats, or nil before first use.
Return bounded emacsclient pool stats, or nil before first use.
(goto-line line-number)Go to a specific line number.
Go to a specific line number.
Initial backoff duration when circuit opens. Doubles on each failure.
Initial backoff duration when circuit opens. Doubles on each failure.
Maximum backoff duration. Caps exponential growth.
Maximum backoff duration. Caps exponential growth.
(project-root)Get the current project root.
Get the current project root.
(recent-files)Get list of recent files.
Get list of recent files.
(reset-circuit-breaker!)Reset the circuit breaker to :closed state. For testing/manual recovery.
Reset the circuit breaker to :closed state. For testing/manual recovery.
(shutdown-executor!)Stop and forget the bounded emacsclient pool. Idempotent.
Stop and forget the bounded emacsclient pool. Idempotent.
(switch-to-buffer buffer-name)Switch to a buffer by name.
Switch to a buffer by name.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |