help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help in writing function to pop indirect buffer


From: Bruno Barbier
Subject: Re: help in writing function to pop indirect buffer
Date: Sat, 28 Jan 2023 12:59:47 +0100

Bruno Barbier <brubar.cs@gmail.com> writes:

> I'm getting the same warning, but fontification seems to work and is
> updated in both buffers.


Playing with your idea with an org buffer, I discovered that I was
wrong. It works only if the base buffer and the indirect buffer are in
the same major mode (and, also, when forcing fontification of the
invisible/undisplayed pieces of text after any change).

In your use case, it might not be possible to use indirect buffers: the
base buffer and the indirect buffer share the same text and its
properties, and, syntax highlighting is mostly done using text
properties.

Org mode allows to edit pieces of text in any mode (using standard buffers).
The lisp function doing most of the work is `org-edit-src-code'. Maybe
you could call/reuse something from there.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]