From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#13248: 24.2.50; select-window moves point (in comint-postoutput-scroll-to-bottom) Date: Fri, 21 Dec 2012 15:25:07 +0100 Message-ID: <50D47143.40702@gmx.at> References: <87a9t7bl8o.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1356099966 24298 80.91.229.3 (21 Dec 2012 14:26:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Dec 2012 14:26:06 +0000 (UTC) Cc: 13248@debbugs.gnu.org To: Vitalie Spinu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 21 15:26:21 2012 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 1Tm3YK-0000OK-GH for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Dec 2012 15:26:20 +0100 Original-Received: from localhost ([::1]:60811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm3Y6-0007Xe-P6 for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Dec 2012 09:26:06 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm3Xz-0007SX-Il for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 09:26:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tm3Xq-00047p-EY for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 09:25:59 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43422) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm3Xq-00047l-BE for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 09:25:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tm3Y2-0005qF-Qd for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2012 09:26:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Dec 2012 14:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13248 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13248-submit@debbugs.gnu.org id=B13248.135609994622428 (code B ref 13248); Fri, 21 Dec 2012 14:26:02 +0000 Original-Received: (at 13248) by debbugs.gnu.org; 21 Dec 2012 14:25:46 +0000 Original-Received: from localhost ([127.0.0.1]:53672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm3XY-0005pQ-J1 for submit@debbugs.gnu.org; Fri, 21 Dec 2012 09:25:39 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:54563) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tm3XT-0005pF-G8 for 13248@debbugs.gnu.org; Fri, 21 Dec 2012 09:25:29 -0500 Original-Received: from mailout-de.gmx.net ([10.1.76.19]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0LzEj9-1Szx0K0N6X-014Ur1 for <13248@debbugs.gnu.org>; Fri, 21 Dec 2012 15:25:13 +0100 Original-Received: (qmail invoked by alias); 21 Dec 2012 14:25:12 -0000 Original-Received: from 62-47-34-50.adsl.highway.telekom.at (EHLO [62.47.34.50]) [62.47.34.50] by mail.gmx.net (mp019) with SMTP; 21 Dec 2012 15:25:12 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+RzIoqxx+RINSnY/RR1s0mrIM80vakWfwwlAbfyH 5bE5+NOnK+dtYG In-Reply-To: <87a9t7bl8o.fsf@gmail.com> X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:68854 Archived-At: > Here is what I found during my investigation. It happens with > (select-window w) in the `comint-postoutput-scroll-to-bottom' > (reproduced below). I was monitoring the value of the (point) just > before and after it, and it looks like this: > > before (point):9943 > after (point):8619 > > So the point is clearly moved in select-window. Moreover the (point) > equals (window-end) just before select-window is called, so it is > visible. Consequently, the following (comint-adjust-point selected) is= > completely screwed because it relies on point *not* being moved! > > Here is a relevant piece of `comint-postoutput-scroll-to-bottom' > > > =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80 #2124 =E2=94=80 /home/vitoshka/TVC/emacs/lisp/comint.el =E2=94=80= =E2=94=80 > =E2=94=82 (dolist (w (get-buffer-window-list current nil t)) > =E2=94=82 (select-window w) > =E2=94=82 (unwind-protect > =E2=94=82 (progn > =E2=94=82 (comint-adjust-point selected) > =E2=94=82 ;; Optionally scroll to the bottom of the window. > =E2=94=82 (and comint-scroll-show-maximum-output > =E2=94=82 (eobp) > =E2=94=82 (recenter (- -1 scroll-margin)))) > =E2=94=82 (select-window selected)))))) > =E2=94=82 (set-buffer current)))) > =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80 #2134 =E2=94=80 > > > The variable `comint-scroll-show-maximum-output' is the default t, thi= s > is why comint runs `comint-postoutput-scroll-to-bottom' in its > `comint-output-filter-functions'. > > I can propose a patch for commit to reset the point, but it looks like= > there is something much more fundamental going on in here. select_window (in window.c) has the following comment /* Go to the point recorded in the window. This is important when the buffer is in more than one window. It also matters when redisplay_window has altered point after scrolling, because it makes the change only in the window. */ Is it this behavior that bothers you? IIUC what you want in `comint-postoutput-scroll-to-bottom' is to `set-window-point' of the respective window. If you really want to move `point' in a buffer _and_ show the effect in a window, do it with that window selected. martin