[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Auto-fill-mode with code sections
From: |
cberry |
Subject: |
Re: [O] Auto-fill-mode with code sections |
Date: |
Fri, 04 May 2012 21:07:26 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) |
Eric Schulte <address@hidden> writes:
> Ken Williams <address@hidden> 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: address@hidden
>>> 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