From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 108ce84 2/2: xref--next-error-function: Move xref's window point Date: Wed, 28 Feb 2018 04:13:22 +0200 Message-ID: <1528a8cd-493c-4219-6eb3-693a28aca5a5@yandex.ru> References: <20180228020456.19376.79157@vcs0.savannah.gnu.org> <20180228020457.59950207B1@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1519783930 5200 195.159.176.226 (28 Feb 2018 02:12:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 28 Feb 2018 02:12:10 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Thunderbird/59.0 To: emacs-devel@gnu.org, Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 28 03:12:06 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqrDx-0000kK-ON for ged-emacs-devel@m.gmane.org; Wed, 28 Feb 2018 03:12:05 +0100 Original-Received: from localhost ([::1]:41420 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqrFy-0007Vq-IG for ged-emacs-devel@m.gmane.org; Tue, 27 Feb 2018 21:14:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqrFL-0007Rs-Lx for emacs-devel@gnu.org; Tue, 27 Feb 2018 21:13:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqrFK-0005FK-OB for emacs-devel@gnu.org; Tue, 27 Feb 2018 21:13:31 -0500 Original-Received: from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229]:44730) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eqrFH-0005EC-17; Tue, 27 Feb 2018 21:13:27 -0500 Original-Received: by mail-wr0-x229.google.com with SMTP id v65so744267wrc.11; Tue, 27 Feb 2018 18:13:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=HVoVGiR99sO+m+ybk//DDHDmU/G3ssYGxAQYLxXpZT4=; b=L+IMU0GoVK6sJ8SleIQbCYN32cEqoXTIR5J7clMxkixk43Nt74sdSKWB+ft8yhC/oS u0et+NcbKq+0Lummg8hcrQm/kM6qvXer6vaIKqDc67EqmDb2fYVNzt44+MBF6XSGJCcR STnYtIvbmzURxEKyNK0AhSbKTW7JgSKyWJOFoO+XbGz/I35TRx1h1Y6qdPYAzm1abVA/ 8xfoAunyT/mNkF7iTyMhVobVQyV7h8tVeyfLtnOJPPx1UiPgS4cBCs6pmYEqVjo7UGEZ I//8txH4w/EYoFkLFQhSXqi71gGnw9saj1LoqkMeBH9uFIbTkg45ipVUqSoYzvMczcTH akrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:references:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=HVoVGiR99sO+m+ybk//DDHDmU/G3ssYGxAQYLxXpZT4=; b=GFntFJbkt8cpcU74vjjsGBUo5W2XK8tX/Jseghc1zrh501DYoJoawJ4y4iwGNSET1J xxTyGBM4TEPTEXg84XZnr40P1YhiMlX053ntc9vUTVhVIoEPNqQpqG7G35xgDfWR948j 5bFdo5qCe0sZxey2gXXjMhRHUVeUKNQ2JLEXuWWE4wu04LcJn1TWPco40DQQVXmcUPD4 ruJ7Y3b4hdzHUQEjylhzdT1M6dU8ho3zRm//+t0ZEzMnJgQe+kPijc+HaYV6CKaUutTA LhMum72rZgoyyONd3l5LzUojOBfcF/OKtkG4DFdweQZBv8dDuJXNmLOPz6Nr9c8rymF/ 9ujw== X-Gm-Message-State: APf1xPDQ2qmiQfqDt04bT+/BMUYecMB+qxxCpTJIP+fQYQX6VLL8Gxmn Pzj5p/O+g27we9W6TPUPSygP1LQ7 X-Google-Smtp-Source: AH8x226dGwwzpqG28yZrAb7hq0oai+/qYcUoCwIbQOpZ+I+dBoYqTjycRuCVvJedInaL98j87DdaIg== X-Received: by 10.223.209.11 with SMTP id a11mr14563918wri.122.1519784005699; Tue, 27 Feb 2018 18:13:25 -0800 (PST) Original-Received: from [192.168.1.3] ([185.105.174.23]) by smtp.googlemail.com with ESMTPSA id 55sm823193wrw.87.2018.02.27.18.13.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 18:13:24 -0800 (PST) In-Reply-To: <20180228020457.59950207B1@vcs0.savannah.gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::229 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:223148 Archived-At: Eli, what would you say about backporting this to emacs-26? This change is limited in scope, it fixes annoying "looping" behavior I've seen in some cases, and it adds window point movement you've asked for before in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20489#110 > branch: master > commit 108ce84432d597f92637ea74bd0a094224d157de > Author: Dmitry Gutov > Commit: Dmitry Gutov > > xref--next-error-function: Move xref's window point > > * lisp/progmodes/xref.el (xref--next-error-function): Move > xref's window point if it's visible. When we don't do that, > navigation can start looping after a while. > --- > lisp/progmodes/xref.el | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el > index 1c1fc59..5a9a7a9 100644 > --- a/lisp/progmodes/xref.el > +++ b/lisp/progmodes/xref.el > @@ -693,6 +693,10 @@ references displayed in the current *xref* buffer." > (dotimes (_ n) > (setq xref (xref--search-property 'xref-item backward))) > (cond (xref > + ;; Save the current position (when the buffer is visible, > + ;; it gets reset to that window's point from time to time). > + (let ((win (get-buffer-window (current-buffer)))) > + (and win (set-window-point win (point)))) > (xref--show-location (xref-item-location xref) t)) > (t > (error "No %s xref" (if backward "previous" "next")))))) > > _______________________________________________ > Emacs-diffs mailing list > Emacs-diffs@gnu.org > https://lists.gnu.org/mailman/listinfo/emacs-diffs >