* bug#925: 23.0.60; follow-mode doesn't work in buffers with a header line
@ 2008-09-07 22:26 ` Phil Sung
2008-09-08 16:08 ` martin rudalics
2008-10-28 17:55 ` bug#925: marked as done (23.0.60; follow-mode doesn't work in buffers with a header line) Emacs bug Tracking System
0 siblings, 2 replies; 5+ messages in thread
From: Phil Sung @ 2008-09-07 22:26 UTC (permalink / raw
To: emacs-pretest-bug
Steps to reproduce:
0. emacs -Q
1. C-h r [info-emacs-manual]
2. C-x 3 [split-window-horizontally]
3. M-x follow-mode
4. C-n until point moves past bottom of window
Expected results:
Point moves to top of next window.
Actual results:
First window scrolls down and then recenters around point.
In GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.13.7)
of 2008-08-31 on iridium, modified by Debian
(emacs-snapshot package, version 1:20080831-1)
configured using `configure '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.60/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.60/site-lisp:/usr/share/emacs/site-lisp' '--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#925: 23.0.60; follow-mode doesn't work in buffers with a header line
2008-09-07 22:26 ` bug#925: 23.0.60; follow-mode doesn't work in buffers with a header line Phil Sung
@ 2008-09-08 16:08 ` martin rudalics
2008-09-10 16:53 ` Phil Sung
2008-10-28 17:55 ` bug#925: marked as done (23.0.60; follow-mode doesn't work in buffers with a header line) Emacs bug Tracking System
1 sibling, 1 reply; 5+ messages in thread
From: martin rudalics @ 2008-09-08 16:08 UTC (permalink / raw
To: Phil Sung, 925
> Steps to reproduce:
>
> 0. emacs -Q
> 1. C-h r [info-emacs-manual]
> 2. C-x 3 [split-window-horizontally]
> 3. M-x follow-mode
> 4. C-n until point moves past bottom of window
>
> Expected results:
>
> Point moves to top of next window.
>
> Actual results:
>
> First window scrolls down and then recenters around point.
Does it help when you set `scroll-conservatively' to 100?
martin
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#925: 23.0.60; follow-mode doesn't work in buffers with a header line
2008-09-08 16:08 ` martin rudalics
@ 2008-09-10 16:53 ` Phil Sung
2008-09-11 8:54 ` martin rudalics
0 siblings, 1 reply; 5+ messages in thread
From: Phil Sung @ 2008-09-10 16:53 UTC (permalink / raw
To: martin rudalics, 925
martin rudalics writes:
> Does it help when you set `scroll-conservatively' to 100?
No, it doesn't. When I do that, not only does the expected behavior
not happen, point moves back to the center of the first screen. This
didn't happen with the default value of scroll-conservatively.
Here's what I now think is going on:
When there's a header line, follow-mode miscomputes the beginning of
the second window-- if you try out the "steps to reproduce", you can
see that there's one line after the end of the first window which is
not visible in the second window. When you try to C-n to that line,
follow-mode can't display that line in either window, so something
weird happens.
I tried the (flawed) patch below, which decreases the effective
window-height when there's a header line. I'm not sure if this is the
right approach.
With this patch, point correctly moves from one window to the other,
and the two windows display consecutive lines, as expected. However,
sometimes when moving point between windows, the text will shift up or
down by a line. I don't know why that happens.
Thanks,
Phil
follow.el (follow-scroll-down, follow-calc-win-end,
follow-estimate-first-window-start): reduce effective window
height when header line is present.
diff --git a/lisp/follow.el b/lisp/follow.el
index 508d0f5..766dfce 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -624,7 +624,7 @@ Works like `scroll-up' when not in Follow mode."
(select-window win)
(goto-char start)
(vertical-motion (- (- (window-height win)
- 1
+ (if header-line-format 2 1)
next-screen-context-lines)))
(set-window-start win (point))
(goto-char start)
@@ -887,7 +887,8 @@ Returns (end-pos end-of-buffer-p)"
(prog1
(save-excursion
(goto-char (window-start))
- (setq height (- (window-height) 1))
+ (setq height (- (window-height)
+ (if header-line-format 2 1)))
(setq buffer-end-p
(if (bolp)
(not (= height (vertical-motion height)))
@@ -1219,7 +1220,9 @@ position of the first window. Otherwise it is a good guess."
;(setq exact (bolp))
(vertical-motion 0 win)
(while pred
- (vertical-motion (- 1 (window-height (car pred))) (car pred))
+ (vertical-motion (- (if header-line-format 2 1)
+ (window-height (car pred)))
+ (car pred))
(if (not (bolp))
(setq exact nil))
(setq pred (cdr pred)))
^ permalink raw reply related [flat|nested] 5+ messages in thread
* bug#925: 23.0.60; follow-mode doesn't work in buffers with a header line
2008-09-10 16:53 ` Phil Sung
@ 2008-09-11 8:54 ` martin rudalics
0 siblings, 0 replies; 5+ messages in thread
From: martin rudalics @ 2008-09-11 8:54 UTC (permalink / raw
To: Phil Sung; +Cc: 925
> No, it doesn't. When I do that, not only does the expected behavior
> not happen, point moves back to the center of the first screen. This
> didn't happen with the default value of scroll-conservatively.
I don't understand well. When I set `scroll-conservatively' to 100
there's no recentering with emacs -Q and both windows scroll. There's,
however, at least one line missing as you remark below.
> Here's what I now think is going on:
>
> When there's a header line, follow-mode miscomputes the beginning of
> the second window-- if you try out the "steps to reproduce", you can
> see that there's one line after the end of the first window which is
> not visible in the second window. When you try to C-n to that line,
> follow-mode can't display that line in either window, so something
> weird happens.
>
> I tried the (flawed) patch below, which decreases the effective
> window-height when there's a header line. I'm not sure if this is the
> right approach.
Ideally, the second window wouldn't display the header line at all.
> With this patch, point correctly moves from one window to the other,
> and the two windows display consecutive lines, as expected. However,
> sometimes when moving point between windows, the text will shift up or
> down by a line. I don't know why that happens.
This seems to already happen without your patch.
martin
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#925: marked as done (23.0.60; follow-mode doesn't work in buffers with a header line)
2008-09-07 22:26 ` bug#925: 23.0.60; follow-mode doesn't work in buffers with a header line Phil Sung
2008-09-08 16:08 ` martin rudalics
@ 2008-10-28 17:55 ` Emacs bug Tracking System
1 sibling, 0 replies; 5+ messages in thread
From: Emacs bug Tracking System @ 2008-10-28 17:55 UTC (permalink / raw
To: martin rudalics
[-- Attachment #1: Type: text/plain, Size: 891 bytes --]
Your message dated Tue, 28 Oct 2008 18:43:40 +0100
with message-id <49074F4C.6080008@gmx.at>
and subject line Re: bug#925: 23.0.60; follow-mode doesn't work in buffers with a header line
has caused the Emacs bug report #925,
regarding 23.0.60; follow-mode doesn't work in buffers with a header line
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)
--
925: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=925
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems
[-- Attachment #2: Type: message/rfc822, Size: 4188 bytes --]
From: Phil Sung <psung@mit.edu>
To: emacs-pretest-bug@gnu.org
Subject: 23.0.60; follow-mode doesn't work in buffers with a header line
Date: Sun, 7 Sep 2008 18:26:22 -0400
Message-ID: <18628.21774.308940.632822@gargle.gargle.HOWL>
Steps to reproduce:
0. emacs -Q
1. C-h r [info-emacs-manual]
2. C-x 3 [split-window-horizontally]
3. M-x follow-mode
4. C-n until point moves past bottom of window
Expected results:
Point moves to top of next window.
Actual results:
First window scrolls down and then recenters around point.
In GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.13.7)
of 2008-08-31 on iridium, modified by Debian
(emacs-snapshot package, version 1:20080831-1)
configured using `configure '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.60/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.60/site-lisp:/usr/share/emacs/site-lisp' '--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''
[-- Attachment #3: Type: message/rfc822, Size: 1772 bytes --]
From: martin rudalics <rudalics@gmx.at>
To: 925-done@emacsbugs.donarmstrong.com
Cc: Phil Sung <psung@mit.edu>
Subject: Re: bug#925: 23.0.60; follow-mode doesn't work in buffers with a header line
Date: Tue, 28 Oct 2008 18:43:40 +0100
Message-ID: <49074F4C.6080008@gmx.at>
Fixed as
2008-10-28 Phil Sung <psung@mit.edu> (tiny change)
* follow.el (follow-scroll-down, follow-calc-win-end)
(follow-estimate-first-window-start): Reduce effective window
height when header line is present. (Bug#925)
Thanks, martin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-10-28 17:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <49074F4C.6080008@gmx.at>
2008-09-07 22:26 ` bug#925: 23.0.60; follow-mode doesn't work in buffers with a header line Phil Sung
2008-09-08 16:08 ` martin rudalics
2008-09-10 16:53 ` Phil Sung
2008-09-11 8:54 ` martin rudalics
2008-10-28 17:55 ` bug#925: marked as done (23.0.60; follow-mode doesn't work in buffers with a header line) Emacs bug Tracking System
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.