all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: phillip.lord@newcastle.ac.uk (Phillip Lord)
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: help-gnu-emacs@gnu.org
Subject: Re: indirect-buffers and text-properties
Date: Thu, 30 Jan 2014 15:45:21 +0000	[thread overview]
Message-ID: <87txclpj72.fsf@newcastle.ac.uk> (raw)
In-Reply-To: <jwv1tzp5xg3.fsf-monnier+gmane.emacs.help@gnu.org> (Stefan Monnier's message of "Thu, 30 Jan 2014 10:03:04 -0500")

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



  reply	other threads:[~2014-01-30 15:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-30 12:29 indirect-buffers and text-properties Phillip Lord
2014-01-30 13:27 ` Stefan Monnier
2014-01-30 14:13   ` Phillip Lord
2014-01-30 15:03     ` Stefan Monnier
2014-01-30 15:45       ` Phillip Lord [this message]
2014-01-30 16:17         ` Stefan Monnier
2014-01-31  9:52           ` Phillip Lord
2014-01-31 13:35             ` Stefan Monnier
2014-01-31 16:12               ` Phillip Lord
2014-01-30 15:33   ` Andreas Röhler
2014-01-30 15:36     ` Nicolas Richard
2014-01-30 16:43       ` Andreas Röhler
2014-01-31  9:46         ` Phillip Lord

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87txclpj72.fsf@newcastle.ac.uk \
    --to=phillip.lord@newcastle.ac.uk \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.