unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Dima Kogan <dima@secretsauce.net>
Cc: 16904@debbugs.gnu.org
Subject: bug#16904: 24.3; [PATCH] ff-find-other-file and friends now work with indirect clone buffers
Date: Mon, 10 Mar 2014 01:00:51 -0400	[thread overview]
Message-ID: <jwv4n36br2a.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <87eh2a3f2l.fsf@secretsauce.net> (Dima Kogan's message of "Sun, 09 Mar 2014 20:30:58 -0700")

>> Multiple narrowing within the same buffer is indeed not supported, but
>> we could easily add commands to "hide everything but the current region"
>> which are per-window, where "hide" means "make invisible" rather than
>> making it completely inaccessible as narrowing does.
> Is the intent for this to replace narrowing?

Not "replace", but yes, it would be a new similar feature.

> I think it would be confusing to have two very similar but subtly
> different mechanisms for doing the same thing.

Agreed.  But if we want several separate narrowings at the same time in
a single buffer (i.e. without using indirect buffers), then I think
that's what it would look like.

I imagine it would come as an Elisp package which would replace C-x n n,
for those rare users like you who want such a functionality.

>> As for separate mark-rings, I'm not sure what alternative I can offer.
>> Maybe we could have some kind of new command `pop-to-nearest-mark'?
> Maybe. That's brittle, though.

Yes, clearly.

> Here's another way in which an indirect view into a buffer is better
> than another window: iswitchb (and maybe other C-x b methods too) sorts
> already-visible windows last. This usually results in way more typing
> when trying to switch in this way.

Interesting point, indeed.

> Hmmm. You could set the buffer-file-name variable when the indirect
> buffer is created.

It's set to nil to avoid problems linked to having to handle "multiple
buffers accessing the same file".  We'd otherwise have to add special
code so that (for example) when you save one of the buffers, the
others's states are correspondingly updated (otherwise they'd think that
some external process changed the file).

> I guess I just don't know about (and haven't seen any) fundamental
> breakage in indirect buffers, so my current instinct is to try to fix
> it, rather than switch to something else entirely.  Most of the issues
> I've seen are small things, like modules that use (buffer-file-name).

There's some major breakage lurking with most modes that use
things like text-properties or after-change-functions.

A way to "fix" things might be to restrict the use of indirect clones so
they are read-only.

> What issues are there with indirect buffers? The default C-x 4 c binding
> makes an indirect clone, so it's not THAT obscure.

I know.  It seemed like a good idea at the time ;-(


        Stefan





  reply	other threads:[~2014-03-10  5:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28 11:17 bug#16904: 24.3; [PATCH] ff-find-other-file and friends now work with indirect clone buffers Dima Kogan
2014-03-07 22:53 ` Stefan Monnier
2014-03-08  2:23   ` Dima Kogan
2014-03-10  2:41     ` Stefan Monnier
2014-03-10  3:30       ` Dima Kogan
2014-03-10  5:00         ` Stefan Monnier [this message]
2016-02-24  3:02 ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwv4n36br2a.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=16904@debbugs.gnu.org \
    --cc=dima@secretsauce.net \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).