Go to the first, previous, next, last section, table of contents.


Lisp mode

lisp-mode is used to edit files of Lisp intended to be read by the editor. Its main function is to manage the indentation of Lisp expressions for you. Each form is regarded as an expression by the commands which operate on expressions, see section Editing Expressions.

There is also support for using a buffer as a simple shell-interface to the editor's Lisp subsystem.

The method used for indenting lines of Lisp is fairly straightforward, the first symbol in the expression containing this line is found. This symbol's lisp-indent property is then used to decide which indentation method to apply to this line. It can be one of the following,

nil
The standard method (also used if the symbol doesn't have a lisp-indent property). If the first argument to the function is on the same line as the name of the function then subsequent lines are placed under the first argument. Otherwise, the following lines are indented to the same depth as the function name. For example,
(setq foo 20
      bar 1000)

(setq
 foo 20
 bar 1000)
defun
This method is used for all functions (or special-forms, macros) whose name begins with `def' and any lambda-expressions. All arguments to the function are indented lisp-body-indent columns from the start of the expression. For example,
(defun foo (bar)
  "A test"
  (let
      ((foo bar))
    ...
A number, n
The first n arguments to the function are indented twice the value of lisp-body-indent, the remaining arguments are indented by lisp-body-indent. For example the special-form if has a lisp-indent property of 2,
(if condition
    t-expression
  nil-expressions...)

Special commands for Lisp mode are,

Ctrl-j
Evaluates the expression preceding the cursor, prints the value on the next line. This is designed to be used like a shell, you type a Lisp expression, press Ctrl-j and Jade prints the value for you.
TAB
Indents the current line.
Ctrl-Meta-\
Indents all lines which are marked by the current block.
Ctrl-Meta-x
Evaluates the expression before the cursor, prints it's value in the status line.

Command: lisp-mode
Editing mode for Jade's Lisp. Automatically invoked for files ending in `.jl'.

Hook: lisp-mode-hook
This hook is evaluated each time lisp-mode is invoked.

Variable: lisp-body-indent
The number of characters which the body of a form is indented by, the default value is 2.


Go to the first, previous, next, last section, table of contents.