/[emacs]/emacs/lisp/wid-edit.el
ViewVC logotype

Diff of /emacs/lisp/wid-edit.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.102 by rms, Tue Nov 27 05:04:13 2001 UTC revision 1.103 by rms, Sun Dec 2 04:49:43 2001 UTC
# Line 856  Recommended as a parent keymap for modes Line 856  Recommended as a parent keymap for modes
856    
857  (defun widget-button-click (event)  (defun widget-button-click (event)
858    "Invoke the button that the mouse is pointing at."    "Invoke the button that the mouse is pointing at."
859    (interactive "@e")    (interactive "e")
860    (if (widget-event-point event)    (if (widget-event-point event)
861        (let* ((pos (widget-event-point event))        (let* ((pos (widget-event-point event))
862               (button (get-char-property pos 'button)))               (start (event-start event))
863                 (button (get-char-property
864                          pos 'button (and (windowp (posn-window start))
865                                           (window-buffer (posn-window start))))))
866          (if button          (if button
867              ;; Mouse click on a widget button.  Do the following              ;; Mouse click on a widget button.  Do the following
868              ;; in a save-excursion so that the click on the button              ;; in a save-excursion so that the click on the button
869              ;; doesn't change point.              ;; doesn't change point.
870              (save-selected-window              (save-selected-window
871                  (select-window (posn-window (event-start event)))
872                (save-excursion                (save-excursion
873                  (mouse-set-point event)                  (goto-char (posn-point (event-start event)))
874                  (let* ((overlay (widget-get button :button-overlay))                  (let* ((overlay (widget-get button :button-overlay))
875                         (face (overlay-get overlay 'face))                         (face (overlay-get overlay 'face))
876                         (mouse-face (overlay-get overlay 'mouse-face)))                         (mouse-face (overlay-get overlay 'mouse-face)))
# Line 907  Recommended as a parent keymap for modes Line 911  Recommended as a parent keymap for modes
911                      (overlay-put overlay 'face face)                      (overlay-put overlay 'face face)
912                      (overlay-put overlay 'mouse-face mouse-face))))                      (overlay-put overlay 'mouse-face mouse-face))))
913    
914                  (unless (pos-visible-in-window-p (widget-event-point event))                (unless (pos-visible-in-window-p (widget-event-point event))
915                    (mouse-set-point event)                  (mouse-set-point event)
916                    (beginning-of-line)                  (beginning-of-line)
917                    (recenter)))                  (recenter))
918                  )
919    
920              (let ((up t) command)              (let ((up t) command)
921                ;; Mouse click not on a widget button.  Find the global                ;; Mouse click not on a widget button.  Find the global

Legend:
Removed from v.1.102  
changed lines
  Added in v.1.103

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26