Source block fontification is achieved by copying source block contents
into temporary buffer under appropriate major mode and mirroring face
text-properties into original buffer.

Problem is that this procedure doesn't account for user option
`org-edit-src-content-indentation'. This option adds decorative indentation
to contents of source block after editing with command `org-edit-src-code'.

Correct behavior would be to strip this indentation in order to access the
actual actual source block content. This behavior can be observed during
expansion and during execution of `org-edit-src-code'.

However, when function `org-src-font-lock-fontify-block' copies contents of
src block into temporary buffer it leaves the indentation present.
Beginning whitespace can be significant to some languages semantics and
major-mode fontification  routines.

I have attached a file which will let you see examples of both correct and
incorrect behavior.


On 21 March 2014 12:23, Bastien <b...@gnu.org> wrote:

> Hi Michael,
>
> thanks for the patch.
>
> Pontus Michael <m.pon...@gmail.com> writes:
>
> > Primary reason for this change is to fix the problem which I describe
> > as
> > follows:
> >
> > This function is not 100% compatible with a org-edit-src facility,
> > which provides an option to have indentation added to the code inside
> > the block after using command `org-edit-src-code' to edit it. This
> > command also handles removal of indentation upon insertion of the
> > code
> > in temporary buffer where editing of the code will in relevant
> > major-mode.
>
> I'm not sure I understand what the real problem is.
>
> Can you describe it against the behavior of the current version?
> And maybe provide a minimal recipe to reproduce it?
>
> Did you catch any side-effect of your patch?
>
> Thanks,
>
> --
>  Bastien
>

Attachment: fontification-example.org
Description: Lotus Organizer

Reply via email to