all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Anders Lindgren <andlind@gmail.com>
To: 16431@debbugs.gnu.org
Subject: bug#16431: 24.3.50; `follow-adjust-windows' sometimes fails (patch included)
Date: Mon, 13 Jan 2014 13:13:49 +0100	[thread overview]
Message-ID: <CABr8ebYiveqP+fK-RM_ZvvhLmTOy+1yugg-5+_RJK1=3a8HrrA@mail.gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2014-01-13 12:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-13 12:13 Anders Lindgren [this message]
2014-01-16  4:39 ` bug#16431: 24.3.50; `follow-adjust-windows' sometimes fails (patch included) 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABr8ebYiveqP+fK-RM_ZvvhLmTOy+1yugg-5+_RJK1=3a8HrrA@mail.gmail.com' \
    --to=andlind@gmail.com \
    --cc=16431@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.