Mercurial > emacs
changeset 26386:c147359a515b
(widget-button-click): Wrap with save-excursion
to restore track-mouse in the correct buffer.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Tue, 09 Nov 1999 13:42:34 +0000 |
parents | e52f7eedc5b0 |
children | a47b520e8c21 |
files | lisp/wid-edit.el |
diffstat | 1 files changed, 24 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/wid-edit.el Tue Nov 09 13:40:03 1999 +0000 +++ b/lisp/wid-edit.el Tue Nov 09 13:42:34 1999 +0000 @@ -928,29 +928,30 @@ (mouse-face (overlay-get overlay 'mouse-face))) (unwind-protect (let ((track-mouse t)) - (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) - (while (not (button-release-event-p event)) - (setq event (widget-read-event) - pos (widget-event-point event)) - (if (and pos - (eq (get-char-property pos 'button) - button)) - (progn - (overlay-put overlay - 'face - widget-button-pressed-face) - (overlay-put overlay - 'mouse-face - widget-button-pressed-face)) - (overlay-put overlay 'face face) - (overlay-put overlay 'mouse-face mouse-face)))) - (when (and pos - (eq (get-char-property pos 'button) button)) - (widget-apply-action button event))) + (save-excursion + (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) + (while (not (button-release-event-p event)) + (setq event (widget-read-event) + pos (widget-event-point event)) + (if (and pos + (eq (get-char-property pos 'button) + button)) + (progn + (overlay-put overlay + 'face + widget-button-pressed-face) + (overlay-put overlay + 'mouse-face + widget-button-pressed-face)) + (overlay-put overlay 'face face) + (overlay-put overlay 'mouse-face mouse-face)))) + (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))) (let ((up t)