53: How do I execute a piece of Emacs Lisp code? There are a number of ways to execute (called "evaluate") an Emacs Lisp "form": * If you want it evaluated every time you run Emacs, put it in a file named `.emacs' in your home directory. * You can type the form in the *scratch* buffer, and then type LFD (or C-j) after it. The result of evaluating the form will be inserted in the buffer. * In Emacs-Lisp mode, typing M-C-x evaluates a top-level form before or around point. * Typing "C-x C-e" in any buffer evaluates the Lisp form immediately before point and prints its value in the echo area. * Typing M-ESC or M-x eval-expression allows you to type a Lisp form in the minibuffer which will be evaluated. * You can use M-x load-file to have Emacs evaluate all the Lisp forms in a file. (To do this from Lisp use the function `load' instead.) These functions are also used for evaluating Lisp forms: load-library, eval-region, eval-current-buffer, require, autoload