Difference between revisions of "Emacs Lisp"

From WikEmacs
Jump to navigation Jump to search
Line 17: Line 17:
  
 
= Common customizations =
 
= Common customizations =
 +
 +
== Outlining ==
 +
 +
For [[Org]]-style outlining, add the following customizations.
 +
 +
<source lang="lisp>
 +
;; 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)))
 +
</source>
 +
 +
Now visit any elisp file (say {{Command|find-library RET outline}}) and keep pressing {{Keys|S-TAB}} and see what happens.
  
 
= External links =
 
= External links =

Revision as of 18:28, 27 March 2012


(a short overview should go here)

Basic setup

Helpful keybindings

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

Common customizations

Outlining

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.

External links