XCODX |

Emacs Lisp Online Compiler & Interpreter

Select Language
Online Code Compiler
Full HTML IDE
Py main.py
Program Output Ready
  Welcome to XCODX Online Compiler

  Quick Start:
  Ctrl+Enter  Run code
  Ctrl+S      Save / Download
  Ctrl+L      Clear output

  Select a language and start coding.
Success
Operation completed

About Emacs Lisp

Emacs Lisp is the programming language that the GNU Emacs text editor is built from and extended with. It is a dialect of Lisp, closely related to the older Maclisp with later borrowings from Common Lisp, first released with GNU Emacs in 1985 by Richard Stallman. Almost everything you see in Emacs, from editing commands to major modes, is written in Emacs Lisp, while only a small core, including the Lisp interpreter itself, is written in C. That makes it one of the most heavily used Lisp dialects in existence, even though it was designed to manipulate buffers and text rather than to be a general-purpose language. On XCODX it runs non-interactively with 'emacs --script' (batch mode), so there is no editor window, just your code reading input and printing results.

Hello World in Emacs Lisp

;; In batch mode, read-string reads a line from standard input.
(princ "What is your name? ")
(let ((name (read-string "")))
  (princ (format "Hello, %s!\n" name))
  (princ (format "2 + 3 = %d\n" (+ 2 3))))

When to use Emacs Lisp

Emacs Lisp exists to customize and program the Emacs editor: you use it to write commands, define modes, automate editing, and reshape the environment while it runs. Because it is a complete Lisp, it also handles lists, recursion, higher-order functions, and macros, so it works fine for small scripting and text-processing tasks. In this sandbox you can explore that Lisp core in batch mode and read from standard input. What you cannot do here is the thing Emacs Lisp is really for, interacting with live buffers, windows, and the editor UI, because no editor session is running.

Common questions

Is Emacs Lisp a real programming language or just configuration?

It is a full Lisp dialect, not a limited config format. It has functions, closures, macros, and data structures, and happens to be specialized for driving the Emacs editor. The language underneath is general enough for real computation, which is what runs here.

How do I read input when running Emacs in batch mode?

Use the normal minibuffer-reading functions; in batch mode they read from standard input instead of prompting. '(read-string "")' returns one line as a string, and you can call it repeatedly. Type into the live terminal / Stdin Box and each read consumes the next line.

Why does message output not appear but princ does?

In batch mode Emacs sends 'message' to standard error and sends 'princ' and 'prin1' to standard output. For results you want in the console's main output, use 'princ', optionally with 'format', rather than 'message'.

Can I use Emacs packages like org-mode or MELPA here?

No. There is no network and no package installation, and the filesystem resets each run, so 'package-install', MELPA, and external .el libraries are unavailable. You can only use functions built into the Emacs that ships in the sandbox.

Do I get an Emacs editor window?

No. 'emacs --script' runs Emacs headless with no UI, purely to execute your Lisp and then exit. Buffer and window commands still exist as functions, but there is no interactive editor to see, and the run has a short time limit.

How is Emacs Lisp different from Common Lisp or Scheme?

It shares Lisp's parenthesized syntax and list processing but has its own libraries centered on text editing, and it historically used dynamic scoping (lexical binding is now available). Code written for Common Lisp or Scheme generally will not run unchanged.

How Emacs Lisp runs on XCODX

Sandbox filename
main.el
Entry point
single main source file
Editor grammar
commonlisp
Reading stdin
read-string
Input delivery
live WebSocket stream
Prompt flushing
flush manually before reading input
Compile limit
10 s
Run limit
3 s batch · up to 3 min live
Memory
256 MB per stage
Max source
50,000 characters

Default program on this page

; Emacs Lisp
(message "Hello from Emacs Lisp!")
(message "Welcome to XCODX Online Compiler!")

;; List operations
(let ((numbers '(1 2 3 4 5)))
  (message "Numbers: %s" numbers)
  (message "Sum: %d" (apply #'+ numbers))
  (message "Doubled: %s" (mapcar (lambda (x) (* x 2)) numbers)))

Emacs echoes its output on both the pty and stderr. The duplicate copy is collapsed so each line appears once.