Fact-checked by Grok 2 weeks ago

Emacs Lisp

Emacs Lisp is a dialect of the programming language designed primarily as the extension and customization language for the text editor, in which most of the editor's functionality is implemented. It provides a full-featured programming environment tightly integrated with Emacs's editing capabilities, enabling users to automate tasks, create new commands, and modify the editor's behavior through scripts and extensions. The language originated from the broader Lisp family, which was developed in the late 1950s at the (MIT) for research and later adapted for applications like text editing due to its expressive list-processing capabilities. Emacs itself began in 1976 as a set of macros for the TECO editor on MIT's Incompatible Timesharing System (ITS), but the integration of Lisp came later, inspired by Bernie Greenberg's Emacs in the 1970s, which used Maclisp to represent editor commands as Lisp functions for greater extensibility. , drawing from this model, incorporated a Lisp interpreter into his version of Emacs during the early 1980s as part of the Project, replacing earlier mock Lisp implementations and evolving it into a robust dialect tailored for Emacs. GNU Emacs Lisp is largely inspired by Maclisp from the 1960s at MIT's Project MAC and partially by , standardized in the 1980s, though it simplifies many features to optimize for memory efficiency in an editor context. Key characteristics of Emacs Lisp include its dynamic typing, where variables do not require type declarations and objects carry their own type information, and its homoiconic nature, treating code as data structures—primarily lists enclosed in parentheses. It supports standard Lisp elements like symbols, numbers (including fixnums for small integers and bignums for arbitrary precision), strings with text properties for rich formatting, and cells for building lists and trees. Unique to its integration are specialized data types and functions for handling buffers (text containers), windows (display regions), markers (positions in text), overlays (temporary annotations), and subprocesses, facilitating advanced text scanning, , and . The language uses an interpreter embedded in , allowing real-time evaluation and debugging, and features like lexical binding (introduced in later versions for better scope control) and the cl-lib library for emulating constructs. Emacs Lisp's design emphasizes simplicity and power for non-programmers while serving professional developers, with official documentation including the GNU Emacs Lisp Reference Manual (for version 30.2) and introductory texts like "An Introduction to Programming in Emacs Lisp." It remains actively maintained as part of , supporting modern standards such as floating-point arithmetic and multibyte character handling for international text.

Overview

Definition and Purpose

Emacs Lisp, often abbreviated as Elisp, is a dialect of the Lisp programming language that employs dynamic scoping and is primarily derived from Maclisp, with additional influences from Common Lisp. Designed specifically for the Emacs text editor, it serves as an extension language optimized for scripting tasks that interact closely with the editor's environment, such as manipulating text buffers and handling user input in real time. The primary purpose of Emacs Lisp is to empower users and developers to extend and customize through the creation of new functions, macros, and packages. This includes defining major and minor modes for specialized editing (e.g., for programming languages or document formats), configuring keybindings to streamline workflows, and modifying elements like menus and toolbars. By allowing such programmatic modifications without recompiling the core editor, Emacs Lisp transforms from a static into a highly adaptable platform for and . Emacs Lisp traces its roots to the foundational language, invented by John McCarthy in 1958 as a tool for research, but it has been adapted to support interactive, editor-centric programming that emphasizes and user-driven enhancements. This adaptation prioritizes seamless integration with ' runtime, enabling code to execute within the editor's session for immediate feedback. Distinctive features of Emacs Lisp include its garbage collection mechanism, which is tightly coupled with Emacs' overall memory management, including the handling of objects to prevent disruptions during sessions. Additionally, it supports the creation of interactive functions through the interactive declaration, which specifies how arguments are gathered from user input, such as keystrokes or mouse events, making it straightforward to define commands callable via keyboard shortcuts.

Integration with Emacs

