unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16431: 24.3.50; `follow-adjust-windows' sometimes fails (patch included)
@ 2014-01-13 12:13 Anders Lindgren
  2014-01-16  4:39 ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Anders Lindgren @ 2014-01-13 12:13 UTC (permalink / raw)
  To: 16431

[-- Attachment #1: Type: text/plain, Size: 5390 bytes --]

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:
<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 d
j 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 e
m 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 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 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)

[-- Attachment #2: Type: text/html, Size: 8550 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-01-16 21:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-13 12:13 bug#16431: 24.3.50; `follow-adjust-windows' sometimes fails (patch included) Anders Lindgren
2014-01-16  4:39 ` Stefan Monnier
2014-01-16 10:03   ` martin rudalics
2014-01-16 10:20   ` Anders Lindgren
2014-01-16 14:25     ` Stefan Monnier
2014-01-16 15:51       ` Anders Lindgren
2014-01-16 17:57         ` Eli Zaretskii
2014-01-16 18:43         ` Stefan Monnier
2014-01-16 17:56       ` Eli Zaretskii
2014-01-16 17:53   ` Eli Zaretskii
2014-01-16 18:58     ` Stefan Monnier
2014-01-16 21:38       ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).