|
From: | GNU bug Tracking System |
Subject: | [debbugs-tracker] bug#16431: closed (24.3.50; `follow-adjust-windows' sometimes fails (patch included)) |
Date: | Thu, 16 Jan 2014 14:26:02 +0000 |
Your message dated Thu, 16 Jan 2014 09:25:46 -0500 with message-id <address@hidden> and subject line Re: bug#16431: 24.3.50; `follow-adjust-windows' sometimes fails (patch included) has caused the debbugs.gnu.org bug report #16431, regarding 24.3.50; `follow-adjust-windows' sometimes fails (patch included) to be marked as done. (If you believe you have received this mail in error, please contact address@hidden) -- 16431: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16431 GNU Bug Tracking System Contact address@hidden with problems
--- Begin Message ---Subject: 24.3.50; `follow-adjust-windows' sometimes fails (patch included) Date: Mon, 13 Jan 2014 13:13:49 +0100 The function `follow-adjust-windows' (part of follow-mode) sometimes fails. Steps to repeat:emacs -QC-h tC-x 3C-x 3M-x balance-windows RETC-x b *scratch* RETEval 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 LindgrenPs. 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.lanRepository revision: 116005 address@hiddenWindowing system distributor `Apple', version 10.3.1265Configured using:`configure --with-ns'Important settings:value of $LC_CTYPE: UTF-8locale-coding-system: utf-8-unixMajor mode: Lisp InteractionMinor modes in effect:tooltip-mode: telectric-indent-mode: tmouse-wheel-mode: ttool-bar-mode: tmenu-bar-mode: tfile-name-shadow-mode: tglobal-font-lock-mode: tfont-lock-mode: tblink-cursor-mode: tauto-composition-mode: tauto-encryption-mode: tauto-compression-mode: tline-number-mode: ttransient-mark-mode: tRecent input:<left> <left> <left> <left> <left> <left> <left> <left><left> <down> C-j <up> <up> <up> C-e <left> <left><left> <left> <left> <left> <left> <left> <left> <left><left> <left> <left> ( / SPC <C-s-268632070> <escape>d ( p o i n t <right> <right> <right> <right> <right>SPC 2 C-e <down> ) C-j <up> <up> <up> <up> <up> <up><up> <up> C-e C-j <down> <down> <down> <down> <down><down> C-e C-j <up> C-SPC <up> <up> <up> <up> <up><up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <escape>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 dj u s t - w C-w s-b s-b s-b s-b s-b <escape> b <escape>b <escape> b C-s C-w C-w C-w C-s C-s C-a C-SPC <C-s-268632070><escape> C-f <escape> w C-x p C-x o C-x o <escape>> C-y <up> <up> <up> <up> <up> <up> <up> <up> <up><up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up><up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up><up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up><up> <up> <up> <up> <return> ( C-a C-k C-k <up> <return><up> <tab> ( g t o <backspace> <backspace> o t o -c h a r SPC d e s t ) C-a C-x C-s C-g <down> <down><escape> C-x <escape> < <up> <down> <down> <down> <down><down> <right> <right> <right> <down> <down> <down><down> <escape> C-x <down> <down> <down> <down> <down><down> <down> <down> <escape> C-x <up> <up> <up> <up><up> C-a C-SPC <down> C-w C-x C-s C-g <escape> x em a c s - r e p <tab> <backspace> <tab> <backspace><backspace> <s-backspace> <backspace> <backspace> <backspace><backspace> <backspace> <backspace> r e p o r t - b<tab> <return>Recent messages:C-x p is undefinedMark set [2 times]Quitfollow-adjust-windowMark setBeginning of buffer#<window 3 on *scratch*> [2 times]Mark setQuit<s-backspace> is undefinedLoad-path shadows:None found.Features:(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mmlmml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrevgmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-utilmail-prsvr mail-utils misearch multi-isearch vc-bzr jka-compr find-funcpp help-fns follow debug tutorial help-mode easymenu time-date tooltipelectric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-wintool-bar dnd fontset image regexp-opt fringe tabulated-list newcommentlisp-mode prog-mode register page menu-bar rfn-eshadow timer selectscroll-bar mouse jit-lock font-lock syntax facemenu font-core frame chamgeorgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet laokorean japanese hebrew greek romanian slovak czech european ethiopicindian cyrillic chinese case-table epa-hook jka-cmpr-hook help simpleabbrev minibuffer nadvice loaddefs button faces cus-face macroexp filestext-properties overlay sha1 md5 base64 format env code-pages mulecustom widget hashtable-print-readable backquote make-network-processcocoa ns multi-tty emacs)
--- End Message ---
--- Begin Message ---Subject: Re: bug#16431: 24.3.50; `follow-adjust-windows' sometimes fails (patch included) Date: Thu, 16 Jan 2014 09:25:46 -0500 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) > You can close it for now and if I see the problem again, I will let you know. Done, thanks. > One thing still seems to be problematic -- `follow-adjust-window' only work > properly when `win' is *selected*. Indeed, I was tempted to add a (cl-assert (eq win (selected-window))) or to remove the `win' argument altogether. I didn't do it mostly because I remembered that we're in feature freeze. > In other words, that I would like to see is the following: > (let ((source-pos ....)) > (with-current-buffer (window-buffer win) > (goto-char source-pos) > (follow-adjust-window win))) I don't understand why you'd want to compute source-pos while outside of (window-buffer win). > When windows are aligned, Follow mode does not set the window start or do > anything else to disturb the redisplay. In my suggested approach, when windows are aligned, after each call to redisplay-window, window-end is cheap (since it was just computed and is hence marked as up-to-date) and since the windows are already properly aligned you'd find that window-start does not need to be updated, which in turn would ensure that the next redisplay-window is also cheap. > In this scenario it would definitively help if there were a "window-only > redisplay" or, even better, a "silent redisplay" that would calculate where > the window would end up, but not actually draw anything. (Here, I must > admit that my knowledge of the display engine is limited.) My intention would be for redisplay-window to only update the matrices (i.e. the internal representation of the rendered window) and let the subsequent full redisplay deal with updating the display. My knowledge of the display engine is also limited, but I think such a redisplay-window function should not be too hard to write. Stefan
--- End Message ---
[Prev in Thread] | Current Thread | [Next in Thread] |