Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here are three concrete things you can do to help with spotting Lisp syntax problems. In time, it'll become second nature. But until then:</p> <h3>Parenthesis Matching</h3> <p>Parenthesis matching is the easiest way to check the grouping. My favorite package is <a href="http://www.emacswiki.org/emacs/mic-paren.el" rel="nofollow noreferrer">mic-paren</a>. And I like this particular configuration:</p> <pre><code>(setq paren-dont-touch-blink t) (require 'mic-paren) (paren-activate) (setq paren-match-face 'highlight) (setq paren-sexp-mode t) </code></pre> <p>That causes the sexp (matching parenthesis) to be highlighted when the point is at the beginning/end of the sexp. If the parenthesis don't match, the highlight color is different - and brighter. When the matching parenthesis is off-screen, it shows you what that end looks like in the minibuffer (and tells you how many lines away it is).</p> <h3>Compilation</h3> <p>For a slightly more involved method, you can run the Elisp compiler with <code>M-x compile-defun</code>. For example, when I compiled this simple example:</p> <pre><code>(defun mytestfun () (let ((cur (current-buffer))) ) (set-buffer cur)) </code></pre> <p>I got a buffer named <code>*Compile-Log*</code> which said: </p> <blockquote> <p>Warning: reference to free variable `cur'</p> </blockquote> <p>Which clued me into the fact that I was using <code>cur</code> outside of the <code>let</code> statement that defined it.</p> <h3>Change Indentation Level</h3> <p>If you want the indentation to be more prominent, you can customize the variable <code>listp-body-indent</code>:</p> <pre><code>(setq lisp-body-indent 4) ;# default is 2 </code></pre> <p>You can also customize how various constructs are indented, but I don't advise that because it'll be non-standard and might lead to confusion when looking at most Lisp code.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload