emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `y-or-n-p' does not wait for input - assumes `n'


From: Richard Stallman
Subject: Re: `y-or-n-p' does not wait for input - assumes `n'
Date: Wed, 26 Jan 2005 12:08:08 -0500

    The second way to interpret it is that the functions in
    `custom-variable-menu' should be executed with track-mouse bound to
    nil, and if they need to track the mouse, they have to simply rebind
    it to t once more.

I think that is the right approach.  It makes things work the way
one would normally expect.

But I think this is a cleaner implementation of that approach.
Does it work?


*** wid-edit.el 26 Dec 2004 16:31:41 -0500      1.134
--- wid-edit.el 26 Jan 2005 10:23:26 -0500      
***************
*** 911,924 ****
                      ;; 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)
                            (while (not (widget-button-release-event-p event))
                              (setq event (read-event)
                                    pos (widget-event-point event))
--- 911,924 ----
                      ;; until we receive a release event.  Highlight/
                      ;; unhighlight the button the mouse was initially
                      ;; on when we move over it.
!                     (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))
***************
*** 933,945 ****
                                                 '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 'face face)
                    (overlay-put overlay 'mouse-face mouse-face))))
  
--- 933,945 ----
                                                 '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 'face face)
                    (overlay-put overlay 'mouse-face mouse-face))))
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]