Every form at a glance

Every form and procedure a plugin author or a user writes, with its closest Emacs equivalent. Each name links to its entry, which shows both side by side and says where Tuna differs.

The core

TunaIn one lineClosest in Emacs
pluginThe one form in plugin.ss; its body runs top to bottom when the plugin turns on.a package file with provide
exportThe plugin’s interface when it has no contract.ss.the pkg--private naming convention
contractThe one form in contract.ss: an interface others import or implement.a function variable such as completing-read-function
import, c:xMakes a contract’s names usable as c:x; checked at build.require
implementsThis plugin stands in for a contract; checked at build and load.setting completing-read-function
includeReads another file of the plugin’s folder in place.load
provided?Whether a contract you can do without is running.featurep
plugin-fileThe path of a file in the plugin’s folder.load-file-name
define-syntax, define-record-typeOrdinary Chez forms, with two rules.defmacro, cl-defstruct
define-savedOne piece of the user’s data, checked and saved.defvar plus savehist
set! on saved dataReplaces the value; saved after the command.setq
restore-saved!Brings back saved data that was set aside.none
list-of, pair-of, maybeBuild checks for plain data.defcustom’s :type
map-ofA check for a persistent map, applied to changed entries only.:type '(alist …)
define-plain-recordA fixed shape of plain data, never changed in place.cl-defstruct
pmap and friendsThe persistent map.hash tables, alists
new-idA fresh id, never given twice.buffer objects
define-optionA setting with a default and a check.defcustom
set! on an optionAdds your layer; the newest wins.setopt
set-local!Your layer, in the current buffer only.setq-local
options in use-plugin(use-plugin undo limit: 5000): a layer owned by that line.use-package :custom
define-dynamicA value each command sees its own binding of.defvar (a special variable)
dynamic-letBinds dynamic values for a body.let of a special variable
define-hookA list of procedures others add to.defvar of a hook
add-hook!Adds your entry, optionally named, ordered or scoped.add-hook
remove-hook!Removes your entry, or hides another’s.remove-hook
run-hookCalls every entry that applies.run-hook-with-args
run-hook-until-failureCalls entries until one returns #f.run-hook-with-args-until-failure
frame-hookRun when a frame is due.pre-redisplay-functions
define-tableFor providers: named entries, each owned.a keymap variable
table-set!, table-remove!For providers: add, replace or hide an entry.define-key
table-refThe winning entry for a key.lookup-key
table-valuesEvery owner’s value for a key.overlays-in
table-entriesAll winning entries, in a stable order.iterating a hook
table-clear!The definer removes every owner’s entry for a key.what kill-buffer does to overlays
table-callCalls one entry’s procedure as its owner’s code.call-interactively
as-callerA verb’s entries become its caller’s.none
on-endRuns when this run ends.FEATURE-unload-hook, kill-emacs-hook
run-endingWhy the run is ending.none
on-caller-endA provider ties a thing it made to its caller.none
forget-caller-endDrops that tie.none
run-with-timerA timer, owned by the run.run-with-timer
run-with-idle-timerA timer that fires after idle time.run-with-idle-timer
cancel-timer!Stops a timer.cancel-timer
define-workerHeavy work, compiled apart from the plugin.a subprocess program
start-jobRuns a worker on its own thread; for: replaces an older job.make-process
postIn a worker: hands one result back, in order.printing to the pipe
next-inputIn a worker: waits for a value from job-send!.reading standard input
sleepIn a worker: sleeps, waking if cancelled.sleep-for
job-send!Sends a running job more input.process-send-string
stop-job!Cancels a job.delete-process
suspendPauses a command until resumed.recursive-edit
request-quit! and quitWhat C-g does; how code sees a quit.keyboard-quit, quit signal
spawn-task!Runs a procedure soon as a task.run-at-time 0

The user’s side

TunaIn one lineClosest in Emacs
init.ss, use-pluginChooses the running plugins and their options.init.el, require, use-package
defaults.ss proposedThe default plugins in one line.built in
p::xReaching a plugin’s private name on purpose.pkg--x
redefineReplaces a function, as a layer.defun
advice-add, advice-removeWraps a function, as a layer.advice-add
M-:Evaluates in your session.eval-expression
C-M-xEvaluates one definition inside a plugin.eval-defun
reload-configApplies only what changed in init.ss.load-file of init.el
turn off, reload, swapCommands that change a plugin’s state.unload-feature, load-file
ending the sessionUndoes everything done in M-:.none
describeWho owns what.describe-variable
tuna checkChecks init.ss without running it.byte-compiling init.el

Verbs plugins offer

TunaIn one lineClosest in Emacs
commands:defineDefines a command.defun with interactive
commands:run!Runs a command by name.call-interactively
keys:bind!, keys:unbind!A binding, global or in a mode.keymap-set, keymap-global-set
modes:define-major, modes:define-minorDeclares a mode.define-derived-mode, define-minor-mode
modes:set-major! and friendsA buffer’s modes.calling the mode function
modes:set!An option’s value in every buffer of a mode.setq-local in a mode hook
faces:define, faces:set!Faces and themes.defface, set-face-attribute
buffers:current, buffers:withThe current buffer.current-buffer, with-current-buffer
buffers:insert! and textText in the current buffer.insert, erase-buffer, goto-char
buffers:create, buffers:viewThe user’s buffer; the caller’s view.get-buffer-create
buffers:list, buffers:kill! …A buffer as a whole.buffer-list, kill-buffer
buffers:set-faces!, buffers:set-margin!Your faces and margin marks on a buffer.overlays
buffers:after-change-hook …The buffers’ hooks.after-change-functions
display:add-mode-line!, display:show-popup!What is drawn.mode-line-misc-info, a tooltip
layout:show!Shows a buffer in a window.pop-to-buffer
processes:start!, processes:start-ownThe user’s process; the caller’s own.make-process
processes:follow!, processes:send!Output once, in order; input.a process filter, process-send-string
list-processesEvery running process.list-processes
minibuffer:read-string and promptsAsk the user.read-string, yes-or-no-p, completing-read