Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Just as addition, the differences between those commands have increased due to the introduction of lexical binding, though those differences will not really be relevant if you just want to customize some variables.</p> <p>The <code>def...</code> constructs <em>declare</em> global variables. The <code>set...</code> functions <em>set</em> variables, whether global or local. When <code>x</code> is neither a local variable (a formal parameter of the current function or declared by a <code>let</code> form or similiar) nor defined by a <code>def...</code> form and you write <code>(setq x 0)</code> the byte compiler will even show a warning </p> <pre><code>Warning: assignment to free variable `x' </code></pre> <p>Variables declared with <code>defvar</code>, <code>defcustom</code>, <code>defconst</code> are dynamically bound, i.e. when you have a construct</p> <pre><code>(let ((lisp-indent-offset 2)) (pp (some-function))) </code></pre> <p>the function <code>some-function</code> will see the change of the global variable <code>lisp-indent-offset</code>.</p> <p>When a variable is not dynamically bound, in something like </p> <pre><code>(let ((my-local-var 1)) (some-function)) </code></pre> <p>where <code>my-local-var</code> has no global value, then <code>some-function</code> will not see the assigned value, as it is lexically scoped. </p> <p>On the other hand, dynamically scoped variables will <em>not</em> be captured into lexical closures.</p> <p>More details can be seen in <a href="http://www.gnu.org/software/emacs/manual/html_node/elisp/Lexical-Binding.html" rel="nofollow">http://www.gnu.org/software/emacs/manual/html_node/elisp/Lexical-Binding.html</a></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.
 

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