From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anders Lindgren Newsgroups: gmane.emacs.bugs Subject: bug#16431: 24.3.50; `follow-adjust-windows' sometimes fails (patch included) Date: Mon, 13 Jan 2014 13:13:49 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e01493de01d95b904efd902f1 X-Trace: ger.gmane.org 1389615251 521 80.91.229.3 (13 Jan 2014 12:14:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 Jan 2014 12:14:11 +0000 (UTC) To: 16431@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 13 13:14:15 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 1W2gPE-0002I9-SQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Jan 2014 13:14:13 +0100 Original-Received: from localhost ([::1]:42012 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2gPE-0002wL-Ds for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Jan 2014 07:14:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2gP8-0002wF-Mk for bug-gnu-emacs@gnu.org; Mon, 13 Jan 2014 07:14:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W2gP4-0004Mu-Sq for bug-gnu-emacs@gnu.org; Mon, 13 Jan 2014 07:14:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2gP4-0004Mq-P6 for bug-gnu-emacs@gnu.org; Mon, 13 Jan 2014 07:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W2gP4-0007r4-He for bug-gnu-emacs@gnu.org; Mon, 13 Jan 2014 07:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Anders Lindgren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Jan 2014 12:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16431 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.138961524130175 (code B ref -1); Mon, 13 Jan 2014 12:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Jan 2014 12:14:01 +0000 Original-Received: from localhost ([127.0.0.1]:48532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W2gP1-0007qc-RC for submit@debbugs.gnu.org; Mon, 13 Jan 2014 07:14:00 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43646) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W2gOy-0007qT-9R for submit@debbugs.gnu.org; Mon, 13 Jan 2014 07:13:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W2gOw-0004LO-Fb for submit@debbugs.gnu.org; Mon, 13 Jan 2014 07:13:56 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:39792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2gOw-0004LK-Cv for submit@debbugs.gnu.org; Mon, 13 Jan 2014 07:13:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2gOu-0002uE-LG for bug-gnu-emacs@gnu.org; Mon, 13 Jan 2014 07:13:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W2gOs-0004L6-CC for bug-gnu-emacs@gnu.org; Mon, 13 Jan 2014 07:13:52 -0500 Original-Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]:35120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2gOs-0004Kn-1d for bug-gnu-emacs@gnu.org; Mon, 13 Jan 2014 07:13:50 -0500 Original-Received: by mail-wi0-f176.google.com with SMTP id hq4so2098150wib.15 for ; Mon, 13 Jan 2014 04:13:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=q4yO5aojriXiIJMDseLjqbxOopQe0DUrL9K+0k2E3gk=; b=YGJ3Y+VNPKrOpbjfZx7dkIgGoPd2vnmm9gBUHohwaRLpUMA9pYtevksmJeOVZ3Jh9d 3uN34KTi/QCsqguhg7dfEfaWZuyzl4b4YfePTdfjFRfcUqUdmEjAw2cw8VVxOdtwEtbm PSgXRuRHP5vr9kzkFVhONGFZ733sdcT6ia4dfKMLyhQAa7VBg1+m2Gk0EHkTDzJHbPcQ sMrFcDFiFLAXr2xdXUvKRNpqsn+74X7cxR8/LbFrzB3rZtZvF0pWdqrJIOnpZ+XuUqrS ZSmpPw+lTns7xsJ/vMk9jmwno9bhvYrR/39hipygslDGwk52kUOJBMaWVmHMvMSsUQrS 5nHw== X-Received: by 10.194.236.9 with SMTP id uq9mr21440178wjc.31.1389615229275; Mon, 13 Jan 2014 04:13:49 -0800 (PST) Original-Received: by 10.216.187.199 with HTTP; Mon, 13 Jan 2014 04:13:49 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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:83398 Archived-At: --089e01493de01d95b904efd902f1 Content-Type: text/plain; charset=ISO-8859-1 The function `follow-adjust-windows' (part of follow-mode) sometimes fails. Steps to repeat: emacs -Q C-h t C-x 3 C-x 3 M-x balance-windows RET C-x b *scratch* RET Eval the following three expressions: (require 'follow) (let ((owin (selected-window))) (select-window (next-window)) (let ((follow-mode t)) (follow-adjust-window (selected-window) (point-min))) (select-window owin)) OK here, beginning of the buffer is visible. (let ((owin (selected-window))) (select-window (next-window)) (let ((follow-mode t)) (follow-adjust-window (selected-window) (/ (point-max) 2)) (select-window owin))) Here, the intention is that the middle of the buffer should be visible. It's not. This is broken in 24.3 as well as on the trunk. The function was introduced in 24.3, even though similar code was present in `follow-post-command-hook' earlier. This is due to the fact that the function calls `(redisplay)'. However, this work on the current point, which has not been maintained. Fortunately, there seems to be an easy fix, see patch below: 1226,1232c1226,1232 < (goto-char dest) < (redisplay) < ;; If this `redisplay' moved point, we got clobbered by a < ;; previous call to `set-window-start'. Try again. < (when (/= (point) dest) < (goto-char dest) < (redisplay)) --- > (let ((opoint (point))) > (redisplay) > ;; If this `redisplay' moved point, we got clobbered by a > ;; previous call to `set-window-start'. Try again. > (when (/= (point) opoint) > (goto-char opoint) > (redisplay))) Sincerely, Anders Lindgren Ps. I'm the original author of Follow mode, even though I haven't worked on the package for many years. In GNU Emacs 24.3.50.2 (x86_64-apple-darwin13.0.0, NS apple-appkit-1265.00) of 2014-01-13 on macpro.lan Repository revision: 116005 juri@jurta.org-20140113080409-nncncbxckrayrogi Windowing system distributor `Apple', version 10.3.1265 Configured using: `configure --with-ns' Important settings: value of $LC_CTYPE: UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-j C-e ( / SPC d ( p o i n t SPC 2 C-e ) C-j C-e C-j C-e C-j C-SPC w C-x o C-s a d j u s t C-w C-s C-s C-s C-a C-s a d j u s t - w C-w s-b s-b s-b s-b s-b b b b C-s C-w C-w C-w C-s C-s C-a C-SPC C-f w C-x p C-x o C-x o > C-y ( C-a C-k C-k ( g t o o t o - c h a r SPC d e s t ) C-a C-x C-s C-g C-x < C-x C-x C-a C-SPC C-w C-x C-s C-g x e m a c s - r e p r e p o r t - b Recent messages: C-x p is undefined Mark set [2 times] Quit follow-adjust-window Mark set Beginning of buffer # [2 times] Mark set Quit is undefined Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils misearch multi-isearch vc-bzr jka-compr find-func pp help-fns follow debug tutorial help-mode easymenu time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process cocoa ns multi-tty emacs) --089e01493de01d95b904efd902f1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
The function `follow-adjust-windows' (part of fol= low-mode) sometimes fails. Steps to repeat:

=A0 = =A0 emacs -Q
=A0 =A0 C-h t
=A0 =A0 C-x 3
=A0 = =A0 C-x 3
=A0 =A0 M-x balance-windows RET
=A0 =A0 C-x b *scratch* RET
=
=A0 =A0 Eval the following three expressions:

(require 'follow)

(let ((owin (selected-= window)))
=A0 (select-window (next-window))
=A0 (let ((follow-mode t))=
=A0 =A0 (follow-adjust-window (selected-window) (point-min)))
=A0 (select-window owin))

OK here, beginni= ng of the buffer is visible.

(let ((owin (selected-window)))
=A0 (select-w= indow (next-window))
=A0 (let ((follow-mode t))
=A0 =A0= (follow-adjust-window (selected-window) (/ (point-max) 2))
=A0 (= select-window owin)))

Here, the intention is that the middle of the buf= fer should be visible. It's not.

This is broke= n in 24.3 as well as on the trunk. The function was introduced in 24.3, eve= n though similar code was present in `follow-post-command-hook' earlier= .

