emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pos-visible-in-window-p and extreme conditions.


From: Michaël Cadilhac
Subject: pos-visible-in-window-p and extreme conditions.
Date: Thu, 05 Oct 2006 15:52:19 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

I think this change:

2006-09-06  Kim F. Storm  <address@hidden>

        * xdisp.c (pos_visible_p): Remove exact_mode_line_heights_p arg;
        so calculate heights even when pos-visible-in-window-p is called
        with partially = t.  Don't overshoot last_visible_y in move_it_to.
        Return row height and row number in new rowh and vpos args.
        (cursor_row_fully_visible_p): First line is always "fully visible".
        (try_window): Don't clear matrix if vscrolled.

introduced a bug in one-line windows (i.e. minibuffer). Especially the
part « Don't overshoot ... ».

- Test case:
emacs -Q
M-x set-variable RET window-min-height RET 1 RET
Make the buffer empty and the window 1 line.
type « kungfu ». Use M-: (pos-visible-in-window-p nil nil t) on
different points :
o C-a (bob) -> (0 0)
o on the `g' -> (21 0)
o C-e (eob (there's no \n)) -> nil

This is due to move_it_to that returns an `it' with 1 as its
IT_CHARPOS on single-line windows.

- I propose the following change (revert):

Index: xdisp.c
===================================================================
RCS file: /sources/emacs/emacs/src/xdisp.c,v
retrieving revision 1.1123
diff -c -r1.1123 xdisp.c
*** xdisp.c     1 Oct 2006 16:44:43 -0000       1.1123
--- xdisp.c     5 Oct 2006 13:50:47 -0000
***************
*** 1313,1319 ****
                               current_buffer->header_line_format);
  
    start_display (&it, w, top);
!   move_it_to (&it, charpos, -1, it.last_visible_y-1, -1,
              (charpos >= 0 ? MOVE_TO_POS : 0) | MOVE_TO_Y);
  
    /* Note that we may overshoot because of invisible text.  */
--- 1313,1319 ----
                               current_buffer->header_line_format);
  
    start_display (&it, w, top);
!   move_it_to (&it, charpos, -1, it.last_visible_y, -1,
              (charpos >= 0 ? MOVE_TO_POS : 0) | MOVE_TO_Y);
  
    /* Note that we may overshoot because of invisible text.  */
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.5342
diff -c -0 -r1.5342 ChangeLog
*** ChangeLog   1 Oct 2006 16:44:43 -0000       1.5342
--- ChangeLog   5 Oct 2006 13:50:53 -0000
***************
*** 0 ****
--- 1,5 ----
+ 2006-10-05  Michaël Cadilhac  <address@hidden>
+ 
+       * xdisp.c (pos_visible_p): Consider last_visible_y to be the tight
+       limit for move_it_to.
+ 

-- 
/!\ My mail address changed, please update your files accordingly.
 |      Michaël `Micha' Cadilhac   |  Mieux vaut se taire                   |
 |         Epita/LRDE Promo 2007   |   Que de parler trop fort.             |
 |  http://michael.cadilhac.name   |           -- As de trèfle              |
 `--  -   JID: address@hidden --'                                   -  --'

Attachment: pgp7DSGDdLEAO.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]