[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: indirect-buffers and text-properties
From: |
Phillip Lord |
Subject: |
Re: indirect-buffers and text-properties |
Date: |
Thu, 30 Jan 2014 15:45:21 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> Really? I've started using them because they enable me to have the point
>> in two places at once; for example, in the pre-amble and the body of a
> [...]
>> visible window). Indirect buffers seem to be a nice solution for this.
>
> That would be using a definition of "nice" very different from the one
> I'm familiar with ;-)
>
> BTW, you might like to M-x report-emacs-bug and request exactly this
> feature for "preserving window-specific point". It can probably be
> implemented in a *much* lighter way than by using indirect-buffers.
I would, but I am not sure what the correct behavour is.
Consider:
Window 1 (point at beg)
----
Window 2 (point at end)
C-x 1
Window 1 (point at beg)
C-x 2
Window 1 (point at beg)
----
Window 2 (point at beg)
If one of the two windows is indirect, at least point is preserved
somewhere, so I can get back to it.
>
>> Even as it stands, having the same content in two different modes seems
>> very powerful;
>
> It is very powerful, but as you've seen indirect-buffers only work to
> some extent for that purpose and the problems you bump into are largely
> unsolvable. So it's not going in the right direction.
>
> I think they really fit perfectly the definition of attractive-nuisance.
Okay, I have to accept your word on this, but I can't see another
solution in my head. The best I have come up with is to hook into the
change-functions, and link two (otherwise independent buffers) together
so that the text in both is identical. AFAICT this is tractable, at
least if I only edit one of them.
So, I'd have something like `make-indirect-view' which would open an
indirect buffer, in a new window, read-only, but in a different mode.
Then `swap-modes' which would take the major mode of the editable
buffer, and the uneditable buffer and swap the two. Finally, somelike
`sync-indirect-view' would display make the two display the same parts.
Seems like a reasonable amount of work to do, but could be usuable.
Phil
- indirect-buffers and text-properties, Phillip Lord, 2014/01/30
- Re: indirect-buffers and text-properties, Stefan Monnier, 2014/01/30
- Re: indirect-buffers and text-properties, Phillip Lord, 2014/01/30
- Re: indirect-buffers and text-properties, Stefan Monnier, 2014/01/30
- Re: indirect-buffers and text-properties,
Phillip Lord <=
- Re: indirect-buffers and text-properties, Stefan Monnier, 2014/01/30
- Re: indirect-buffers and text-properties, Phillip Lord, 2014/01/31
- Re: indirect-buffers and text-properties, Stefan Monnier, 2014/01/31
- Re: indirect-buffers and text-properties, Phillip Lord, 2014/01/31
Re: indirect-buffers and text-properties, Andreas Röhler, 2014/01/30