org-faq.org: Add "Can I get the visibility-cycling features in emacs-lisp-mode?"
authorBastien Guerry <bzg@altern.org>
Thu, 24 Jan 2013 12:46:49 +0000 (13:46 +0100)
committerBastien Guerry <bzg@altern.org>
Thu, 24 Jan 2013 12:46:49 +0000 (13:46 +0100)
org-faq.org

index f7e8516..6924e39 100644 (file)
@@ -804,6 +804,21 @@ version of Org-mode you are using.
 For instructions on how to stay current with Org-mode, consult [[keeping-current-with-Org-mode-development][this
 FAQ]] or follow the instructions on [[http://orgmode.org][the official Org-mode site]].
 
+** Can I get the visibility-cycling features in emacs-lisp-mode?
+
+Yes.  This snippet in your =.emacs= will bind =C-M-]= and =M-]= to global
+and local cycling:
+
+#+BEGIN_SRC emacs-lisp
+(global-set-key (kbd "C-M-]") (lambda () (interactive) (org-cycle t)))
+(global-set-key (kbd "M-]") (lambda ()
+                              (interactive)
+                              (ignore-errors
+                               (end-of-defun)
+                               (beginning-of-defun))
+                              (org-cycle)))
+#+END_SRC
+
 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
    :PROPERTIES:
    :CUSTOM_ID: use-visibility-cycling-in-outline-mode