From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18545: 24.4.50: Bug - forward-line inside with-selected-window Date: Fri, 26 Sep 2014 18:20:48 +0300 Message-ID: <83h9zutnlb.fsf@gnu.org> References: <1532440199.73121411675536923.JavaMail.www@wwinf7125> <83wq8qu9bt.fsf@gnu.org> <83k34qtsqh.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1411745141 32371 80.91.229.3 (26 Sep 2014 15:25:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Sep 2014 15:25:41 +0000 (UTC) Cc: lompik@voila.fr, 18545@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 26 17:25:34 2014 Return-path: 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 ) id 1XXXOk-0001lh-8x for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Sep 2014 17:25:30 +0200 Original-Received: from localhost ([::1]:49853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXXOj-0008Ma-S7 for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Sep 2014 11:25:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXXLY-0003hP-B9 for bug-gnu-emacs@gnu.org; Fri, 26 Sep 2014 11:22:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXXLT-0007o6-Ci for bug-gnu-emacs@gnu.org; Fri, 26 Sep 2014 11:22:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXXLT-0007dl-94 for bug-gnu-emacs@gnu.org; Fri, 26 Sep 2014 11:22:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XXXLN-0001re-Lo for bug-gnu-emacs@gnu.org; Fri, 26 Sep 2014 11:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Sep 2014 15:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18545 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18545-submit@debbugs.gnu.org id=B18545.14117448637074 (code B ref 18545); Fri, 26 Sep 2014 15:22:01 +0000 Original-Received: (at 18545) by debbugs.gnu.org; 26 Sep 2014 15:21:03 +0000 Original-Received: from localhost ([127.0.0.1]:53226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XXXKQ-0001py-ST for submit@debbugs.gnu.org; Fri, 26 Sep 2014 11:21:03 -0400 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:54751) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XXXKN-0001pM-Tx for 18545@debbugs.gnu.org; Fri, 26 Sep 2014 11:21:01 -0400 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NCI00J00L12CA00@mtaout29.012.net.il> for 18545@debbugs.gnu.org; Fri, 26 Sep 2014 18:20:25 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NCI00FYWLA1PW30@mtaout29.012.net.il>; Fri, 26 Sep 2014 18:20:25 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il 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" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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:93772 Archived-At: > From: Stefan Monnier > Cc: lompik@voila.fr, 18545@debbugs.gnu.org > Date: Fri, 26 Sep 2014 10:13:45 -0400 > > >> Why does > >> (with-selected-window (get-buffer-window "*Completions*") > >> (recenter 5)) > >> require an explicit call to wset_redisplay from recenter, whereas > >> (with-selected-window (get-buffer-window "*Completions*") > >> (forward-line 1)) > >> doesn't need an explicit call to wset_redisplay (or bset_redisplay) from > >> forward-line? > > I think that's because forward-line moves point, while recenter > > doesn't. > > But I don't see why moving point would help: calling wset_redisplay > should only change the fact that this window is considered for > redisplay There are redisplay optimizations that don't depend on whether we consider a window for redisplay; see around line 13700 in xdisp.c from emacs-24. You will see a little ways below that place that we test point against its recorded value in w->last_point, for example. > so if it's needed for the recenter case, that means that > without it, the window would not be considered at all 'with-selected-window makes' the offending window selected, and the selected window is always considered for redisplay, right? > which in turn should imply that in the forward-line case we wouldn't > notice that point has changed, unless set_point_both ends up calling > bset_redisplay somehow (but I fail to see how). If you really want me to come up with a detailed explanation of why the forward-line case doesn't need wset_redisplay, I can do that, but it will require some digging. My fixes where based on turning on trace-redisplay and observing thereafter that, in the forward-line case the offending window was shown in the trace, but always with an indication that the forced window-start was OK, whereas in the recenter case the offending window was not shown at all in the trace.