unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* scroll-preserve-screen-position BROKEN when header line displayed
@ 2004-10-27 22:27 Jens Lautenbacher
  2004-10-31  9:42 ` Richard Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Lautenbacher @ 2004-10-27 22:27 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 465 bytes --]

Hi all,

it seems that setting scroll-preserve-screen-position to t does not work
whenever a header line is displayed (e.g. Info mode, but also when using
the add-on elisp lib tabbar.el).

It manifests itself in moving the cursor one screen line down each
whenever page-up or page-down is pressed instead of having the cursor
stay fixed at current screen position. I tried to find the cause but
have not been able to locate it yet :-(

-- 
        jtl

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: scroll-preserve-screen-position BROKEN when header line displayed
  2004-10-27 22:27 scroll-preserve-screen-position BROKEN when header line displayed Jens Lautenbacher
@ 2004-10-31  9:42 ` Richard Stallman
  2004-11-01  0:33   ` Jens Lautenbacher
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Stallman @ 2004-10-31  9:42 UTC (permalink / raw)
  Cc: emacs-devel

This fixes it for me.  Do you get good results?

*** window.c	16 Oct 2004 01:47:10 -0400	1.480
--- window.c	31 Oct 2004 03:45:20 -0500	
***************
*** 4625,4641 ****
        w->force_start = Qt;
      }
  
    it.current_y = it.vpos = 0;
  
!   /* Preserve the screen position if we must.  */
    if (preserve_y >= 0)
      {
        move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y);
        SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
      }
    else
      {
!       /* Move PT out of scroll margins.  */
        this_scroll_margin = max (0, scroll_margin);
        this_scroll_margin = min (this_scroll_margin, XFASTINT (w->total_lines) / 4);
        this_scroll_margin *= FRAME_LINE_HEIGHT (it.f);
--- 4625,4649 ----
        w->force_start = Qt;
      }
  
+   /* The rest of this function uses current_y in a nonstandard way,
+      not including the height of the header line if any.  */
    it.current_y = it.vpos = 0;
  
!   /* Preserve the screen position if we should.  */
    if (preserve_y >= 0)
      {
+       /* If we have a header line, take account of it.  */
+       if (WINDOW_WANTS_HEADER_LINE_P (w))
+ 	preserve_y -= CURRENT_HEADER_LINE_HEIGHT (w);
+ 
        move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y);
        SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
      }
    else
      {
!       /* Move PT out of scroll margins.
! 	 This code wants current_y to be zero at the window start position
! 	 even if there is a header line.  */
        this_scroll_margin = max (0, scroll_margin);
        this_scroll_margin = min (this_scroll_margin, XFASTINT (w->total_lines) / 4);
        this_scroll_margin *= FRAME_LINE_HEIGHT (it.f);

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

* Re: scroll-preserve-screen-position BROKEN when header line displayed
  2004-10-31  9:42 ` Richard Stallman
@ 2004-11-01  0:33   ` Jens Lautenbacher
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Lautenbacher @ 2004-11-01  0:33 UTC (permalink / raw)
  Cc: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 161 bytes --]

On Sun, 2004-10-31 at 04:42 -0500, Richard Stallman wrote:
> This fixes it for me.  Do you get good results?

yep, works like a charm. thanks a lot!

	jtl

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

end of thread, other threads:[~2004-11-01  0:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-27 22:27 scroll-preserve-screen-position BROKEN when header line displayed Jens Lautenbacher
2004-10-31  9:42 ` Richard Stallman
2004-11-01  0:33   ` Jens Lautenbacher

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).