Difference between revisions of "Emacs Lisp"
m (→Helpful keybindings)
|Line 13:||Line 13:|
: Indent the sexp following [[point and mark|point]]
: Indent the sexpfollowing [[point and mark|point]]
Revision as of 07:12, 28 March 2012
(a short overview should go here)
You can customize this and all other lisp languages with M-x customize-group RET lisp RET.
- <span title="Try `C-h k M-<tab>' for more information." style="border-bottom
- 1px dotted">[M-<tab>]</span>
- Complete at point
- Evaluate the
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 pressingand see what happens. Experiment similarly with .
Add following customization, so that you don't have to indent deliberately. See.
(add-hook 'emacs-lisp-mode-hook (lambda nil (local-set-key [(return)] 'reindent-then-newline-and-indent)))
By default elisp using dynamic scope. Since Emacs 24 lexical scope has been added.
To use lexical binding, an Emacs-lisp source file must set a file-variable `lexical-binding’ to t in the file header, e.g., by using a first line like: </br>
;;; -*- lexical-binding: t -*-