diff options
| author | Richard M. Stallman | 2005-01-29 17:21:12 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-01-29 17:21:12 +0000 |
| commit | 6f95a835181f3352c524e2cc5c48dd7648fd6e9d (patch) | |
| tree | 16d9c4c142bf5ade184e547bac289c229483b3bc | |
| parent | c6c7dc03495f90238258538535515790208a45b3 (diff) | |
| download | emacs-6f95a835181f3352c524e2cc5c48dd7648fd6e9d.tar.gz emacs-6f95a835181f3352c524e2cc5c48dd7648fd6e9d.zip | |
(widget-button-click): Shorten the range of the track-mouse binding.
| -rw-r--r-- | lisp/wid-edit.el | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 16de985fa3c..f89095fd7fc 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -915,14 +915,14 @@ Recommended as a parent keymap for modes using widgets.") | |||
| 915 | ;; until we receive a release event. Highlight/ | 915 | ;; until we receive a release event. Highlight/ |
| 916 | ;; unhighlight the button the mouse was initially | 916 | ;; unhighlight the button the mouse was initially |
| 917 | ;; on when we move over it. | 917 | ;; on when we move over it. |
| 918 | (let ((track-mouse t)) | 918 | (save-excursion |
| 919 | (save-excursion | 919 | (when face ; avoid changing around image |
| 920 | (when face ; avoid changing around image | 920 | (overlay-put overlay |
| 921 | (overlay-put overlay | 921 | 'face widget-button-pressed-face) |
| 922 | 'face widget-button-pressed-face) | 922 | (overlay-put overlay |
| 923 | (overlay-put overlay | 923 | 'mouse-face widget-button-pressed-face)) |
| 924 | 'mouse-face widget-button-pressed-face)) | 924 | (unless (widget-apply button :mouse-down-action event) |
| 925 | (unless (widget-apply button :mouse-down-action event) | 925 | (let ((track-mouse t)) |
| 926 | (while (not (widget-button-release-event-p event)) | 926 | (while (not (widget-button-release-event-p event)) |
| 927 | (setq event (read-event) | 927 | (setq event (read-event) |
| 928 | pos (widget-event-point event)) | 928 | pos (widget-event-point event)) |
| @@ -937,13 +937,13 @@ Recommended as a parent keymap for modes using widgets.") | |||
| 937 | 'mouse-face | 937 | 'mouse-face |
| 938 | widget-button-pressed-face)) | 938 | widget-button-pressed-face)) |
| 939 | (overlay-put overlay 'face face) | 939 | (overlay-put overlay 'face face) |
| 940 | (overlay-put overlay 'mouse-face mouse-face)))) | 940 | (overlay-put overlay 'mouse-face mouse-face))))) |
| 941 | 941 | ||
| 942 | ;; When mouse is released over the button, run | 942 | ;; When mouse is released over the button, run |
| 943 | ;; its action function. | 943 | ;; its action function. |
| 944 | (when (and pos | 944 | (when (and pos |
| 945 | (eq (get-char-property pos 'button) button)) | 945 | (eq (get-char-property pos 'button) button)) |
| 946 | (widget-apply-action button event)))) | 946 | (widget-apply-action button event))) |
| 947 | (overlay-put overlay 'face face) | 947 | (overlay-put overlay 'face face) |
| 948 | (overlay-put overlay 'mouse-face mouse-face)))) | 948 | (overlay-put overlay 'mouse-face mouse-face)))) |
| 949 | 949 | ||