# HG changeset patch # User Chong Yidong # Date 1129592364 0 # Node ID cd540036e3a874be94fd6108d01d2a1d30d852e5 # Parent 28718fa5d988d12138d46a0a5bd8d2c0342dd60a * cus-edit.el (Custom-move-and-invoke): Delete function. (custom-mode-map): Remove Custom-move-and-invoke binding. * wid-edit.el (widget-move-and-invoke): New function. (widget-keymap): Bind mouse-1 to it. diff -r 28718fa5d988 -r cd540036e3a8 lisp/ChangeLog --- a/lisp/ChangeLog Mon Oct 17 22:21:06 2005 +0000 +++ b/lisp/ChangeLog Mon Oct 17 23:39:24 2005 +0000 @@ -1,3 +1,11 @@ +2005-10-17 Chong Yidong + + * cus-edit.el (Custom-move-and-invoke): Delete function. + (custom-mode-map): Remove Custom-move-and-invoke binding. + + * wid-edit.el (widget-move-and-invoke): New function. + (widget-keymap): Bind mouse-1 to it. + 2005-10-17 Bill Wohler Moved all remaining images from lisp/toolbar to etc/images, moved diff -r 28718fa5d988 -r cd540036e3a8 lisp/cus-edit.el --- a/lisp/cus-edit.el Mon Oct 17 22:21:06 2005 +0000 +++ b/lisp/cus-edit.el Mon Oct 17 23:39:24 2005 +0000 @@ -4245,20 +4245,9 @@ (define-key map "u" 'Custom-goto-parent) (define-key map "n" 'widget-forward) (define-key map "p" 'widget-backward) - (define-key map [mouse-1] 'Custom-move-and-invoke) map) "Keymap for `custom-mode'.") -(defun Custom-move-and-invoke (event) - "Move to where you click, and if it is an active field, invoke it." - (interactive "e") - (mouse-set-point event) - (if (widget-event-point event) - (let* ((pos (widget-event-point event)) - (button (get-char-property pos 'button))) - (if button - (widget-button-click event))))) - (easy-menu-define Custom-mode-menu custom-mode-map "Menu used in customization buffers." diff -r 28718fa5d988 -r cd540036e3a8 lisp/wid-edit.el --- a/lisp/wid-edit.el Mon Oct 17 22:21:06 2005 +0000 +++ b/lisp/wid-edit.el Mon Oct 17 23:39:24 2005 +0000 @@ -849,6 +849,7 @@ (define-key map "\t" 'widget-forward) (define-key map [(shift tab)] 'widget-backward) (define-key map [backtab] 'widget-backward) + (define-key map [mouse-1] 'widget-move-and-invoke) (define-key map [down-mouse-2] 'widget-button-click) (define-key map "\C-m" 'widget-button-press) map) @@ -901,6 +902,14 @@ ;; backward-compatibility alias (put 'widget-button-pressed-face 'face-alias 'widget-button-pressed) +(defun widget-move-and-invoke (event) + "Move to where you click, and if it is an active field, invoke it." + (interactive "e") + (mouse-set-point event) + (let ((pos (widget-event-point event))) + (if (and pos (get-char-property pos 'button)) + (widget-button-click event)))) + (defun widget-button-click (event) "Invoke the button that the mouse is pointing at." (interactive "e")