From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#16431: 24.3.50; `follow-adjust-windows' sometimes fails (patch included) Date: Wed, 15 Jan 2014 23:39:50 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1389847218 20048 80.91.229.3 (16 Jan 2014 04:40:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Jan 2014 04:40:18 +0000 (UTC) Cc: 16431@debbugs.gnu.org To: Anders Lindgren Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 16 05:40:22 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 1W3ekf-0005NR-VK for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Jan 2014 05:40:22 +0100 Original-Received: from localhost ([::1]:58355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3ekf-0007ut-J1 for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Jan 2014 23:40:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3ekU-0007jH-54 for bug-gnu-emacs@gnu.org; Wed, 15 Jan 2014 23:40:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3ekM-0003P5-RS for bug-gnu-emacs@gnu.org; Wed, 15 Jan 2014 23:40:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3ekM-0003Og-ON for bug-gnu-emacs@gnu.org; Wed, 15 Jan 2014 23:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W3ekM-00082o-Ci for bug-gnu-emacs@gnu.org; Wed, 15 Jan 2014 23:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Jan 2014 04:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16431 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16431-submit@debbugs.gnu.org id=B16431.138984719430899 (code B ref 16431); Thu, 16 Jan 2014 04:40:02 +0000 Original-Received: (at 16431) by debbugs.gnu.org; 16 Jan 2014 04:39:54 +0000 Original-Received: from localhost ([127.0.0.1]:52722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W3ekD-00082J-Pd for submit@debbugs.gnu.org; Wed, 15 Jan 2014 23:39:54 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:60091) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W3ekB-00082A-89 for 16431@debbugs.gnu.org; Wed, 15 Jan 2014 23:39:51 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFMCoyj/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2RCgOIYYl5kiCBXoMV X-IPAS-Result: Av8EABK/CFFMCoyj/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2RCgOIYYl5kiCBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="45080060" Original-Received: from 76-10-140-163.dsl.teksavvy.com (HELO pastel.home) ([76.10.140.163]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 15 Jan 2014 23:39:50 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 578C760073; Wed, 15 Jan 2014 23:39:50 -0500 (EST) In-Reply-To: (Anders Lindgren's message of "Mon, 13 Jan 2014 13:13:49 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) 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:83574 Archived-At: > (let ((owin (selected-window))) > (select-window (next-window)) > (let ((follow-mode t)) > (follow-adjust-window (selected-window) (/ (point-max) 2)) > (select-window owin))) This recipe doesn't work any more now that follow-adjust-window only takes a single argument. Do you have some other way to reproduce the original problem (or has it been accidentally fixed by my recent commit)? > 1226,1232c1226,1232 > < (goto-char dest) > < (redisplay) Your patch (just like the one in your other bug-report) has spurious empty lines between every actual line. Also I think it was reversed (at least the "destination" code is the one that's been in Emacs for a while now). Finally, please use "diff -u" or "diff -c" format for patches. And since I'm here, thinking about how to better support follow-mode, here's an idea: IIUC the main problem currently (other than the "empty last buffers") is that we have to redisplay in order to find the window-end, after which we can adjust subsequent windows, and force another redisplay. So we'd like redisplay of the various windows to be done "in the right order" and be able to run some Elisp code in-between. One option for that would be to provide a new `redisplay-window' function which does a redisplay of only one window, and then use it inside pre-redisplay-function. This way, when we do a normal redisplay, our follow-pre-redisplay-function would check if some of the windows use follow-mode. If so, follow-pre-redisplay-function would redisplay its windows "manually" in the right order via `redisplay-window' (and setup window-starts between each window, as appropriate). After that the normal redisplay would continue and would find those windows "already up-to-date", which would avoid the double-redisplay. Stefan