From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: xref window switching problems Date: Thu, 6 Aug 2015 10:05:25 +0300 Message-ID: <55C30735.1040405@yandex.ru> References: <87bnemn8mk.fsf@acer.localhost.com> <55C20298.3010506@yandex.ru> <87mvy5eavy.fsf@acer.localhost.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1438844757 888 80.91.229.3 (6 Aug 2015 07:05:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Aug 2015 07:05:57 +0000 (UTC) To: Ingo Lohmar , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 06 09:05:52 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZNFFP-0007YC-2n for ged-emacs-devel@m.gmane.org; Thu, 06 Aug 2015 09:05:51 +0200 Original-Received: from localhost ([::1]:43629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNFFI-0007Om-MO for ged-emacs-devel@m.gmane.org; Thu, 06 Aug 2015 03:05:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNFF8-0007Nb-6o for emacs-devel@gnu.org; Thu, 06 Aug 2015 03:05:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNFF3-0004SM-2w for emacs-devel@gnu.org; Thu, 06 Aug 2015 03:05:33 -0400 Original-Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]:36091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNFF2-0004Rs-Mb for emacs-devel@gnu.org; Thu, 06 Aug 2015 03:05:28 -0400 Original-Received: by labgo9 with SMTP id go9so43036593lab.3 for ; Thu, 06 Aug 2015 00:05:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=Y6S1MRigfEfj0K2UcREPLGPr2yvZDC+VsTgrUQcEJtY=; b=tFkPqUIa3sxwqa0mQgrfQXNACAlyjyYZx5GErYfBK3XTvMdcy0SQWUVLAPnCd6xNOK 9R6qAjo8YLV8/9o0mCcZh/oqAjnsvjUARvO0nb3MKOl1tR5gBAWpnaqZo3VXWhW51OvB SCwqKMDPfojpkRomeaUv0RGw2C30iLF5J7EAgUYFzkZBrQAJUsotSVTA3HzuHJ7AUugM BRZ9rnnlK+Nb4gVEtCD1d6WdxeV7gFoYqcizmy1Gwux3jZC+vAVol8njLBA1N0HlW/vF bsnsCnrcDOlhN0QMXr7N5RP1+yi634WEMHB/wZoWCafiaa3xnSTqkjYFvvInPPsrd6qK 5CFA== X-Received: by 10.112.135.131 with SMTP id ps3mr157405lbb.84.1438844727802; Thu, 06 Aug 2015 00:05:27 -0700 (PDT) Original-Received: from [192.168.0.110] (95-24-54-142.broadband.corbina.ru. [95.24.54.142]) by smtp.googlemail.com with ESMTPSA id t7sm1138201lag.42.2015.08.06.00.05.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2015 00:05:26 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Thunderbird/40.0 In-Reply-To: <87mvy5eavy.fsf@acer.localhost.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:188475 Archived-At: On 08/05/2015 11:30 PM, Ingo Lohmar wrote: > Maybe I was not expressing my thoughts clearly. Reusing the second > window is what the functions did, and that's just fine --- only the > current window when calling the command should be left alone (and now, > it is). Ah, ok. > Except for factoring out xref--goto-char, your patch looks just like my > private testing. Good. >>> Maybe xref-pop-marker-stack could benefit from a discussion as well. >> >> Maybe it could benefit from a patch proposal. > > That sounds a bit snarky to me... Sorry if it came across wrong. I only meant that a technical proposal would be the best way to start that discussion. > across wrong. Given the preceding sentences (which you did not quote), > I thought it would have been clear this is merely a related > afterthought, and not meant to disparage your work on xref in any way. > In fact, I am happy about that effort to unify and standardize commands. Thank you. > Disclaimer: Recent discussion seems to have centered around the question > if the newly opened file buffers should be cleaned up somehow. I am not > worried nor bothered by having all these buffers opened. It's always > been that way in Emacs, and it's never been a problem for me. It's nice, but there will be scenarios when it's convenient for an xref implementation to open lots of buffers. Depending on you input to xref-find-regexp, likely too many. > I care more (but it's not all that important to me) about the buffers > and points *shown* in windows. In that respect, what if > xref--marker-ring stored, together with the location where > xref-push-marker-stack is called, the window where it is called. That's possible. Although then the callers will have to be more careful and not call it in some intermediate state. > Then > xref-pop-marker-stack could look at the top of the stack and: > - if window is same as current: same as now, ie, goto buffer and point > in same window > - if window is different, still there and showing the buffer of the > stack location, switch to that window and go to location's point Then you'll still have the newly opened window (or this window might've been showing a different buffer before). Still, this could be the best we can reasonably do. > - if the window no longer exists, or shows a different buffer now, use > the current window to switch to the buffer and goto location's point I guess so.