From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: org-style folding for a .emacs Date: Tue, 14 Jul 2009 13:55:20 +0200 Message-ID: <87tz1ftr6f.fsf@mundaneum.com> References: <87bpnonpvb.fsf@zeller.michaelzeller.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello Michael, >> Does anyone have a recipe for easy org-style folding of an elisp file? I= 'd >> like to divide my .emacs into segments to make it easier to oversee and >> navigate. I asked myself this question a couple of days ago. Telepathy. For real. Good it has been asked, and answered. In my case, I am very interested as well by the literate programming approa= ch. But I will comment on this later. > In summary, add the following to your ~/.emacs.el: > > (defun th-outline-regexp () > "Calculate the outline regexp for the current mode." > (let ((comment-starter (replace-regexp-in-string > "[[:space:]]+" "" comment-start))) > (when (string=3D comment-start ";") > (setq comment-starter ";;")) > (concat "^" comment-starter "\\*+"))) > > (defun th-outline-minor-mode-init () > (interactive) > (setq outline-regexp (th-outline-regexp))) > > (add-hook 'outline-minor-mode-hook > 'th-outline-minor-mode-init) > > and add the following as the top line of your ~/.emacs.el: > > ; -*- mode: emacs-lisp; mode: outline-minor; -*- > > Now you can add ;;* and ;;**, etc as headings in your .emacs.el and > cycle using M-tab, M-left and M-right will collapse or expand all > headings respectively. I am guessing you mean to make segments such as > ;;* SHORTCUTS and ;;* VARIABLES, this will do that, but not too much > more. Done. Though, is there a way to get the font used for org-levels in the Emacs con= fig file? That would really greatly improve the readability, then! Best regards, Seb --=20 S=C3=A9bastien=C2=A0Vauban _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode