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

Diff of /emacs/lisp/mouse-drag.el

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

revision 1.8 by rms, Mon Jan 8 19:12:12 2001 UTC revision 1.9 by rms, Sat Nov 17 22:37:39 2001 UTC
# Line 208  To test this function, evaluate: Line 208  To test this function, evaluate:
208           (start-col (car (posn-col-row start-posn)))           (start-col (car (posn-col-row start-posn)))
209           (old-selected-window (selected-window))           (old-selected-window (selected-window))
210           event end row mouse-delta scroll-delta           event end row mouse-delta scroll-delta
211           have-scrolled point-event-p old-binding           have-scrolled
212           window-last-row           window-last-row
213           col mouse-col-delta window-last-col           col mouse-col-delta window-last-col
214           (scroll-col-delta 0)           (scroll-col-delta 0)
# Line 261  To test this function, evaluate: Line 261  To test this function, evaluate:
261                (mouse-drag-safe-scroll scroll-delta scroll-col-delta)                (mouse-drag-safe-scroll scroll-delta scroll-col-delta)
262                (mouse-drag-repeatedly-safe-scroll scroll-delta scroll-col-delta))))) ;xxx                (mouse-drag-repeatedly-safe-scroll scroll-delta scroll-col-delta))))) ;xxx
263      ;; If it was a click and not a drag, prepare to pass the event on.      ;; If it was a click and not a drag, prepare to pass the event on.
264      ;; Note:  We must determine the pass-through event before restoring      ;; Is there a more correct way to reconstruct the event?
     ;; the window, but invoke it after.  Sigh.  
265      (if (and (not have-scrolled)      (if (and (not have-scrolled)
266               (mouse-drag-events-are-point-events-p start-posn end))               (mouse-drag-events-are-point-events-p start-posn end))
267          (setq point-event-p t          (push (cons (event-basic-type start-event) (cdr start-event))
268                old-binding (key-binding                unread-command-events))
                            (vector (event-basic-type start-event)))))  
269      ;; Now restore the old window.      ;; Now restore the old window.
270      (select-window old-selected-window)      (select-window old-selected-window)))
     ;; For clicks, call the old function.  
     (if point-event-p  
         (call-interactively old-binding))))  
271    
272  (defun mouse-drag-drag (start-event)  (defun mouse-drag-drag (start-event)
273    "\"Drag\" the page according to a mouse drag.    "\"Drag\" the page according to a mouse drag.
# Line 297  To test this function, evaluate: Line 292  To test this function, evaluate:
292           (start-col (car (posn-col-row start-posn)))           (start-col (car (posn-col-row start-posn)))
293           (old-selected-window (selected-window))           (old-selected-window (selected-window))
294           event end row mouse-delta scroll-delta           event end row mouse-delta scroll-delta
295           have-scrolled point-event-p old-binding           have-scrolled
296           window-last-row           window-last-row
297           col mouse-col-delta window-last-col           col mouse-col-delta window-last-col
298           (scroll-col-delta 0)           (scroll-col-delta 0)
# Line 335  To test this function, evaluate: Line 330  To test this function, evaluate:
330                  (setq have-scrolled t)                  (setq have-scrolled t)
331                  (mouse-drag-safe-scroll scroll-delta scroll-col-delta)))))))                  (mouse-drag-safe-scroll scroll-delta scroll-col-delta)))))))
332      ;; If it was a click and not a drag, prepare to pass the event on.      ;; If it was a click and not a drag, prepare to pass the event on.
333      ;; Note:  We must determine the pass-through event before restoring      ;; Is there a more correct way to reconstruct the event?
     ;; the window, but invoke it after.  Sigh.  
334      (if (and (not have-scrolled)      (if (and (not have-scrolled)
335               (mouse-drag-events-are-point-events-p start-posn end))               (mouse-drag-events-are-point-events-p start-posn end))
336          (setq point-event-p t          (push (cons (event-basic-type start-event) (cdr start-event))
337                old-binding (key-binding                unread-command-events))
                            (vector (event-basic-type start-event)))))  
338      ;; Now restore the old window.      ;; Now restore the old window.
339      (select-window old-selected-window)      (select-window old-selected-window)))
340      ;; For clicks, call the old function.  
     (if point-event-p  
         (call-interactively old-binding))))  
341    
342  (provide 'mouse-drag)  (provide 'mouse-drag)
343    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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