Changeset 3875

Show
Ignore:
Timestamp:
09/16/05 18:33:32 (3 years ago)
Author:
horiguti
Message:

r3864 fixed the problem partially. Fix it.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.1/lisp/ChangeLog.Meadow

    r3864 r3875  
     12005-09-16  Kyotaro HORIGUCHI <horiguti@meadowy.org> 
     2 
     3        * mw32scroll.el (w32-scroll-bar-drag-1): Bug fix of previous 
     4        change.  Fixed issue MW137. 
     5        (w32-scroll-bar-drag): Ditto. 
     6 
    172005-09-10  Kyotaro HORIGUCHI <horiguti@meadowy.org> 
    28 
  • branches/2.1/lisp/mw32scroll.el

    r3864 r3875  
    2828    (beginning-of-line) 
    2929    (point))) 
    30  
    31 ;; Scroll the window to the proper position for EVENT. 
    32 (defsubst w32-scroll-bar-drag-1 (event) 
    33   (let* ((start-position (event-start event)) 
    34          (window (nth 0 start-position)) 
    35          (portion-whole (nth 2 start-position))) 
    36     (save-excursion 
    37       (set-buffer (window-buffer window)) 
    38       ;; Calculate position relative to the accessible part of the buffer. 
    39       (goto-char (+ (point-min) 
    40                     (scroll-bar-scale portion-whole 
    41                                       (- (point-max) (point-min))))) 
    42       (vertical-motion 0) 
    43       (set-window-start window (point))))) 
    4430 
    4531;;; for normal dragging 
     
    6147      (setq before-scroll 
    6248            (or before-scroll (point)))) 
    63     (w32-scroll-bar-drag-1 event) 
    6449    (save-excursion 
    6550      (set-buffer (window-buffer window)) 
     
    7358                              (nth 2 start-position) 
    7459                              (- (point-max) (point-min))))) 
    75                (vertical-motion 0) 
    76                (set-window-start window (point))) 
    77               (t 
     60               (back-to-previous-visible-line-start window) 
     61               (set-window-start 
     62                window 
     63                (car 
     64                 (compute-motion (line-beginning-position) 
     65                                 '(0 . 0) 
     66                                 (point-max) 
     67                                 (cons 0 
     68                                       (nth 2 
     69                                            (compute-motion  
     70                                             (line-beginning-position) 
     71                                             '(0 . 0) 
     72                                             (point) 
     73                                             (cons (window-width) 
     74                                                   (window-height)) 
     75                                             (window-width) 
     76                                             (cons (window-hscroll) 0) 
     77                                             window))) 
     78                                 (window-width) 
     79                                 (cons (window-hscroll) 0) 
     80                                 window))) 
     81               (goto-char 
     82                (car 
     83                 (compute-motion 
     84                  (window-start window) 
     85                  '(0 . 0) 
     86                  (point-max) 
     87                  (cons 0 (/ (window-height) 2)) 
     88                  (window-width) 
     89                  (cons (window-hscroll) 0) 
     90                  window)))) 
     91               (t 
    7892               ;; Exit when we get the drag event; store unread-command-events 
    7993               (setq unread-command-events 
  • branches/2.1/src/ChangeLog.Meadow

    r3858 r3875  
     12005-09-16  Kyotaro HORIGUCHI  <horiguti@meadowy.org> 
     2 
     3        * indent.c (back-to-previous-visible-line-start): New lisp 
     4        function. 
     5 
    162005-09-08  MIYOSHI Masanori  <miyoshi@meadowy.org> 
    27 
  • branches/2.1/src/indent.c

    r3212 r3875  
    19751975} 
    19761976 
     1977#ifdef MEADOW 
     1978DEFUN ("back-to-previous-visible-line-start", 
     1979       Fback_to_previous_visible_line_start,  
     1980       Sback_to_previous_visible_line_start, 0, 1, 0, 
     1981       "If position is invisible, back to beginning of preveous visible line.") 
     1982  (window) 
     1983     Lisp_Object window; 
     1984{ 
     1985  struct window *w; 
     1986  struct it it; 
     1987  struct text_pos pt; 
     1988 
     1989  if (! NILP (window)) 
     1990    CHECK_WINDOW (window, 0); 
     1991  else 
     1992    window = selected_window; 
     1993  w = XWINDOW (window); 
     1994 
     1995  SET_TEXT_POS (pt, PT, PT_BYTE); 
     1996  start_display (&it, w, pt); 
     1997   
     1998  while (it.selective > 0 && IT_CHARPOS (it) > BEGV) 
     1999    { 
     2000      double val; 
     2001      int opt, opt_byte; 
     2002 
     2003      opt = PT; 
     2004      opt_byte = PT_BYTE; 
     2005      SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 
     2006      while (PT > BEGV && FETCH_BYTE (PT_BYTE) == '\n') 
     2007        scan_newline (PT - 1, PT_BYTE - 1, BEGV, BEGV_BYTE, -1, 0); 
     2008       
     2009      val = position_indentation (PT_BYTE); 
     2010      SET_PT_BOTH (opt, opt_byte); 
     2011       
     2012      if (val < (double)it.selective) break; 
     2013 
     2014      /* back to previous line start */ 
     2015      IT_CHARPOS (it) = find_next_newline_no_quit (IT_CHARPOS (it) - 1, -1); 
     2016      IT_BYTEPOS (it) = CHAR_TO_BYTE (IT_CHARPOS (it)); 
     2017    } 
     2018  SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 
     2019 
     2020  return Qnil; 
     2021} 
     2022#endif /* MEADOW */ 
     2023 
    19772024DEFUN ("vertical-motion", Fvertical_motion, Svertical_motion, 1, 2, 0, 
    19782025  "Move point to start of the screen line LINES lines down.\n\ 
     
    20532100  indent_tabs_mode = 1; 
    20542101 
     2102#ifdef MEADOW 
     2103  defsubr (&Sback_to_previous_visible_line_start); 
     2104#endif 
    20552105  defsubr (&Scurrent_indentation); 
    20562106  defsubr (&Sindent_to);