Emacs Lisp serves as the primary extension and customization language for the GNU editor, with the editor's core implemented in C but nearly all higher-level functionality defined in Emacs Lisp itself. This architecture positions Emacs as a "Lisp machine," where users can extend and modify the editor's behavior entirely through code, enabling dynamic self-modification during runtime. For instance, editing commands are Lisp functions that can be redefined or advised , allowing seamless of new features without recompiling the C core. At startup, Emacs loads user-specific code from initialization files such as .emacs or init.el (typically located in the 's or ~/.emacs.d/), which configure settings, define custom functions, and load additional libraries. This process supports event-driven extensions via hooks—lists of functions executed in response to specific events, such as modifications (e.g., after-change-functions)—enabling modular responses to user actions like text insertion or changes. Furthermore, the built-in package facilitates modular extensions by allowing users to install and manage third-party libraries from archives like ELPA, promoting a vast ecosystem of reusable code without manual intervention. Interactive development is a cornerstone of Emacs Lisp integration, permitting real-time evaluation and directly within the editor. Users can evaluate expressions interactively using M-: (bound to eval-expression), which prompts for code in the minibuffer and displays results immediately, or via eval-print-last-sexp (bound to C-j in Interaction mode buffers like *scratch*) to insert evaluated values into the buffer. For , the edebug facility provides source-level stepping, breakpoints, tracing, and backtrace inspection, allowing developers to instrument functions with edebug-defun and step through execution while viewing variable states. Lisp became the primary extension language for in 1985, replacing earlier limited dialects such as Mocklisp. Since the release of 19 in 1992, it has incorporated enhancements from variants like Lucid , including early support for lexical scoping. Performance considerations arise from Emacs Lisp's interpreted nature, which handles real-time editing tasks like command execution and logic, but relies on C-implemented for speed-critical operations such as display rendering and low-level manipulation. These , defined using macros like DEFUN in C source files, expose efficient functions (e.g., for window coordinate calculations) to code via defsubr, ensuring responsive without sacrificing extensibility. This hybrid model balances Lisp's flexibility with C's efficiency, supporting Emacs's role as an interactive, programmable environment.

History

Origins in the 1970s

The origins of Emacs Lisp trace back to the innovative Emacs editors developed in the 1970s at MIT's AI Lab and related projects, where Lisp's extensibility proved ideal for building customizable text editors. In 1978, Bernard Greenberg implemented Multics Emacs in Maclisp, a dialect of Lisp from MIT, demonstrating how Lisp could enable non-programmers, such as secretaries, to extend the editor through simple macros without needing to recompile the core system. This approach highlighted Lisp's power for rapid prototyping and user-driven customization, influencing later designs. Richard Stallman, who had earlier created the original TECO-based Emacs in 1976, drew from these 1970s experiences when seeking a more powerful extension language. Building on this foundation, Emacs Lisp emerged in the early 1980s as part of the GNU project. In 1981, James Gosling developed a C-based Emacs for Unix systems, incorporating Mocklisp—a limited dialect with Lisp-like syntax but lacking full Lisp semantics—as its extension language. Stallman forked this implementation in 1984 to create GNU Emacs, replacing Mocklisp with a true Lisp interpreter to achieve greater expressiveness and portability. Emacs Lisp was specifically designed by Stallman to inherit key features from Maclisp, including s-expressions for code representation, dynamic scoping for variable binding, and list-processing primitives like car and cdr, which facilitated seamless manipulation of editor buffers as Lisp data structures. These choices reflected Maclisp's influence from the 1960s and 1970s, prioritizing simplicity and interactivity for an extensible editor. A pivotal goal in Emacs Lisp's design was to enable users to modify and extend on-the-fly without recompiling, allowing immediate testing of changes during editing sessions—a direct evolution from the 1970s Emacs experiments. This user-centric extensibility was realized in the first public release (version 13) on March 20, 1985, which fully integrated Emacs Lisp as the primary extension language, supplanting the cumbersome TECO macros of earlier versions. However, the early language had notable limitations: it relied exclusively on dynamic scoping, with no support for lexical scoping until much later, and depended on dynamic variables to manage global state, which could lead to unpredictable interactions in complex extensions. These foundational constraints kept the 1985 implementation compact, fitting on machines with 1 MB of memory lacking support.

Key Developments and Versions

Emacs Lisp underwent significant standardization with the release of 19 in , which established a more consistent language specification and integrated features that became foundational for subsequent development, including enhanced support for buffers, windows, and editor customization. This version marked a pivotal point in making Emacs Lisp a robust extension language tightly coupled with the Emacs editor's architecture. A major advancement came in Emacs 24, released in 2012, which introduced lexical scoping as an option via the lexical-binding file-local variable, allowing developers to opt into lexical binding for better performance and predictability while maintaining compatibility with dynamic scoping. Alongside this, Emacs 24 debuted the , a built-in that simplified the discovery, installation, and distribution of libraries from the official repository at elpa.gnu.org, revolutionizing how users extended functionality. The community responded with MELPA, launched shortly thereafter as an open-source extension to ELPA, providing automated builds and a broader selection of packages from upstream sources to accelerate package development and adoption. Performance optimizations in the Emacs Lisp interpreter progressed with Emacs 22 in 2007, which included bytecode compiler enhancements that improved execution speed for interpreted code through better optimization passes and reduced overhead in the virtual machine. These were further advanced in Emacs 28 (2022), where experimental native compilation of Lisp bytecode to machine code was introduced, enabling just-in-time compilation for substantial speedups in package loading and runtime execution, though it required additional build dependencies like libgccjit. This feature became enabled by default in Emacs 30.1, released on February 23, 2025, providing significant performance gains for Lisp code execution without additional configuration. Emacs 27, released in 2020, added native parsing support via the Jansson library (configurable at build time), providing dramatically faster and deserialization compared to prior pure-Lisp implementations, which proved essential for modern web APIs and configuration handling. It also enhanced asynchronous programming with improved primitives and non-blocking I/O operations, facilitating more responsive extensions for tasks like network requests and background processing. More recently, Emacs 29 (2023) integrated the Tree-sitter parsing library, enabling incremental syntax parsing for programming languages directly in Lisp code, which supports advanced features like precise , indentation, and navigation in major modes such as c-ts-mode and python-ts-mode. Emacs 30.2, a maintenance release, followed on August 14, 2025, with further refinements to these capabilities. Throughout its evolution, Emacs Lisp has prioritized backward compatibility, ensuring that code written decades ago remains functional in modern versions, which has fostered an ecosystem of over 40 years' worth of accumulated libraries and customizations without requiring widespread rewrites.

Core Language Features

Data Types and Structures

Emacs Lisp features a set of primitive data types that form the foundation for all objects in the system, each belonging to exactly one type. These include atomic types such as integers, floating-point numbers, characters, symbols, and strings, which represent basic values without internal structure. Symbols are atomic objects consisting of a name (a sequence of characters) and are automatically interned in an obarray, ensuring that symbols with the same name are the same object. Each symbol maintains a (plist), a list of property-value pairs used to associate like strings or definitions with the symbol. When evaluated, a symbol returns the value stored in its value cell or signals a void-variable error if unbound. Numbers in Emacs Lisp include fixnums (small integers with a platform-dependent range, typically 30 bits on 32-bit systems), bignums (arbitrary-precision integers introduced in Emacs 25.1), and floats (double-precision floating-point numbers with potential rounding in computations). Strings are mutable s of characters, allowing in-place modifications, and can carry text properties—key-value pairs that attach attributes like font faces or hyperlinks to specific character ranges. Vectors are mutable s of fixed , providing array-like with functions such as aref and aset. The core data structure in Emacs Lisp is the cons cell, a fundamental pair that holds two Lisp objects: the car (contents of the address and register) and the cdr (contents of the decrement register). Lists are constructed as chains of cons cells, where the car holds an element and the cdr points to the next cons or nil, enabling efficient sharing of structure and operations like insertion without full copies. Access and manipulation use functions like car and cdr, with derived accessors such as cadr for the second element. While general lists hold any objects, Emacs Lisp includes specialized data types for editor-specific purposes, such as buffers (containers for text content), windows (display regions), and frames (top-level graphical containers). Emacs-specific data types extend the primitives to support text editing and interface features. Buffers serve as containers for editable text, each with a unique name and gap-based storage for efficient insertions. Markers represent positions within buffers, automatically adjusting when text is inserted or deleted. Overlays apply attributes (such as faces or modifications) to non-contiguous text ranges without altering the buffer content. Hooks are simply lists of functions invoked sequentially in response to events, like buffer modifications. Emacs Lisp lacks a dedicated boolean type; instead, nil represents false, while any non-nil value (t or otherwise) is true, following the convention where symbols and other objects evaluate to true in conditional contexts. Equality is tested using predicates like eq, which checks for object identity (the same memory location), returning true for identical symbols or fixnums with the same value but false for equal contents in lists or strings. In contrast, equal performs structural comparison, recursively verifying contents for sequences like lists and vectors, and using value equality for numbers while ignoring text properties in strings.

Control Flow and Functions

Emacs Lisp provides a variety of constructs for defining and invoking functions, enabling both named and procedures. Named functions are defined using the defun special form, which associates a with a containing the function's argument list, optional documentation string, declarations, interactive specification, and body forms. The argument list supports fixed parameters as well as optional and arguments via &optional and &rest keywords, allowing flexible without mandatory strict checking for every call—errors occur only if the provided arguments mismatch the declared structure. For example, a function defined as (defun example (required &optional optional &rest rest)) can accept varying numbers of arguments, with optional defaulting to nil if omitted and rest collecting extras as a . Anonymous functions, or lambdas, are created directly with the lambda special form, producing a that can be applied immediately or stored for later use. A follows the same structure as defun but lacks a name, such as (lambda (x) (+ x 1)), which increments its argument. These are integral to higher-order programming and can be passed as arguments to other functions. in lambdas mirrors that of named functions, with optional enforcement based on the argument list. Conditional expressions in Emacs Lisp facilitate decision-making based on predicate evaluations. The if special form evaluates a condition and executes either the then-branch or else-branch accordingly, returning the value of the last form in the chosen branch or nil if none. More complex branching uses cond, which sequentially tests clauses until a non-nil condition is found, then evaluates its body; a default clause begins with t for unconditional execution. Macros when and unless provide concise variants: when executes forms if the condition is true (equivalent to if without an else), while unless does so if false. Since Emacs 24.1, the pcase macro extends conditionals with , allowing clauses to match against structured data like lists or symbols, akin to a generalized cond for non-numeric cases. For instance, (pcase expr ((list 'foo x) x) (_ nil)) extracts x if expr is (foo value). Iteration in Emacs Lisp relies on macros and special forms for repetition, alongside recursion inherited from Lisp traditions. The while special form repeatedly evaluates its body while a condition holds true, returning nil upon exit, as in looping until a counter reaches a limit. List iteration uses dolist, which binds a variable to each element of a list in order and executes the body, optionally returning a final value. When building a new list by consing, the result is typically reversed (e.g., using nreverse) to preserve the original order. For numeric counts, dotimes iterates a variable from 0 up to but excluding a count, suitable for fixed repetitions like inserting text multiple times. Recursion is prevalent for tree-like or functional traversals, but Emacs Lisp lacks full tail-call optimization; however, since Emacs 28.1, cl-labels supports optimized tail calls for recursive calls to its locally defined functions in tail positions, preventing stack overflow in those cases, though general tail-call optimization across functions is not supported. Higher-order functions enable treating procedures as first-class citizens, promoting functional styles. mapcar applies a function to each element of a list (or sequence), returning a new list of results, such as (mapcar #'1+ '(1 2 3)) yielding (2 3 4). funcall invokes a function with individual arguments, while apply does so with a list as the final arguments, allowing dynamic calls like (apply '+ (list 1 2 3)). These facilitate composition without explicit loops. Functions intended as user commands include an interactive form in their body to specify how arguments are read from input, such as (interactive "sPrompt: ") for a query; this form is ignored during non-interactive evaluation but enables keybinding and integration. The advice system allows non-destructive modification of existing s via advice-add, which inserts before, after, or around code (e.g., :filter-return to alter outputs), or more generally with add-function for variables holding values, supporting tracing or extension without redefinition.

Scoping and Evaluation

Dynamic vs. Lexical Scoping

Emacs Lisp traditionally employs dynamic scoping, where variable are resolved at runtime by searching the call stack for the most recent of the symbol. This means that a let affects not only the body of the let but also any called from within it, potentially allowing outer to access or modify inner in unexpected ways. For instance, if a foo calls bar inside a let that binds x to 10, bar will see x as 10 even if bar is defined elsewhere, which can lead to subtle bugs in larger codebases due to this non-local visibility. In contrast, lexical scoping was introduced in Emacs 24.1 in 2012 to provide static binding, where variable resolution is determined by the textual structure of the code at compile or evaluation time, capturing values in closures for better predictability and performance. Lexical binding is enabled on a per-file basis by adding the file-local variable lexical-binding: t in the header comment, such as ;;; -*- lexical-binding: t -*-; when active, let bindings are confined to their , preventing access from called functions unless explicitly captured. This mode uses mechanisms to retain bindings beyond their initial , aligning Emacs Lisp more closely with dialects like and , and enabling optimizations like avoiding runtime stack searches. To facilitate the transition, global variables intended for dynamic binding should be declared with defvar, which marks them as and ensures they are not treated as lexical, while defconst declares constants that remain dynamically bound. Under lexical binding, let behaves as a true lexical construct, but special forms like special-variable-p can identify dynamically bound variables, and functions such as symbol-value access only dynamic bindings. For , the default remains dynamic scoping, as changing it globally would break existing packages; however, since Emacs 30.1 (2025), the byte-compiler warns if no lexical-binding declaration is present, encouraging the adoption of lexical binding. Prior to native lexical binding, macros like lexical-let from the cl library provided a partial in older code. Dynamic scoping simplifies quick scripting and interactive by allowing flexible sharing without explicit passing, but it often introduces hard-to-debug issues from unintended interactions. Lexical scoping enhances , reduces such bugs, and improves performance through compile-time analysis and efficient implementation, making it preferable for modern, library-compatible code despite the need for careful handling of dynamic globals.

Evaluation Model

The evaluation of Emacs Lisp expressions is performed by the Lisp interpreter, which receives a Lisp object as input and computes its value according to the object's type and form. This process follows a read-eval-print loop (REPL), where the read function parses input into s-expressions, the eval function executes the expression in the current and returns its result, and the print function outputs the value, typically to the echo area or a buffer. At the top level, entire buffers can be evaluated using eval-buffer, which applies eval to each form in sequence. Self-evaluating forms, such as numbers and strings, return themselves without further computation; for example, evaluating 42 yields 42, and "hello" yields "hello". Symbols, however, are evaluated by looking up their bound values in the current environment; if unbound, an error is signaled. Quoted expressions, produced by the special form quote, also self-evaluate to the unevaluated form itself, preventing recursive evaluation—for instance, (quote (a b)) or '(a b) returns the list (a b). Lists are evaluated differently depending on their structure: if the first element is a function (symbol or lambda), it is applied to the evaluated arguments; special forms like if and lambda bypass full argument evaluation to enable conditional execution or function creation. For example, (if (> 3 2) 'yes 'no) evaluates to yes because the predicate t selects the then-branch, while only the selected branch is evaluated. Similarly, (lambda (x) (* x x)) returns an anonymous function without evaluating its body immediately. The evaluation environment consists of a global namespace managed through obarrays, which are hash tables interning symbols by name to ensure uniqueness; the standard obarray variable holds symbols accessible throughout Emacs. Variable bindings use dynamic scoping by default, where values are stored in symbol value cells and resolved via a stack of frames pushed during function calls and bindings like let, allowing outer bindings to be shadowed temporarily. Lexical scoping can be enabled explicitly via the lexical argument to eval or binding lexical-binding to t. Errors during evaluation are handled through the condition-case special form, which wraps a protected form and catches signals matching specified conditions, functioning as a try-catch mechanism. For example, (condition-case err (/ 1 0) (arith-error (message "Division error: %s" ([error](/page/Error)-message-string err)) 0)) catches arithmetic and returns 0 instead of terminating. The error function signals a generic , passing a symbol and to propagate up the call until caught or reaching the editor loop. Emacs Lisp's homoiconicity, where code is represented as data structures (s-expressions), allows expressions to be manipulated and generated at runtime, facilitating powerful techniques such as macros.

Syntax and Parsing

S-Expressions and Reader

In Emacs Lisp, S-expressions serve as the primary textual representation for both program code and data structures, enabling a unified syntax for writing and reading Lisp objects. These expressions are either atomic, such as symbols (sequences of characters representing identifiers) or numbers (integers, floats, or other numeric literals), or compound, consisting of lists delimited by parentheses that group elements together. This structure inherently uses prefix notation, positioning the or name before its operands within the parenthesized form. The reader, primarily through the read, processes input strings or streams to convert textual s into internal objects, following a defined read syntax that ensures unambiguous . This reads one complete from the input, handling whitespace as a separator between elements while ignoring it within certain constructs like symbols. The read syntax is designed to be reversible in many cases, allowing printed representations to be accurately re-parsed into the original objects, though some specialized objects use non-readable notations. Quoting mechanisms integrated into the reader prevent immediate evaluation of forms during parsing. The single quote prefix ' creates a quoted list that represents the literal structure without evaluating its contents, while the backquote ` introduces quasi-quoting for templating, permitting partial evaluation of subexpressions via the comma , unquote operator or comma-at ,@ for splicing lists. These features allow the reader to produce unevaluated lists suitable for later manipulation or macro expansion. Character syntax governs how the reader interprets input sequences, with specific delimiters enforcing structural boundaries: parentheses () enclose lists and denote nesting, double quotes "" bound strings (which may contain escaped content), and other characters like semicolons initiate comments that are skipped until newline. The backslash \ acts as a general , allowing literal inclusion of delimiters or special characters within strings, symbols, or character literals (e.g., ?\" for a quote mark). Symbols prefixed with #: are treated as uninterned, meaning they are not registered in the global obarray and thus avoid name conflicts in dynamic environments. For generating readable textual output from objects, Emacs Lisp provides pretty-printing via the pp function, which formats S-expressions with indentation and line breaks to reflect their hierarchical structure, improving human comprehension over compact printing. Standard indentation conventions align subexpressions under their enclosing forms, typically using two spaces per nesting level, though this can be adjusted for stylistic preferences. The reader incorporates special read syntax through hash-mark notations (e.g., #<...> for buffers or markers lacking standard read forms), extending its ability to handle Emacs-specific objects. While the read syntax supports these built-in extensions, Emacs Lisp's reader is less flexible for customization compared to , where dynamic read tables allow extensive modification of parsing rules; in Emacs Lisp, such alterations are rarely employed and typically require workarounds via the Common Lisp emulation library.

Macros and Quoting

In Emacs Lisp, quoting mechanisms allow programmers to treat Lisp expressions as literal data rather than code to be evaluated, forming the foundation for . The quote special form prevents the of its argument, returning the unevaluated form itself. For instance, (quote (a b c)) or its shorthand '(a b c) yields the list (a b c) consisting of three symbols, without attempting to evaluate them as function calls or variables. This is essential for constructing data structures programmatically, such as lists of symbols, where evaluation would otherwise occur during normal Lisp interpretation. Numbers, strings, and certain constants like t and nil are self-quoting and evaluate to themselves without needing quote, but symbols and lists require it to avoid unintended evaluation. As of Emacs 30.1, the byte compiler warns about quoted symbols used as error names in condition-case and ignore-errors to encourage more robust error handling. The backquote, denoted by `, extends quoting by enabling templating of lists with selective evaluation, making it a powerful tool for code generation. A backquoted form like `(a b c) behaves identically to '(a b c), quoting the entire structure. However, the unquote operator , inserts the result of evaluating an expression into the template; for example, `(a ,(+ 1 2) c) expands to (a 3 c). The splicing unquote ,@ inserts the elements of an evaluated list at the current level, such as `(a ,@'(b c) d) yielding (a b c d). These features allow concise construction of complex expressions, like function calls with dynamic arguments, while subexpressions without unquote remain quoted and immutable. Backquote differs from plain quote by supporting these insertion mechanisms, though it shares the same read-time processing. Macros in Emacs Lisp facilitate metaprogramming by transforming unevaluated code into new expressions at read or compile time, rather than runtime, enabling the definition of custom language constructs. The defmacro special form defines a macro, with syntax (defmacro name arglist [doc-string] body...), where arglist can include &rest to capture variable arguments as a list, and body computes and returns the expansion form using the unevaluated arguments. For example, a simple swap macro might be (defmacro swap (a b) (let ((tmp ,a)) (setq ,a ,b ,b tmp))), which expands to code swapping the values of aandb. The expansion replaces the macro call before further evaluation, allowing macros to introduce new control structures or abstractions. As of Emacs 30.1, the returned value from defmacro(and related forms likedefun) is no longer interpreted as a docstring but as a plain return value. Emacs 30.1 also introduced the built-in static-if` macro, which conditionally includes forms at compile time based on a constant expression, aiding in conditional code generation without runtime overhead. Macro hygiene in Emacs Lisp is achieved explicitly, without automatic renaming as in Common Lisp, requiring programmers to use gensym to generate unique symbols that avoid variable capture during expansion. For instance, in a macro defining a temporary variable, (gensym) produces a symbol like #:G7153, ensuring it does not conflict with user variables in the surrounding scope. The macroexpand function aids debugging by fully expanding a macro form, such as (macroexpand '(when condition body)), revealing the underlying if expression. Common patterns include using defmacro to create domain-specific languages, like the defun* macro from the Common Lisp extensions package, which extends defun with features such as optional destructuring in older Emacs codebases. Emacs Lisp imposes limitations on macro facilities compared to other Lisp dialects: it lacks support for reader macros by default, preventing custom syntax extensions at the reader level, and relies on manual hygiene practices rather than built-in mechanisms. These constraints stem from design choices prioritizing simplicity and compatibility with Emacs's editor integration, though extensions like the cl package provide some Common Lisp-like utilities.

Implementation Details

Interpreter Mechanics

The Emacs Lisp interpreter operates as a bytecode dispatcher implemented in C, executing instructions sequentially through a main loop that fetches opcodes and operands to manipulate the evaluation stack. This stack-based model uses a fixed-size stack typically allocated on the C stack for efficiency, supporting where operands precede operators. Local variables are managed via stack frames, with instructions like varref and varset accessing or modifying them relative to the current frame, enabling both dynamic and lexical scoping during . Garbage collection in Emacs Lisp employs a mark-and-sweep algorithm deeply integrated with the Emacs runtime environment, scanning such as the , global variables, and registers to identify live objects during evaluation. The mark phase traces reachable objects from these , while the sweep phase reclaims unused by adding freed cells to a free list, ensuring no memory leaks occur even in long-running evaluations. This conservative runs automatically when cell allocation exceeds the gc-cons-threshold, pausing execution briefly to protect the interpreter state. Variables in Emacs Lisp are stored using an obarray—a vector-based —for symbol interning and lookup by name, allowing efficient resolution of identifiers across the . Dynamic variables reside in a 's value cell, with bindings pushed onto a per-thread dynamic during , enabling runtime overrides without altering the global value. In lexical binding mode, closures encapsulate the surrounding environment, storing captured variables as an within the object to preserve lexical scope across function invocations. Core primitives such as car and cons are defined in C as functions like Fcar and Fcons, registered via the DEFUN macro and exposed to Lisp code for direct invocation, bridging the performance gap between Lisp expressions and low-level operations. For external integration, the foreign function interface relies on call-process to spawn subprocesses, capturing output synchronously or asynchronously without direct native library calls. Interpreted Emacs Lisp execution is significantly slower than equivalent C code—typically by one to two orders of magnitude—due to the overhead of bytecode dispatch and dynamic typing, though profiling tools like profiler-start help identify bottlenecks by measuring CPU and memory usage. The interpreter remains single-threaded by default to maintain simplicity and avoid synchronization issues, with asynchronous behavior achieved through timers via run-with-timer or external processes, features refined starting with Emacs 22.1 for better non-blocking I/O handling.

Bytecode and Compilation

Emacs Lisp supports bytecode compilation to improve execution efficiency over pure . The translates , written as s-expressions, into a compact representation that is executed by a dedicated interpreter. This is stored in files with the .elc extension, allowing for faster loading and compared to uncompiled .el files. The bytecode format consists of a vector containing a sequence of opcodes, along with a pooled constants vector for shared literals such as numbers, symbols, and strings to optimize space and access. Opcodes are numeric instructions that perform stack-based operations in reverse Polish notation; for example, byte-constant (opcodes 192-255) pushes a value from the constants pool onto the stack, byte-varref (opcodes 8-15) pushes the value of a variable, byte-dup (opcode 137) duplicates the top stack element, and byte-return (opcode 135) returns the top stack value as the function result. The compilation process is handled by the byte-compile-file function, which reads a source file and outputs the corresponding .elc file; alternatively, eval can compile and execute expressions inline without producing a file. Constants are pooled across the bytecode to reduce redundancy and improve efficiency. During execution, the bytecode interpreter, implemented in C, dispatches opcodes sequentially while managing an evaluation stack for operands and results, making it faster than direct s-expression evaluation by a factor of 2 to 5 times. Bytecode maintains forward compatibility with recent prior Emacs versions through versioning in the .elc file header, ensuring it can run on newer releases without recompilation. Decompilation is possible using the disassemble function, which outputs a human-readable listing of opcodes and constants for debugging or analysis. The bytecode compilation system, introduced in the mid-1980s, marked a significant optimization for Lisp evaluation in Emacs. While traditional bytecode remains the standard, native compilation—producing machine code from bytecode—became experimentally available in Emacs 28 (2022) and is now a stable feature for further performance gains on supported platforms. In Emacs 30.1 (2025), native compilation became enabled by default.

Comparison to Other Lisp Dialects

Similarities with Common Lisp

Emacs Lisp and share a common heritage rooted in the family of languages, particularly through influences from Maclisp, leading to numerous syntactic and structural parallels. Both dialects employ S-expressions as their primary and syntax, representing code and data uniformly as nested lists enclosed in parentheses. This enables prefix notation, where operators precede their arguments, as in the expression (cons 1 2) to create a cell. Fundamental list manipulation primitives, such as car for accessing the first element of and cons for constructing new lists, are identical in form and function, facilitating seamless conceptual transfer between the two. Both languages feature dynamic typing, where type checking occurs at runtime rather than , allowing flexible variable usage without explicit declarations. Evaluation models emphasize interactive development, with both supporting immediate execution of expressions in a read-eval-print loop (REPL) environment. Emacs Lisp's condition system, implemented via the condition-case special form, parallels 's handler-case mechanism for catching and handling errors or conditions, though in a simplified manner. This approach treats errors as continuable conditions, enabling recovery strategies similar to those in . Namespace management in Emacs Lisp draws from Lisp traditions exemplified in Common Lisp's package system, using obarrays—essentially symbol tables—to group symbols and avoid name conflicts, albeit in a more rudimentary way without full package separation. Emacs Lisp supports a paradigm akin to Common Lisp, including higher-order functions like mapcar for applying a to list elements and lexical closures (introduced with lexical binding in Emacs 24). These features promote composable, declarative code styles common to both dialects. Emacs Lisp's incorporates many concepts from early Lisp implementations that also shaped Common Lisp, such as sequence operations and symbol handling, but omits advanced elements like the Common Lisp Object System (CLOS).

Differences from Scheme

Emacs Lisp primarily employs dynamic scoping for variable bindings, where the value of a is determined by the most recent dynamic in the call stack at runtime, contrasting with 's strict lexical scoping, which resolves variables based on their textual position in the source code. Although Emacs Lisp introduced support for lexical scoping in version 24 via the lexical-binding , dynamic scoping remains the default to maintain compatibility with legacy code, whereas implementations adhere rigidly to lexical scoping as per the R5RS standard. In macro definition, Emacs Lisp uses defmacro, which produces unhygienic macros that can unintentionally capture identifiers from the surrounding scope, lacking the automatic hygiene provided by Scheme's define-syntax. Scheme's hygienic macros, defined using pattern-matching syntax-rules, preserve lexical scoping by renaming bound identifiers to avoid name clashes, a feature emphasized in R5RS to ensure . This difference makes Emacs Lisp macros more prone to subtle bugs in identifier resolution compared to Scheme's safer approach. Emacs Lisp includes editor-specific extensions absent in standard Scheme, such as buffer and window objects that represent textual and display contexts, along with hook mechanisms for event-driven customization. For instance, buffers hold editable text with associated , while windows manage viewport rendering, enabling direct manipulation of the Emacs interface—capabilities not part of Scheme's minimal core. Additionally, Emacs Lisp strings are mutable, allowing in-place modification via functions like aset, whereas Scheme's R5RS permits mutable strings but designates literal constants and certain derived strings as immutable, with implementations often favoring immutability for safety. The standard of Emacs Lisp incorporates numerous primitives tailored for text editing, such as forward-char for cursor movement and interactive specifications in command definitions, which integrate with 's command loop for user input handling. In contrast, R5RS maintains a minimalist without such editor-oriented features or built-in systems like Emacs Lisp's add-function for modifying function behavior, focusing instead on core language constructs. Emacs Lisp also lacks native support for multiple return values, with functions returning a single result unless extended by the compatibility , while provides values and call-with-values for returning and receiving multiple values directly. Regarding tail calls, neither language mandates optimization in its core, but Scheme's R5RS requires proper tail-recursive implementations to avoid , often encouraging for functional recursion. Emacs Lisp, however, does not guarantee tail call optimization and favors imperative constructs like while loops for iteration, reflecting its practical, editor-focused design over Scheme's functional purity. Overall, Emacs Lisp draws more closely from Maclisp's dynamic scoping and feature-rich environment than from R5RS Scheme's compact, lexically scoped minimalism, prioritizing extensibility for customization over general-purpose purity.

Practical Usage

Basic Examples

Emacs Lisp provides an interactive environment for experimenting with code directly within the editor, particularly in the *scratch* buffer, which operates in Lisp Interaction mode. To evaluate expressions, users type them into this buffer and press C-x C-e (bound to eval-last-sexp), which executes the form preceding the cursor and displays the result in the echo area; for printed output, C-u C-x C-e inserts the value into the buffer as well. This setup allows immediate , making it for beginners to test core language features without saving files. A fundamental operation is defining functions using defun, which creates named procedures that can be called interactively. For instance, the following defines a simple function:
elisp
(defun hello ()
  (message "Hello, [Emacs](/page/Emacs)!"))
This function, when invoked via M-x hello RET, outputs the message to the minibuffer (echo area). To make it callable from a keybinding, add the interactive declaration:
elisp
(defun hello ()
  "Display a [greeting](/page/Greeting) message."
  (interactive)
  (message "Hello, [Emacs](/page/Emacs)!"))
Evaluating this definition in the *scratch* buffer with C-x C-e after the closing parenthesis registers the function; pressing a key like C-c h (after binding it via (global-set-key (kbd "C-c h") 'hello)) then executes it. Emacs Lisp represents data structures primarily through cons cells, which form lists and enable efficient manipulation. A basic example constructs a list by consing an element onto an empty list (represented as nil):
elisp
(setq mylist (cons "item" nil))
This sets mylist to the list ("item"), a cons cell where the car holds "item" and the cdr points to nil. Accessing the first element uses car:
elisp
(car mylist)
Evaluating this yields "item", demonstrating how cons cells underpin Lisp's linked-list model for sequences. Control flow relies on special forms like if for conditional execution, often integrated with Emacs-specific predicates. Consider checking and saving a modified buffer:
elisp
(if (buffer-modified-p)
    (save-buffer)
  (message "Unchanged"))
Here, buffer-modified-p returns non-nil if the current buffer has unsaved changes since its last save or load; if true, save-buffer writes the buffer to its associated file, otherwise a message appears in the minibuffer. This snippet, evaluated in *scratch* or a Lisp buffer, illustrates branching based on editor state. Iteration over collections uses macros like dolist, which binds a variable to each element of a list and executes a body for each. A simple printing loop is:
elisp
(dolist (elem '(1 2 3))
  (print elem))
Evaluating this in *scratch* outputs 1, 2, and 3 to the current buffer, showcasing side-effect-based looping without explicit indexing. The macro expands to a let and while construct internally, returning nil unless an optional result form is provided.

Customization in Emacs

Emacs Lisp serves as the primary mechanism for customizing Emacs, allowing users to tailor the editor's behavior, interface, and functionality to their preferences. Configurations are typically written in an initialization file, such as init.el or .emacs, which Emacs loads at startup to apply settings like disabling the startup screen with (setq inhibit-startup-screen t). This command suppresses the welcome message and directly opens the user's preferred buffers, streamlining the launch process for efficiency. Keybindings in Emacs are customized using Emacs Lisp to associate keystrokes with specific functions, enhancing workflow productivity. For instance, the expression (global-set-key (kbd "C-c h") 'hello) binds the key sequence Control-C followed by H to a function named hello across all buffers, enabling quick access to custom commands. This global remapping overrides default bindings where necessary, and users can define buffer-local or mode-specific bindings for more targeted control. Defining new major modes extends Emacs's capabilities for handling specialized file types or tasks, often using the define-derived-mode macro to inherit from an existing mode while adding features like syntax highlighting. A basic skeleton might look like this:
elisp
(define-derived-mode my-mode fundamental-mode "MyMode"
  "Major mode for my custom files."
  (setq font-lock-defaults '(my-keywords)))
Here, my-mode derives from fundamental-mode and applies keyword-based highlighting via font-lock-defaults, allowing to recognize and colorize language-specific elements in buffers. Such s integrate seamlessly with 's extensible architecture, supporting indentation, navigation, and other editing aids. s provide a way to automate actions in response to events, such as entering a particular , by appending functions to predefined hook variables. An example is (add-hook 'text-mode-hook 'flyspell-mode), which automatically enables spell-checking in text buffers upon activation of text-mode. s like text-mode-hook run after mode initialization, ensuring features like Flyspell integrate without manual intervention each time. This mechanism promotes modular extensions, as multiple functions can be added to a single . Modern Emacs configurations often leverage package managers to incorporate third-party libraries, with Emacs Lisp facilitating their installation and setup. The ELPA (Emacs Lisp Package Archive) and MELPA (Melpa) repositories host extensions like Org-mode, a powerful tool for note-taking and project planning. Using the use-package macro, popularized in the community, users can declare packages declaratively; for example:
elisp
(use-package magit
  :ensure t
  :bind ("C-x g" . magit-status))
This installs Magit if absent (:ensure t) and binds its status function to Control-X G, simplifying Git integration within Emacs. Customizations persist across sessions through the custom-set-variables and custom-set-faces functions, which store user preferences in the custom-file (often a dedicated .emacs.d/custom.el). These settings, generated via the Customize interface or written manually, override defaults without altering core Emacs files, ensuring reproducibility and ease of maintenance. For broader extensions, ELPA and MELPA enable seamless updates and dependency management for libraries like , which enhances with structured editing for outlines and agendas.

References

  1. [1]
    Introduction (GNU Emacs Lisp Reference Manual) - ∑ Xah Code
    1 Introduction​​ Most of the GNU Emacs text editor is written in the programming language called Emacs Lisp. You can write new code in Emacs Lisp and install it ...
  2. [2]
    Lisp History (GNU Emacs Lisp Reference Manual) - GNU.org
    Lisp (LISt Processing language) was first developed in the late 1950s at the Massachusetts Institute of Technology for research in artificial intelligence. The ...
  3. [3]
    My Lisp Experiences and the Development of GNU Emacs
    The original Emacs did not have Lisp in it. The lower level language, the non-interpreted language—was PDP-10 Assembler. The interpreter we wrote in that ...
  4. [4]
    An Introduction to Programming in Emacs Lisp - GNU.org
    This introduction to Emacs Lisp is designed to get you started: to guide you in learning the fundamentals of programming, and more importantly, to show you how ...
  5. [5]
    GNU Emacs Lisp Reference Manual
    This manual attempts to be a full description of Emacs Lisp. For a beginner's introduction to Emacs Lisp, see An Introduction to Emacs Lisp Programming.
  6. [6]
    GNU Emacs Lisp Reference Manual
    The GNU Emacs Lisp reference manual is available in the following formats: HTML - with one web page per node. HTML - entirely on one web page.
  7. [7]
    Evolution of Emacs Lisp | Proceedings of the ACM on Programming ...
    Jun 12, 2020 · ... Emacs Lisp history through its predecessors, Mocklisp and MacLisp, its early development up to the “Emacs schism” and the fork of Lucid ...
  8. [8]
    EMACS: The Extensible, Customizable Display Editor - GNU.org
    Many minor extensions can be done without any programming. These are called customizations, and are very useful even by themselves. For example, for editing a ...
  9. [9]
    History of LISP - ACM Digital Library
    Early LISP history (1956 - 1959)​​ This paper describes the development of LISP from McCarthy's first research in the topic of programming languages for AI until ...
  10. [10]
    Garbage Collection (GNU Emacs Lisp Reference Manual)
    Common Lisp note: Unlike other Lisps, GNU Emacs Lisp does not call the garbage collector when the free list is empty. Instead, it simply requests the ...
  11. [11]
    Using Interactive (GNU Emacs Lisp Reference Manual)
    Using Interactive (GNU Emacs Lisp Reference Manual) ... Just like interactive-form , this function takes a command and returns its interactive form.
  12. [12]
  13. [13]
    Hooks (GNU Emacs Lisp Reference Manual)
    ### Summary of Hooks in Emacs Lisp for Event Handling
  14. [14]
    Packages (GNU Emacs Manual)
    ### Summary of Emacs Package System
  15. [15]
    Lisp Interaction (GNU Emacs Manual)
    ### Summary of Interactive Evaluation Methods in Lisp Interaction
  16. [16]
    Edebug (GNU Emacs Lisp Reference Manual)
    ### Summary of Debugging with Edebug in Emacs Lisp
  17. [17]
    Writing Emacs Primitives (GNU Emacs Lisp Reference Manual)
    ### Summary: C Primitives for Performance-Critical Operations in Emacs Lisp Integration
  18. [18]
    Multics Emacs History/Design/Implementation
    Apr 8, 1996 · Bernard S. Greenberg -- 15 August 1979. (Paper on Multics Emacs, intended audience unclear. Idea is to put this stuff down on "paper" for ...Missing: date | Show results with:date
  19. [19]
    My Lisp Experiences and the Development of GNU Emacs
    The original Emacs did not have Lisp in it. The lower level language, the non-interpreted language—was PDP-10 Assembler. The interpreter we wrote in that ...Missing: 1993 | Show results with:1993
  20. [20]
    [PDF] Unix Emacs - Bitsavers.org
    Unix Emacs. James Gosling @ CMU. December. 1981. Copyright (c) 1980,1981 James Gosling. 1. Introduction. 2. The Screen. 3. Input Conventions. 4. Invoking Emacs.
  21. [21]
    Lisp History (Programming in Emacs Lisp) - GNU.org
    Lisp was first developed in the late 1950s at the Massachusetts Institute of Technology for research in artificial intelligence. The great power of the Lisp ...
  22. [22]
    XEmacs Internals Manual: 3. A History of Emacs
    1978, by Bernie Greenberg, which was written in MacLisp and also used Lisp as its extension language; and ZMACS, c. ... Version 19.15 beta released June 19, 1993.
  23. [23]
    GNU Emacs Release History
    GNU Emacs Release History · 2025-08-14 - Emacs 30.2 released · 2025-02-23 - Emacs 30.1 released · 2024-06-22 - Emacs 29.4 released · 2024-03-24 - Emacs 29.3 ...
  24. [24]
    New in Emacs 24 (GNU Emacs FAQ) - GNU.org
    Emacs Lisp now supports lexical binding on a per-file basis. In lexical binding, variable references must be located textually within the binding construct.
  25. [25]
    None
    ### Summary of Changes in Emacs 24.1 Related to Emacs Lisp, Lexical Scoping, and ELPA
  26. [26]
    MELPA
    MELPA (Milkypostman's Emacs Lisp Package Archive). Up-to-date packages built on our servers from upstream source; Installable in any Emacs with 'package.el ...Missing: introduction | Show results with:introduction
  27. [27]
    New in Emacs 22 (GNU Emacs FAQ) - GNU.org
    Emacs 22 supports GTK+ widgets, drag-and-drop, new OS support, a new Kmacro system, a new GUD, and improved Unicode support.Missing: bytecode | Show results with:bytecode
  28. [28]
    GNU Emacs 28 NEWS – history of user-visible changes
    This file is about changes in Emacs version 28. See file HISTORY for a list of GNU Emacs versions and release dates.
  29. [29]
    New in Emacs 27 (GNU Emacs FAQ)
    Native support for JSON parsing that is much faster than json.el . Cairo ... Consult the Emacs NEWS.27 file for the full list of changes in Emacs 27.
  30. [30]
    What's New in Emacs 27.1?
    Emacs 27.1 is out and it brings with it a wealth of cool changes, including fast JSON; improved text shaping engine; and a lot of cool tweaks and additions to ...
  31. [31]
    New in Emacs 29 (GNU Emacs FAQ) - GNU.org
    Here's a list of the most important changes in Emacs 29 as compared to Emacs 28 (the full list is too long, and can be read in the Emacs NEWS file by typing Ch ...<|control11|><|separator|>
  32. [32]
    None
    Summary of each segment:
  33. [33]
    Programming Types (GNU Emacs Lisp Reference Manual)
    ### Summary of Emacs Lisp Data Types
  34. [34]
    Symbols (GNU Emacs Lisp Reference Manual)
    ### Summary of Symbol Type in Emacs Lisp
  35. [35]
    Numbers (GNU Emacs Lisp Reference Manual)
    ### Summary of Number Types in Emacs Lisp
  36. [36]
    Lists (GNU Emacs Lisp Reference Manual)
    ### Summary of Cons Cells and Lists in GNU Emacs Lisp
  37. [37]
    Editing Types (GNU Emacs Lisp Reference Manual)
    Emacs Lisp provides several additional data types for purposes connected with editing. Buffer Type · Marker Type · Window Type · Frame Type · Terminal Type ...
  38. [38]
    Buffer Type (GNU Emacs Lisp Reference Manual)
    2.5. 1 Buffer Type​​ A buffer is an object that holds text that can be edited (see Buffers). Most buffers hold the contents of a disk file (see Files) so they ...
  39. [39]
    Equality Predicates (GNU Emacs Lisp Reference Manual)
    ### Summary of `eq` and `equal` Predicates
  40. [40]
    Defining Functions (GNU Emacs Lisp Reference Manual)
    Most Emacs functions are part of the source code of Lisp programs, and are defined when the Emacs Lisp reader reads the program source before executing it.
  41. [41]
    Lambda Expressions (GNU Emacs Lisp Reference Manual)
    ### Summary of Lambda Expressions in Emacs Lisp
  42. [42]
    Conditionals (GNU Emacs Lisp Reference Manual)
    ### Summary of Conditional Forms in Emacs Lisp
  43. [43]
    pcase Macro (GNU Emacs Lisp Reference Manual)
    The value of pcase is the value of the last of body-forms in the successful clause. Otherwise, pcase evaluates to nil.
  44. [44]
    Iteration (GNU Emacs Lisp Reference Manual)
    ### Summary of Loop Constructs and Recursion in Emacs Lisp
  45. [45]
    Simple recursive function freezes Emacs — how to correct the ...
    Feb 25, 2022 · Now, Emacs Lisp does implement Optimized Tail-Recursion, since Emacs 28.1 (Released Apr 4, 2022). 12.3 Local Variables: Recursive calls to name ...Is there a more idiomatic way of repeating a string in Emacs Lisp?elisp - Stack reflection in Emacs Lisp?More results from emacs.stackexchange.com
  46. [46]
    What Is a Function (GNU Emacs Lisp Reference Manual)
    A function is a rule for carrying out a computation given input values called arguments. The result of the computation is called the value or return value of ...
  47. [47]
    Calling Functions (GNU Emacs Lisp Reference Manual)
    Functions are called by evaluating a list, or using `funcall` or `apply`. `funcall` calls a function with arguments, and `apply` spreads a list of arguments.<|separator|>
  48. [48]
    Defining Commands (GNU Emacs Lisp Reference Manual)
    Defining Commands (GNU Emacs Lisp Reference Manual) ... The argument of the interactive form specifies how the arguments for an interactive call should be read.
  49. [49]
    Advising Functions (GNU Emacs Lisp Reference Manual)
    ### Summary of Emacs Lisp Advice System
  50. [50]
    Lexical & Dynamic Binding Differences (Programming in Emacs Lisp)
    Under dynamic binding, the rules are different: instead, when you use let, the local variables you've created are valid during execution of the let expression.
  51. [51]
    Lexical Binding (GNU Emacs Lisp Reference Manual)
    A lexically-bound variable has lexical scope, meaning that any reference to the variable must be located textually within the binding construct.
  52. [52]
    Converting to Lexical Binding (GNU Emacs Lisp Reference Manual)
    Converting an Emacs Lisp program to lexical binding is easy. First, add a file-local variable setting of lexical-binding to t in the header line of the Emacs ...
  53. [53]
    Obsolete Lexical Binding (Common Lisp Extensions) - GNU.org
    These features are likewise obsolete since the introduction of true lexical binding in Emacs 24.1. ... lexical variable (see Closures in GNU Emacs Lisp Reference ...
  54. [54]
    Evaluation (GNU Emacs Lisp Reference Manual)
    ### Summary of Emacs Lisp Evaluation Model (GNU Emacs Lisp Reference Manual)
  55. [55]
  56. [56]
    Eval (GNU Emacs Lisp Reference Manual)
    This is the basic function for evaluating an expression. It evaluates form in the current environment, and returns the result.
  57. [57]
    Creating Symbols (GNU Emacs Lisp Reference Manual)
    ### Summary: Obarrays for Symbols in the Global Environment
  58. [58]
    Variables (GNU Emacs Lisp Reference Manual)
    ### Summary of Environment for Evaluation in Emacs Lisp Variables
  59. [59]
    Handling Errors (GNU Emacs Lisp Reference Manual)
    ### Summary of Error Handling in Emacs Lisp
  60. [60]
  61. [61]
    Printed Representation (GNU Emacs Lisp Reference Manual)
    The read syntax of an object is the format of the input accepted by the Lisp reader (the function read ) for that object. This is not necessarily unique ...
  62. [62]
    Read and Print (GNU Emacs Lisp Reference Manual)
    This chapter describes the Lisp functions for reading and printing. It also describes streams, which specify where to get the text (if reading) or where to put ...
  63. [63]
    Special Read Syntax (GNU Emacs Lisp Reference Manual)
    Emacs Lisp represents many special objects and constructs via special hash notations. When printing circular structures, this construct is used to represent
  64. [64]
    GNU Emacs Common Lisp Emulation
    Also note that the Common Lisp functions member and assoc use eql to compare elements, whereas Emacs Lisp follows the MacLisp tradition and uses equal for these ...
  65. [65]
    None
    Nothing is retrieved...<|separator|>
  66. [66]
    Backquote (GNU Emacs Lisp Reference Manual)
    ### Summary of Backquote in Emacs Lisp
  67. [67]
    None
    Nothing is retrieved...<|separator|>
  68. [68]
    Macros (GNU Emacs Lisp Reference Manual)
    ### Summary of Macros in Emacs Lisp
  69. [69]
  70. [70]
    [PDF] GNU Emacs Lisp Bytecode Reference Manual
    The bytecode interpreter implements a stack machine utilizing a fixed-size evaluation stack, which is usually allocated as a block on the C stack. Instructions ...
  71. [71]
    Dynamic Binding (GNU Emacs Lisp Reference Manual)
    Dynamic binding is implemented in Emacs Lisp in a simple way. Each symbol has a value cell, which specifies its current dynamic value (or absence of value).
  72. [72]
    Asynchronous Processes (GNU Emacs Lisp Reference Manual)
    In this section, we describe how to create an asynchronous process. After an asynchronous process is created, it runs in parallel with Emacs.
  73. [73]
    Byte Compilation (GNU Emacs Lisp Reference Manual)
    Emacs Lisp has a compiler that translates functions written in Lisp into a special representation called byte-code that can be executed more efficiently.
  74. [74]
  75. [75]
    Evolution of Emacs Lisp - ACM Digital Library
    Like MacLisp, Emacs Lisp offered only dynamic scoping of variables. Also ... While Librep started as a Lisp dialect that was mostly compatible with Emacs Lisp, it ...
  76. [76]
    Native Compilation (GNU Emacs Lisp Reference Manual)
    Unlike byte-compiled code, natively-compiled Lisp code is executed directly by the machine's hardware, and therefore runs at full speed that the host CPU can ...
  77. [77]
  78. [78]
  79. [79]
    cons (Programming in Emacs Lisp) - GNU.org
    The cons function constructs lists; it is the inverse of car and cdr. For example, cons can be used to make a four element list from the three element list.
  80. [80]
    car & cdr (Programming in Emacs Lisp) - GNU.org
    7.1 car and cdr. The CAR of a list is, quite simply, the first item in the list. Thus the CAR of the list (rose violet daisy buttercup) is rose .
  81. [81]
    Saving Buffers (GNU Emacs Lisp Reference Manual)
    This function saves the contents of the current buffer in its visited file if the buffer has been modified since it was last visited or saved. Otherwise it ...
  82. [82]
    dolist (Programming in Emacs Lisp) - GNU.org
    The dolist Macro. Suppose, for example, you want to reverse a list, so that “first” “second” “third” becomes “third” “second” “first”.