This is due to the fact that the function calls `(redis= play)'. However, this work on the current point, which has not been mai= ntained. Fortunately, there seems to be an easy fix, see patch below:

1226,1232c1226,1232

< =A0 =A0 =A0 =A0 =A0 (goto-char dest)

< =A0 =A0 =A0 =A0 =A0 (redisplay)

< =A0 =A0 =A0 =A0 =A0 ;; If this `redisplay' moved poi= nt, we got clobbered by a

< =A0 =A0 =A0 =A0 =A0 ;; previous call to `set-window-star= t'.=A0 Try again.

< =A0 =A0 =A0 =A0 =A0 (when (/=3D (point) dest)

< =A0 =A0 =A0 =A0 =A0 =A0 (goto-char dest)

< =A0 =A0 =A0 =A0 =A0 =A0 (redisplay))

---

> =A0 (let ((opoint (point)))

> =A0 =A0 (redisplay)

> =A0 =A0 ;; If this `redisplay&#= 39; moved point, we got clobbered by a

> =A0 =A0 ;; previous call to `se= t-window-start'.=A0 Try again.

> =A0 =A0 (when (/=3D (point) opo= int)

> =A0 =A0 =A0 (goto-char opoint)<= /p>

> =A0 =A0 =A0 (redisplay)))

Sincerely,
=A0 =A0 Anders Lindgren

<= div>
Ps. I'm the original author of Follow mode, even tho= ugh I haven't worked on the package for many years.


In GNU Emacs 24.3.50.2 (x86_64-apple-dar= win13.0.0, NS apple-appkit-1265.00)
=A0of 2014-01-13 on macpro.la= n
Repository revision: 116005 juri@jurta.org-20140113080409-nncncbxckray= rogi
Windowing system distributor `Apple', version 10.3.1265<= /div>
Configured using:
=A0`configure --with-ns'

Important settings:
=A0 value of $LC_CTYPE: UTF-8<= /div>
=A0 locale-coding-system: utf-8-unix

Maj= or mode: Lisp Interaction

Minor modes in effect:
=A0 tooltip-mode: t
=A0 electric-indent-mode: t
= =A0 mouse-wheel-mode: t
=A0 tool-bar-mode: t
=A0 menu-b= ar-mode: t
=A0 file-name-shadow-mode: t
=A0 global-font= -lock-mode: t
=A0 font-lock-mode: t
=A0 blink-cursor-mode: t
=A0= auto-composition-mode: t
=A0 auto-encryption-mode: t
= =A0 auto-compression-mode: t
=A0 line-number-mode: t
= =A0 transient-mark-mode: t

Recent input:
<left> <left> <l= eft> <left> <left> <left> <left> <left>=A0=
<left> <down> C-j <up> <up> <up> C= -e <left> <left>=A0
<left> <left> <left> <left> <left> <l= eft> <left> <left>=A0
<left> <left> &l= t;left> ( / SPC <C-s-268632070> <escape>=A0
d ( p = o i n t <right> <right> <right> <right> <right&g= t;=A0
SPC 2 C-e <down> ) C-j <up> <up> <up> <up&g= t; <up> <up>=A0
<up> <up> C-e C-j <dow= n> <down> <down> <down> <down>=A0
<= down> C-e C-j <up> C-SPC <up> <up> <up> <up&g= t; <up>=A0
<up> <up> <up> <up> <up> <up> <= up> <up> <up> <up> <escape>=A0
w C-x o= C-s a d j u s t C-w C-s C-s C-s C-a C-s a d=A0
j u s t - w C-w s= -b s-b s-b s-b s-b <escape> b <escape>=A0
b <escape> b C-s C-w C-w C-w C-s C-s C-a C-SPC <C-s-268632070= >=A0
<escape> C-f <escape> w C-x p C-x o C-x o <= ;escape>=A0
> C-y <up> <up> <up> <up&g= t; <up> <up> <up> <up> <up>=A0
<up> <up> <up> <up> <up> <up> <= up> <up> <up> <up> <up>=A0
<up> = <up> <up> <up> <up> <up> <up> <up>= ; <up> <up> <up>=A0
<up> <up> <up> <up> <up> <up> <= up> <up> <up> <up> <up>=A0
<up> = <up> <up> <up> <return> ( C-a C-k C-k <up> &l= t;return>=A0
<up> <tab> ( g t o <backspace> <backspace> o t= o -=A0
c h a r SPC d e s t ) C-a C-x C-s C-g <down> <do= wn>=A0
<escape> C-x <escape> < <up> <d= own> <down> <down> <down>=A0
<down> <right> <right> <right> <down> &l= t;down> <down>=A0
<down> <escape> C-x <do= wn> <down> <down> <down> <down>=A0
<= ;down> <down> <down> <escape> C-x <up> <up>= ; <up> <up>=A0
<up> C-a C-SPC <down> C-w C-x C-s C-g <escape> x e= =A0
m a c s - r e p <tab> <backspace> <tab> <= ;backspace>=A0
<backspace> <s-backspace> <backs= pace> <backspace> <backspace>=A0
<backspace> <backspace> <backspace> r e p o r t - b= =A0
<tab> <return>

Recent me= ssages:
C-x p is undefined
Mark set [2 times]
Quit
follow-adjust-window
Mark set
Beginning = of buffer
#<window 3 on *scratch*> [2 times]
Mark= set
Quit
<s-backspace> is undefined

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message= format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mai= l-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
=
mail-prsvr mail-utils misearch multi-isearch vc-bzr jka-compr find-fun= c
pp help-fns follow debug tutorial help-mode easymenu time-date = tooltip
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomm= ent
lisp-mode prog-mode register page menu-bar rfn-eshadow timer = select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame ch= am
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet= lao
korean japanese hebrew greek romanian slovak czech european = ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple<= /div>
abbrev minibuffer nadvice loaddefs button faces cus-face macroexp= files
text-properties overlay sha1 md5 base64 format env code-pa= ges mule
custom widget hashtable-print-readable backquote make-network-process<= /div>
cocoa ns multi-tty emacs)

--089e01493de01d95b904efd902f1--