Mercurial > emacs
changeset 59781:b302445f7b00
(widget-button-click): Shorten the range of the track-mouse binding.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 29 Jan 2005 17:21:12 +0000 |
parents | 9d293bf75d6c |
children | ec7c04e04f71 |
files | lisp/wid-edit.el |
diffstat | 1 files changed, 15 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- 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))))