From: Chong Yidong Date: Mon, 17 Oct 2005 23:39:24 +0000 (+0000) Subject: * cus-edit.el (Custom-move-and-invoke): Delete function. X-Git-Tag: emacs-pretest-22.0.90~6533 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=185d1922fbf5f92cc444f0c29ba6b05d980f7aff;p=emacs.git * 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 --git a/lisp/ChangeLog b/lisp/ChangeLog index ebc420983fb..f059ad388be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 8f88e4d049c..026911686b1 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -4245,20 +4245,9 @@ The format is suitable for use with `easy-menu-define'." (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 --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 8335a202120..ce186d1b68f 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -849,6 +849,7 @@ button end points." (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 @@ Recommended as a parent keymap for modes using widgets.") ;; 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")