# HG changeset patch # User Richard M. Stallman # Date 1107019272 0 # Node ID b302445f7b001aff1e531c4121a9dc6291d16111 # Parent 9d293bf75d6cdadb76c9d150f48c7fd71c09544c (widget-button-click): Shorten the range of the track-mouse binding. diff -r 9d293bf75d6c -r b302445f7b00 lisp/wid-edit.el --- a/lisp/wid-edit.el Sat Jan 29 17:18:57 2005 +0000 +++ b/lisp/wid-edit.el Sat Jan 29 17:21:12 2005 +0000 @@ -915,14 +915,14 @@ ;; until we receive a release event. Highlight/ ;; unhighlight the button the mouse was initially ;; on when we move over it. - (let ((track-mouse t)) - (save-excursion - (when face ; avoid changing around image - (overlay-put overlay - 'face widget-button-pressed-face) - (overlay-put overlay - 'mouse-face widget-button-pressed-face)) - (unless (widget-apply button :mouse-down-action event) + (save-excursion + (when face ; avoid changing around image + (overlay-put overlay + 'face widget-button-pressed-face) + (overlay-put overlay + 'mouse-face widget-button-pressed-face)) + (unless (widget-apply button :mouse-down-action event) + (let ((track-mouse t)) (while (not (widget-button-release-event-p event)) (setq event (read-event) pos (widget-event-point event)) @@ -937,13 +937,13 @@ 'mouse-face widget-button-pressed-face)) (overlay-put overlay 'face face) - (overlay-put overlay 'mouse-face mouse-face)))) - - ;; When mouse is released over the button, run - ;; its action function. - (when (and pos - (eq (get-char-property pos 'button) button)) - (widget-apply-action button event)))) + (overlay-put overlay 'mouse-face mouse-face))))) + + ;; When mouse is released over the button, run + ;; its action function. + (when (and pos + (eq (get-char-property pos 'button) button)) + (widget-apply-action button event))) (overlay-put overlay 'face face) (overlay-put overlay 'mouse-face mouse-face))))