From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!not-for-mail
From: Dima Kogan <dima@secretsauce.net>
Newsgroups: gmane.emacs.bugs
Subject: bug#20206: 25.0.50;
	[PATCH] keep diff-mode's window visible when we visit sources from
	diff-mode
Date: Sun, 29 Mar 2015 13:06:18 -0700
Message-ID: <87pp7rwojr.fsf@secretsauce.net>
References: <87a8yzy5t4.fsf@secretsauce.net> <551456ED.8060101@gmx.at>
	<871tk9y55v.fsf@secretsauce.net> <55167B5F.5040300@gmx.at>
	<87vbhkx054.fsf@secretsauce.net> <55183DD8.8000709@gmx.at>
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: ger.gmane.org 1427659947 8952 80.91.229.3 (29 Mar 2015 20:12:27 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 29 Mar 2015 20:12:27 +0000 (UTC)
Cc: 20206@debbugs.gnu.org
To: martin rudalics <rudalics@gmx.at>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 29 22:12:12 2015
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane.org
Original-Received: from lists.gnu.org ([208.118.235.17])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>)
	id 1YcJZ4-00064Z-Jv
	for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Mar 2015 22:12:10 +0200
Original-Received: from localhost ([::1]:58084 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>)
	id 1YcJZ3-0003sg-VH
	for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Mar 2015 16:12:09 -0400
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47547)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1YcJZ0-0003sQ-19
	for bug-gnu-emacs@gnu.org; Sun, 29 Mar 2015 16:12:06 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1YcJYw-0002SL-PZ
	for bug-gnu-emacs@gnu.org; Sun, 29 Mar 2015 16:12:05 -0400
Original-Received: from debbugs.gnu.org ([140.186.70.43]:50055)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1YcJYw-0002SE-Dk
	for bug-gnu-emacs@gnu.org; Sun, 29 Mar 2015 16:12:02 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1YcJYv-0006Og-SI
	for bug-gnu-emacs@gnu.org; Sun, 29 Mar 2015 16:12:01 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Dima Kogan <dima@secretsauce.net>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sun, 29 Mar 2015 20:12:01 +0000
Resent-Message-ID: <handler.20206.B20206.142765989224554@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 20206
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
Original-Received: via spool by 20206-submit@debbugs.gnu.org id=B20206.142765989224554
	(code B ref 20206); Sun, 29 Mar 2015 20:12:01 +0000
Original-Received: (at 20206) by debbugs.gnu.org; 29 Mar 2015 20:11:32 +0000
Original-Received: from localhost ([127.0.0.1]:39831 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1YcJYR-0006Nx-Q1
	for submit@debbugs.gnu.org; Sun, 29 Mar 2015 16:11:32 -0400
Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:51694)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <dima@secretsauce.net>) id 1YcJYP-0006Np-PG
	for 20206@debbugs.gnu.org; Sun, 29 Mar 2015 16:11:30 -0400
Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
	by mailout.nyi.internal (Postfix) with ESMTP id 8B7F020C89
	for <20206@debbugs.gnu.org>; Sun, 29 Mar 2015 16:11:26 -0400 (EDT)
Original-Received: from frontend2 ([10.202.2.161])
	by compute1.internal (MEProxy); Sun, 29 Mar 2015 16:11:29 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net;
	h=cc:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=134KB
	7dgF3CK4XS8nlh9+o5fhgo=; b=gr4m6CZSaXnJB+oN/zR3xa0KpTRQoJ1Lm5dyk
	IKWYe9xMiUTpiX3o4CdV0EWr7FGKKvuLo5FwpB8FTVpKPVh1/JaMC/7Moe+lGcs+
	1ResrD7+zAGgUbzlnCCoqPn1z/K6kz0UTd8OD+GslrQE5AZXSU0y+dO6eaTZ3UMC
	ivtKYk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to:x-sasl-enc
	:x-sasl-enc; s=smtpout; bh=134KB7dgF3CK4XS8nlh9+o5fhgo=; b=HvdWs
	xWzzeGr92fDfp0OOubrDZI4ivnRJbrAiT25/ti28t4vcDrB1hxetzYqno1A/IGJt
	k98Toz47S8kpLtCLK/JfLDVqYyWDfC561c9r8V0SHgtws0M2HvDwYxxNf4pdQLQr
	9yFDb9Ghp/VnHDgMrQ94Zps5UxQZ3Cfr/ikBf4=
X-Sasl-enc: JwgzOo5MKujTGTKQzg3Z7KLayvk/kjmVD4XFaODKztRT 1427659889
Original-Received: from shorty.local (unknown [104.35.103.243])
	by mail.messagingengine.com (Postfix) with ESMTPA id 4C7A6680109;
	Sun, 29 Mar 2015 16:11:29 -0400 (EDT)
Original-Received: from ip6-localhost ([::1] helo=shorty)
	by shorty.local with esmtp (Exim 4.84)
	(envelope-from <dima@secretsauce.net>)
	id 1YcJZY-0004MF-3U; Sun, 29 Mar 2015 13:12:40 -0700
In-reply-to: <55183DD8.8000709@gmx.at>
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 140.186.70.43
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
	the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org
Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org
Xref: news.gmane.org gmane.emacs.bugs:101031
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/101031>

martin rudalics <rudalics@gmx.at> writes:

>  >    (find-file "dat")
>  >    (find-file "dat.patch")        # open both files; one window/frame
>
> You here ...
>
>  >    (split-window-horizontally)    # two windows; both show "dat.patch"
>  >    (other-window 1)               # switch to right window
>  >    (switch-to-buffer "asdf")      # switch to dummy "asdf" buffer
>  >    (other-window 1)               # left window active with "dat.patch",
>  >                                   # right shows "asdf"
>  >
>  >    (switch-to-buffer "dat")
>  >    (switch-to-buffer "dat.patch") # left window: show "dat" and then back
>  >                                   # to "dat.patch"
>
> ... and here tell Emacs that you very much like having dat and dat.patch
> share the same window.  OTOH, the split-window-horizontally,
> other-window, switch-to-buffer "asdf" sequence indicates that you rather
> want the other window keep showing asdf.  So `display-buffer' will have
> a hard time concluding here ...
>
>  >    (diff-goto-source))            # navigate to the diff source
>
> ... that you want to show dat in the window formerly occupied by asdf.

Well sure. This was a contrived example specifically constructed to show
this behavior. The original bug report came from seeing this during
normal use of gud, so I still think the complaint is valid.


>  > In emacs23 the "dat" buffer is shown in the window OTHER than the one
>  > showing the diff. In emacs24, the diff window is covered up.
>
> I see.  I don't yet have a solution for this.

I think this is only a question of defaults. Specifically, any time we
(pop-to-buffer) or (display-buffer) in response to an interactive user
action, we should default to not covering up the user's buffer. This
would apply to use cases like gud, diff, cscope and so on. I don't know
enough about the development of this to know if it makes sense to change
the defaults only in the interactive case or in general. Do you see
reasons to keep the default as it is?