From mboxrd@z Thu Jan 1 00:00:00 1970 From: cberry@tajo.ucsd.edu Subject: Re: Auto-fill-mode with code sections Date: Fri, 04 May 2012 21:07:26 -0700 Message-ID: <87bom36zk1.fsf@tajo.ucsd.edu> References: <21A5E1E970CD46459ECBE86D6CC4B28C66C1C273@spexch01.WindLogics.local> <87y5p77lo4.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQWHY-0008V3-Bf for emacs-orgmode@gnu.org; Sat, 05 May 2012 00:07:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SQWHW-0003BT-57 for emacs-orgmode@gnu.org; Sat, 05 May 2012 00:07:43 -0400 Received: from plane.gmane.org ([80.91.229.3]:50240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQWHV-0003BD-Ue for emacs-orgmode@gnu.org; Sat, 05 May 2012 00:07:42 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SQWHT-0000mF-UB for emacs-orgmode@gnu.org; Sat, 05 May 2012 06:07:39 +0200 Received: from tajo.ucsd.edu ([137.110.122.165]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 May 2012 06:07:39 +0200 Received: from cberry by tajo.ucsd.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 May 2012 06:07:39 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Eric Schulte writes: > Ken Williams writes: > >> Ping - I'm still interested in this, if anyone has any recommendations. Thanks. >> > > Hi Ken, > > I don't know of an automatic solution here. One option is to edit code > sections with org-edit-special, i.e., press C-c ' from within a code > block. > > Best, Here is a start. It fills normal text, but leaves src blocks alone. Maybe add something to one of the org-mode hooks ? HTH, Chuck ,---- | | * autofill, but not src blocks | | #+begin_src emacs-lisp | (defun org-auto-fill-function () | "auto fill function to leave src blocks alone" | (if (not (org-babel-get-src-block-info)) | (do-auto-fill))) | (setq normal-auto-fill-function 'org-auto-fill-function) | #+end_src | | | aaa aaa vvv aaa aaa vvv aaa aaa vvv aaa aaa vvv aaa aaa vvv aaa aaa | aaa aaa vvv aaa aaa vvv aaa aaa vvv aaa aaa vvv aaa aaa vvv aaa aaa | vvv aaaaaa vvv aaa aaa vvv | | #+begin_src R | x <- y + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 3 | #+end_src `---- > >> >> -Ken >> >>> From: Ken Williams >>> Sent: Tuesday, May 01, 2012 8:51 AM >>> To: emacs-orgmode@gnu.org >>> Subject: Auto-fill-mode with code sections >>> >>> Hi, >>> >>> I use org-mode extensively with R code sections, as a scientific notebook. >>> One annoyance I have is that when I have auto-fill-mode turned on (which >>> is convenient for the main body parts of the document), it extends to the >>> code section and starts auto-filling my code. >>> >>> Can anyone recommend a configuration that will get me folding in the body >>> sections, but not in the code sections? It could use another mechanism >>> besides auto-fill-mode if that's what's preferred these days, but auto-fill-mode >>> is the one I'm familiar with. >> >> >> CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the >> intended recipient(s) and may contain confidential and privileged >> information. Any unauthorized review, use, disclosure or distribution >> of any kind is strictly prohibited. If you are not the intended >> recipient, please contact the sender via reply e-mail and destroy all >> copies of the original message. Thank you. >> -- Charles C. Berry Dept of Family/Preventive Medicine cberry at ucsd edu UC San Diego http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego 92093-0901