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

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

Re: Emacs as a translator's tool


From: Marcin Borkowski
Subject: Re: Emacs as a translator's tool
Date: Wed, 10 Jun 2020 22:56:52 +0200
User-agent: mu4e 1.1.0; emacs 27.0.50

On 2020-06-09, at 22:54, Emanuel Berg via Users list for the GNU Emacs text 
editor <help-gnu-emacs@gnu.org> wrote:

> Marcin Borkowski wrote:
>
>> 1. It is inefficient, in the sense that every
>> overlay belongs to some buffer. No need to keep the
>> variable `source-buffer'.
>
> I don't understand?

Check out the function `overlay-buffer'.

>> 2. Your code seems to assume that the point in the
>> source buffer lies within the highlighted sentence,
>> no? This need not be true, since
>>
>> 3. the source buffer may be (in my use-case) the
>> same as the destination buffer, i.e., I sometimes
>> keep both the English and Polish (let's say)
>> versions in the same file. My code covers that case
>> as well as two separate buffers.
>
> Right, but I think its a good idea to keep them
> apart. And then have different modes...

It depends.  How about preapring a LaTeX file with two language versions
typeset side-by-side?  (There are other use-cases where having both
language versions in the same file makes sense.)

> Still, one can do that as well... with a variable
> instead of point to keep track of it the overlay.
> Maybe editing screws it up. Its just better to have
> different buffers for different purposes, then people
> can also rearrange stuff visually more easily, and
> many other advantages...

But my solution, in which I only use the overlay itself (no point, no
markers, no variables pointing to buffers) seems to cover all such
cases, and in quite an elegant way.

Best,

-- 
Marcin Borkowski
http://mbork.pl



reply via email to

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