> That is important. Double-click of mouse-1 has a standard meaning, > and the link-following feature is not supposed to interfere with it. > > Whether the old code succeeded in keeping double-click working right, > I don't know. But if it doesn't work correctly now, it needs to be > fixed.
This patch should fix the problem. I think `mouse-drag-region-1' was failing to call double-click bindings because it assumed that double-mouse-1 was bound to `mouse-set-point'. By the way, there's no need to drop the mouse-1 event if the user double-clicks (which is what the sit-for was trying to do). The Elisp manual says that When the user performs a double click, Emacs generates first an ordinary click event, and then a double-click event. Therefore, you must design the command binding of the double click event to assume that the single-click command has already run. It must produce the desired results of a double click, starting from the results of a single click. This patch should make mouse-1 and double-mouse-1 work as stated. Could people test it out? *** emacs/lisp/mouse.el.~1.281.~ 2005-10-09 13:59:03.000000000 -0400 --- emacs/lisp/mouse.el 2005-10-13 11:19:30.000000000 -0400 *************** *** 958,969 **** (mouse-move-drag-overlay mouse-drag-overlay start-point end-point click-count)) (if (consp event) ! (let ((fun (key-binding (vector (car event))))) ;; Run the binding of the terminating up-event, if possible. ;; In the case of a multiple click, it gives the wrong results, ;; because it would fail to set up a region. ! (if (not (= (overlay-start mouse-drag-overlay) ! (overlay-end mouse-drag-overlay))) (let* ((stop-point (if (numberp (posn-point (event-end event))) (posn-point (event-end event)) --- 958,973 ---- (mouse-move-drag-overlay mouse-drag-overlay start-point end-point click-count)) (if (consp event) ! (let* ((fun (key-binding (vector (car event)))) ! (do-multi-click (and (> (event-click-count event) 0) ! (functionp fun) ! (not (eq fun 'mouse-set-point))))) ;; Run the binding of the terminating up-event, if possible. ;; In the case of a multiple click, it gives the wrong results, ;; because it would fail to set up a region. ! (if (and (not (= (overlay-start mouse-drag-overlay) ! (overlay-end mouse-drag-overlay))) ! (not do-multi-click)) (let* ((stop-point (if (numberp (posn-point (event-end event))) (posn-point (event-end event)) *************** *** 996,1001 **** --- 1000,1006 ---- (and (mark t) mark-active (eq buffer (current-buffer)) (mouse-set-region-1)))) + (if do-multi-click (goto-char start-point)) (delete-overlay mouse-drag-overlay) ;; Run the binding of the terminating up-event. (when (and (functionp fun) _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel