Difference between revisions of "Emacs Lisp"

From WikEmacs
Jump to: navigation, search
(Basic setup)
(Basic setup)
Line 5: Line 5:
= Basic setup =
= Basic setup =
Emacs' support for all [[:Category:Lisp|lisp languages]], including Emacs Lisp, can be customized through the [[Custom]] mechanism by running the command {{CustomizeGroup|lisp}}
You can customize this and all other [[:Category:Lisp|lisp languages]] with  {{CustomizeGroup|lisp}}.
= Helpful keybindings =
= Helpful keybindings =

Revision as of 00:32, 28 March 2012

(a short overview should go here)

Basic setup

You can customize this and all other lisp languages with M-x customize-group RET lisp RET.

Helpful keybindings

<span title="Try `C-h k M-<tab>' for more information." style="border-bottom
1px dotted">[M-<tab>]</span>
Complete at point
Indent the sexp following point
Evaluate the defun at point

Common customizations


For Org-style outlining, add the following customizations.

;; Turn on outline minor mode
(add-hook 'emacs-lisp-mode-hook  'outline-minor-mode)

;; Add key bindings for Org-style outline cycling
(add-hook 'outline-minor-mode-hook
  (lambda ()
    (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
    (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))

Now visit any elisp file (say M-x find-library RET outline) and keep pressing [S-TAB] and see what happens. Experiment similarly with [C-TAB].


Add following customization, so that you don't have to indent deliberately. See reindent-then-newline-and-indent.

(add-hook 'emacs-lisp-mode-hook
	  (lambda nil
	    (local-set-key [(return)] 'reindent-then-newline-and-indent)))

External links