comparison lisp/wid-edit.el @ 90199:bb71c6cf2009

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-67 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 447-458) - Update from CVS - Update from CVS: lisp/subr.el (add-to-ordered-list): Doc fix. - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 83-85) - Merge from emacs--cvs-trunk--0 - Update from CVS
author Miles Bader <miles@gnu.org>
date Thu, 30 Jun 2005 00:31:46 +0000
parents a1b34dec1104 73e0fc286df5
children f9a65d7ebd29
comparison
equal deleted inserted replaced
90198:97f6c3a96df1 90199:bb71c6cf2009
965 (mouse-set-point event) 965 (mouse-set-point event)
966 (beginning-of-line) 966 (beginning-of-line)
967 (recenter)) 967 (recenter))
968 ) 968 )
969 969
970 (let ((up t) command) 970 (let ((up t) command)
971 ;; Mouse click not on a widget button. Find the global 971 ;; Mouse click not on a widget button. Find the global
972 ;; command to run, and check whether it is bound to an 972 ;; command to run, and check whether it is bound to an
973 ;; up event. 973 ;; up event.
974 (mouse-set-point event) 974 (mouse-set-point event)
975 (if (memq (event-basic-type event) '(mouse-1 down-mouse-1)) 975 (if (memq (event-basic-type event) '(mouse-1 down-mouse-1))
976 (cond ((setq command ;down event
977 (lookup-key widget-global-map [down-mouse-1]))
978 (setq up nil))
979 ((setq command ;up event
980 (lookup-key widget-global-map [mouse-1]))))
981 (cond ((setq command ;down event 976 (cond ((setq command ;down event
982 (lookup-key widget-global-map [down-mouse-2])) 977 (lookup-key widget-global-map [down-mouse-1]))
983 (setq up nil)) 978 (setq up nil))
984 ((setq command ;up event 979 ((setq command ;up event
985 (lookup-key widget-global-map [mouse-2]))))) 980 (lookup-key widget-global-map [mouse-1]))))
986 (when up 981 (cond ((setq command ;down event
987 ;; Don't execute up events twice. 982 (lookup-key widget-global-map [down-mouse-2]))
988 (while (not (widget-button-release-event-p event)) 983 (setq up nil))
989 (setq event (read-event)))) 984 ((setq command ;up event
990 (when command 985 (lookup-key widget-global-map [mouse-2])))))
991 (call-interactively command))))) 986 (when up
987 ;; Don't execute up events twice.
988 (while (not (widget-button-release-event-p event))
989 (setq event (read-event))))
990 (when command
991 (call-interactively command)))))
992 (message "You clicked somewhere weird."))) 992 (message "You clicked somewhere weird.")))
993 993
994 (defun widget-button-press (pos &optional event) 994 (defun widget-button-press (pos &optional event)
995 "Invoke button at POS." 995 "Invoke button at POS."
996 (interactive "@d") 996 (interactive "@d")