[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] c-c ' strips final newline or adds blank line, but never neither
From: |
Thorsten Jolitz |
Subject: |
Re: [O] c-c ' strips final newline or adds blank line, but never neither |
Date: |
Sat, 26 Jul 2014 12:23:58 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Samuel Wales <address@hidden> writes:
hi Samuel,
> did you try it?
no, that was just a hint.
But I know what you are talking about, since I had these problems with
Outorg too - whitespace changes in the conversion process between
programming language mode and org-mode although no editing at all took
place.
The following chain of actions should not change the original (say
emacs-lisp) buffer:
1. M-# # (outorg-edit-as-org) in emacs-lisp buffer
2. 2x C-c ' on emacs-lisp src-block
3. M-# in *outorg-edit-buffer*
since only 4 conversions but no editing at all took place. But depending
on your config (or the org defaults) and maybe org/outorg bugs
indentation and newlines might have been added removed.
In outorg I have e.g.
,----
| outorg-remove-trailing-blank-lines
| outorg-unindent-active-source-blocks
`----
to deal with this issue. IIRC I always first remove all
trailing-blank-lines, and then add one.
Isn't that even an 'upstream' issue? It seems Emacs itself inserts
trailing blank lines in buffers if they are missing, at least I had to deal
with this in the outorg conversion process.
I vaguley remember having read something about 'by default every buffer
should end with a trailing blank line, and this is enforced by Emacs',
but could not find any info about this nor related config vars.
> On 7/25/14, Thorsten Jolitz <address@hidden> wrote:
>> Samuel Wales <address@hidden> writes:
>>
>>> i find that when i do c-c ' on a source block, it either strips the
>>> final newline in the editing buffer or adds an unwanted blank line in
>>> the source block.
>>>
>>> i like to have final newlines in all of my buffers, including editing
>>> buffers. what setting allows this without introducing a blank line at
>>> the end of a source block?
>>
>> ,----[ C-h v org-src-strip-leading-and-trailing-blank-lines RET ]
>> | org-src-strip-leading-and-trailing-blank-lines is a variable defined
>> | in `org-src.el'. Its value is nil
>> |
>> | Documentation:
>> | If non-nil, blank lines are removed when exiting the code edit buffer.
>> `----
>>
>> --
>> cheers,
>> Thorsten
>>
>>
>>
--
cheers,
Thorsten