Liking cljdoc? Tell your friends :D

hive-emacs.client

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.
raw docstring

*circuit-breaker-cooldown-ms*clj

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.
sourceraw docstring

*default-timeout-ms*clj

Default timeout for emacsclient calls in milliseconds.

Default timeout for emacsclient calls in milliseconds.
sourceraw docstring

*emacs-socket-name*clj

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).
sourceraw docstring

*emacsclient-path*clj

Path to emacsclient binary. Resolved via hive-emacs.config (env EMACSCLIENT).

Path to emacsclient binary. Resolved via hive-emacs.config (env EMACSCLIENT).
sourceraw docstring

*max-timeout-ms*clj

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.
sourceraw docstring

buffer-contentclj

(buffer-content buffer-name)

Get content of a buffer by name.

Get content of a buffer by name.
sourceraw docstring

buffer-listclj

(buffer-list)

Get list of buffer names.

Get list of buffer names.
sourceraw docstring

circuit-breakerclj

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
sourceraw docstring

circuit-breaker-stateclj

(circuit-breaker-state)

Get the current circuit breaker state. Public for monitoring/testing.

Get the current circuit breaker state. Public for monitoring/testing.
sourceraw docstring

current-bufferclj

(current-buffer)

Get current buffer name.

Get current buffer name.
sourceraw docstring

current-fileclj

(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.
sourceraw docstring

emacs-running?clj

(emacs-running?)

Check if Emacs server is running. Returns false on timeout.

Check if Emacs server is running. Returns false on timeout.
sourceraw docstring

eval-elispclj

(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.
sourceraw docstring

eval-elisp!clj

(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.
sourceraw docstring

eval-elisp-with-timeoutclj

(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}
sourceraw docstring

executor-statsclj

(executor-stats)

Return bounded emacsclient pool stats, or nil before first use.

Return bounded emacsclient pool stats, or nil before first use.
sourceraw docstring

find-fileclj

(find-file file-path)

Open a file in Emacs.

Open a file in Emacs.
sourceraw docstring

goto-lineclj

(goto-line line-number)

Go to a specific line number.

Go to a specific line number.
sourceraw docstring

initial-backoff-msclj

Initial backoff duration when circuit opens. Doubles on each failure.

Initial backoff duration when circuit opens. Doubles on each failure.
sourceraw docstring

insert-textclj

(insert-text text)

Insert text at point.

Insert text at point.
sourceraw docstring

max-backoff-msclj

Maximum backoff duration. Caps exponential growth.

Maximum backoff duration. Caps exponential growth.
sourceraw docstring

project-rootclj

(project-root)

Get the current project root.

Get the current project root.
sourceraw docstring

recent-filesclj

(recent-files)

Get list of recent files.

Get list of recent files.
sourceraw docstring

reset-circuit-breaker!clj

(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.
sourceraw docstring

save-bufferclj

(save-buffer)

Save the current buffer.

Save the current buffer.
sourceraw docstring

shutdown-executor!clj

(shutdown-executor!)

Stop and forget the bounded emacsclient pool. Idempotent.

Stop and forget the bounded emacsclient pool. Idempotent.
sourceraw docstring

switch-to-bufferclj

(switch-to-buffer buffer-name)

Switch to a buffer by name.

Switch to a buffer by name.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close