https://wikemacs.org/api.php?action=feedcontributions&user=Zck&feedformat=atom
WikEmacs - User contributions [en]
2024-03-19T04:19:39Z
User contributions
MediaWiki 1.35.14
https://wikemacs.org/index.php?title=Emacs_Lisp&diff=1012
Emacs Lisp
2012-03-28T04:28:08Z
<p>Zck: typo fix</p>
<hr />
<div><br />
<br />
''(a short overview should go here)''<br />
<br />
= Basic setup =<br />
<br />
Emacs' support for all [[:Category:Lisp|lisp languages]], including Emacs Lisp, can be customized through the [[Custom]] mechanism by running the command {{Command|customize-group RET lisp}}<br />
<br />
= Helpful keybindings =<br />
<br />
; {{Keys|M-<tab>}}<br />
: Complete at point<br />
<br />
; {{Keys|C-M-q}}<br />
: Indent the sexp following [[point and mark|point]]<br />
<br />
;{{Keys|C-M-x}}<br />
: Evaluate the <code>defun</code> at [[point and mark|point]]<br />
<br />
= Common customizations =<br />
<br />
== Outlining ==<br />
<br />
For [[Org]]-style outlining, add the following customizations.<br />
<br />
<source lang="lisp"><br />
;; Turn on outline minor mode<br />
(add-hook 'emacs-lisp-mode-hook 'outline-minor-mode)<br />
<br />
;; Add key bindings for Org-style outline cycling<br />
(add-hook 'outline-minor-mode-hook<br />
(lambda ()<br />
(define-key outline-minor-mode-map [(control tab)] 'org-cycle)<br />
(define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))<br />
</source><br />
<br />
Now visit any elisp file (say {{Command|find-library RET outline}}) and keep pressing {{Keys|S-TAB}} and see what happens. Experiment similarly with {{Keys|C-TAB}}.<br />
<br />
== Indentation ==<br />
<br />
Add following customization, so that you don't have to indent deliberately. See {{Function|reindent-then-newline-and-indent}}.<br />
<br />
<source lang="lisp"><br />
(add-hook 'emacs-lisp-mode-hook<br />
(lambda nil<br />
(local-set-key [(return)] 'reindent-then-newline-and-indent)))<br />
</source><br />
<br />
= External links =<br />
<br />
* [http://www.gnu.org/software/emacs/manual/html_node/elisp/index.html Emacs Lisp manual]<br />
<br />
[[Category:Emacs User]][[Category:Emacs Contributor]][[Category:Intermediate]][[Category:Lisp]]</div>
Zck