From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Williams Subject: Auto-fill-mode with code sections Date: Tue, 1 May 2012 08:51:28 -0500 Message-ID: <21A5E1E970CD46459ECBE86D6CC4B28C66AE82FE@spexch01.WindLogics.local> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_21A5E1E970CD46459ECBE86D6CC4B28C66AE82FEspexch01WindLog_" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPDUN-0004MV-Bn for emacs-orgmode@gnu.org; Tue, 01 May 2012 09:51:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPDUK-0006yM-Hv for emacs-orgmode@gnu.org; Tue, 01 May 2012 09:51:34 -0400 Received: from shrimp.windlogics.com ([216.245.170.164]:30060) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPDUK-0006y2-C0 for emacs-orgmode@gnu.org; Tue, 01 May 2012 09:51:32 -0400 Content-Language: en-US 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" --_000_21A5E1E970CD46459ECBE86D6CC4B28C66AE82FEspexch01WindLog_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 i= s convenient for the main body parts of the document), it extends to the co= de section and starts auto-filling my code. Can anyone recommend a configuration that will get me folding in the body s= ections, but not in the code sections? It could use another mechanism besi= des auto-fill-mode if that's what's preferred these days, but auto-fill-mod= e is the one I'm familiar with. Thanks. -- Ken Williams, Senior Research Scientist WindLogics http://windlogics.com ________________________________ CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the inte= nded recipient(s) and may contain confidential and privileged information. = Any unauthorized review, use, disclosure or distribution of any kind is str= ictly prohibited. If you are not the intended recipient, please contact the= sender via reply e-mail and destroy all copies of the original message. Th= ank you. --_000_21A5E1E970CD46459ECBE86D6CC4B28C66AE82FEspexch01WindLog_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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 doc= ument), it extends to the code section and starts auto-filling my code.

 

Can anyone recommend a configuration that will get m= e folding in the body sections, but not in the code sections?  It coul= d 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.

 

Thanks.

 

--

Ken Williams, Senior Research Scientist

Wind<= /b>Logics

http://windlogics.com

 



CONFIDENTIALITY NOTICE: Th= is e-mail message is for the sole use of the intended recipient(s) and may = contain confidential and privileged information. Any unauthorized review, u= se, 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.
--_000_21A5E1E970CD46459ECBE86D6CC4B28C66AE82FEspexch01WindLog_-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Williams Subject: Re: Auto-fill-mode with code sections Date: Fri, 4 May 2012 17:00:46 -0500 Message-ID: <21A5E1E970CD46459ECBE86D6CC4B28C66C1C273@spexch01.WindLogics.local> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQQYX-0004gv-QB for emacs-orgmode@gnu.org; Fri, 04 May 2012 18:00:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SQQYW-0000Lh-6p for emacs-orgmode@gnu.org; Fri, 04 May 2012 18:00:53 -0400 Received: from shrimp.windlogics.com ([216.245.170.164]:17905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQQYW-0000Jt-0D for emacs-orgmode@gnu.org; Fri, 04 May 2012 18:00:52 -0400 Content-Language: en-US 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" Ping - I'm still interested in this, if anyone has any recommendations. Th= anks. -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-fi= ll-mode > is the one I'm familiar with. CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the inte= nded recipient(s) and may contain confidential and privileged information. = Any unauthorized review, use, disclosure or distribution of any kind is str= ictly prohibited. If you are not the intended recipient, please contact the= sender via reply e-mail and destroy all copies of the original message. Th= ank you. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Auto-fill-mode with code sections Date: Fri, 04 May 2012 16:09:47 -0400 Message-ID: <87y5p77lo4.fsf@gmx.com> References: <21A5E1E970CD46459ECBE86D6CC4B28C66C1C273@spexch01.WindLogics.local> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQQhV-0006E9-Qf for emacs-orgmode@gnu.org; Fri, 04 May 2012 18:10:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SQQhQ-0004hh-1Y for emacs-orgmode@gnu.org; Fri, 04 May 2012 18:10:09 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:41519) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SQQhP-0004cA-Or for emacs-orgmode@gnu.org; Fri, 04 May 2012 18:10:03 -0400 In-Reply-To: <21A5E1E970CD46459ECBE86D6CC4B28C66C1C273@spexch01.WindLogics.local> (Ken Williams's message of "Fri, 4 May 2012 17:00:46 -0500") 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: Ken Williams Cc: "emacs-orgmode@gnu.org" 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, > > -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. > -- Eric Schulte http://cs.unm.edu/~eschulte/ 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Auto-fill-mode with code sections Date: Sat, 05 May 2012 08:17:07 +0200 Message-ID: <87y5p6sljd.fsf@altern.org> References: <21A5E1E970CD46459ECBE86D6CC4B28C66C1C273@spexch01.WindLogics.local> <87y5p77lo4.fsf@gmx.com> <87bom36zk1.fsf@tajo.ucsd.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQgka-0002TY-Al for emacs-orgmode@gnu.org; Sat, 05 May 2012 11:18:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SQgkY-0000wZ-JH for emacs-orgmode@gnu.org; Sat, 05 May 2012 11:18:23 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:38062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQgkY-0000wE-Ao for emacs-orgmode@gnu.org; Sat, 05 May 2012 11:18:22 -0400 Received: by wibhm17 with SMTP id hm17so1890855wib.0 for ; Sat, 05 May 2012 08:18:20 -0700 (PDT) In-Reply-To: <87bom36zk1.fsf@tajo.ucsd.edu> (cberry@tajo.ucsd.edu's message of "Fri, 04 May 2012 21:07:26 -0700") 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: cberry@tajo.ucsd.edu Cc: emacs-orgmode@gnu.org Hi Charles, cberry@tajo.ucsd.edu writes: > It fills normal text, but leaves src blocks alone. > > Maybe add something to one of the org-mode hooks ? `org-auto-fill-function' already exists in the code, adding a new function with the same name would confuse things. I patched the current `org-auto-fill-function' so that, when ̀org-src-prevent-auto-filling' is non-nil, no auto-fill happens in src blocks. The new option defaults to nil so that people are not surprised when ̀auto-fill-mode' is enable and does not happen *everywhere* in Org buffers. Thanks to Ken Williams for the request and to you for your suggestion! -- Bastien