/[emacs]/emacs/lisp/mouse.el
ViewVC logotype

Diff of /emacs/lisp/mouse.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.277 by cyd, Tue Sep 13 20:13:31 2005 UTC revision 1.278 by monnier, Mon Sep 19 18:51:28 2005 UTC
# Line 405  MODE-LINE-P non-nil means dragging a mod Line 405  MODE-LINE-P non-nil means dragging a mod
405           (start-event-window (posn-window start))           (start-event-window (posn-window start))
406           (start-event-frame (window-frame start-event-window))           (start-event-frame (window-frame start-event-window))
407           (start-nwindows (count-windows t))           (start-nwindows (count-windows t))
          (old-selected-window (selected-window))  
408           (minibuffer (frame-parameter nil 'minibuffer))           (minibuffer (frame-parameter nil 'minibuffer))
409           should-enlarge-minibuffer event mouse y top bot edges wconfig growth)           should-enlarge-minibuffer event mouse y top bot edges wconfig growth)
410      (track-mouse      (track-mouse
# Line 553  resized by dragging their header-line." Line 552  resized by dragging their header-line."
552           (start-event-frame (window-frame (car (car (cdr start-event)))))           (start-event-frame (window-frame (car (car (cdr start-event)))))
553           (start-event-window (car (car (cdr start-event))))           (start-event-window (car (car (cdr start-event))))
554           (start-nwindows (count-windows t))           (start-nwindows (count-windows t))
          (old-selected-window (selected-window))  
555           event mouse x left right edges wconfig growth           event mouse x left right edges wconfig growth
556           (which-side           (which-side
557            (or (cdr (assq 'vertical-scroll-bars (frame-parameters start-event-frame)))            (or (cdr (assq 'vertical-scroll-bars (frame-parameters start-event-frame)))
# Line 865  at the same position." Line 863  at the same position."
863           (start-point (posn-point start-posn))           (start-point (posn-point start-posn))
864           (start-window (posn-window start-posn))           (start-window (posn-window start-posn))
865           (start-window-start (window-start start-window))           (start-window-start (window-start start-window))
          (start-frame (window-frame start-window))  
866           (start-hscroll (window-hscroll start-window))           (start-hscroll (window-hscroll start-window))
867           (bounds (window-edges start-window))           (bounds (window-edges start-window))
868           (make-cursor-line-fully-visible nil)           (make-cursor-line-fully-visible nil)
# Line 899  at the same position." Line 896  at the same position."
896                      (window-buffer start-window))                      (window-buffer start-window))
897        (overlay-put mouse-drag-overlay 'window (selected-window)))        (overlay-put mouse-drag-overlay 'window (selected-window)))
898      (deactivate-mark)      (deactivate-mark)
899      ;; end-of-range is used only in the single-click case.      (let (event end end-point last-end-point)
     ;; It is the place where the drag has reached so far  
     ;; (but not outside the window where the drag started).  
     (let (event end end-point last-end-point (end-of-range (point)))  
900        (track-mouse        (track-mouse
901          (while (progn          (while (progn
902                   (setq event (read-event))                   (setq event (read-event))
# Line 924  at the same position." Line 918  at the same position."
918                ;; point jumps in the direction away from START-POINT.                ;; point jumps in the direction away from START-POINT.
919                (goto-char start-point)                (goto-char start-point)
920                (goto-char end-point)                (goto-char end-point)
               (if (zerop (% click-count 3))  
                   (setq end-of-range (point)))  
921                (let ((range (mouse-start-end start-point (point) click-count)))                (let ((range (mouse-start-end start-point (point) click-count)))
922                  (move-overlay mouse-drag-overlay (car range) (nth 1 range))))                  (move-overlay mouse-drag-overlay (car range) (nth 1 range))))
923    
# Line 935  at the same position." Line 927  at the same position."
927                   ((null mouse-row))                   ((null mouse-row))
928                   ((< mouse-row top)                   ((< mouse-row top)
929                    (mouse-scroll-subr start-window (- mouse-row top)                    (mouse-scroll-subr start-window (- mouse-row top)
930                                       mouse-drag-overlay start-point)                                       mouse-drag-overlay start-point))
                   ;; Without this, point tends to jump back to the starting  
                   ;; position where the mouse button was pressed down.  
                   (setq end-of-range (overlay-start mouse-drag-overlay)))  
931                   ((>= mouse-row bottom)                   ((>= mouse-row bottom)
932                    (mouse-scroll-subr start-window (1+ (- mouse-row bottom))                    (mouse-scroll-subr start-window (1+ (- mouse-row bottom))
933                                       mouse-drag-overlay start-point)                                       mouse-drag-overlay start-point)))))))))
                   (setq end-of-range (overlay-end mouse-drag-overlay))))))))))  
934    
935        ;; In case we did not get a mouse-motion event        ;; In case we did not get a mouse-motion event
936        ;; for the final move of the mouse before a drag event        ;; for the final move of the mouse before a drag event
# Line 957  at the same position." Line 945  at the same position."
945          ;; point jumps in the direction away from START-POINT.          ;; point jumps in the direction away from START-POINT.
946          (goto-char start-point)          (goto-char start-point)
947          (goto-char end-point)          (goto-char end-point)
         (if (zerop (% click-count 3))  
             (setq end-of-range (point)))  
948          (let ((range (mouse-start-end start-point (point) click-count)))          (let ((range (mouse-start-end start-point (point) click-count)))
949            (move-overlay mouse-drag-overlay (car range) (nth 1 range))))            (move-overlay mouse-drag-overlay (car range) (nth 1 range))))
950    
# Line 1492  The function returns a non-nil value if Line 1478  The function returns a non-nil value if
1478           (start-posn (event-start start-event))           (start-posn (event-start start-event))
1479           (start-point (posn-point start-posn))           (start-point (posn-point start-posn))
1480           (start-window (posn-window start-posn))           (start-window (posn-window start-posn))
          (start-frame (window-frame start-window))  
1481           (bounds (window-edges start-window))           (bounds (window-edges start-window))
1482           (top (nth 1 bounds))           (top (nth 1 bounds))
1483           (bottom (if (window-minibuffer-p start-window)           (bottom (if (window-minibuffer-p start-window)
# Line 2433  and selects that window." Line 2418  and selects that window."
2418  (make-obsolete 'mldrag-drag-vertical-line 'mouse-drag-vertical-line "21.1")  (make-obsolete 'mldrag-drag-vertical-line 'mouse-drag-vertical-line "21.1")
2419  (provide 'mldrag)  (provide 'mldrag)
2420    
2421  ;;; arch-tag: 9a710ce1-914a-4923-9b81-697f7bf82ab3  ;; arch-tag: 9a710ce1-914a-4923-9b81-697f7bf82ab3
2422  ;;; mouse.el ends here  ;;; mouse.el ends here

Legend:
Removed from v.1.277  
changed lines
  Added in v.1.278

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26