From 46110f337ed952f8cf285b94513f67a5a392aab3 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Wed, 8 Dec 2004 22:46:13 +0000 Subject: [PATCH] (calc-keypad-mode): Unbind unused mouse events. (calc-keypad-left-click): Set buffer to calc-keymap-buffer. --- lisp/calc/calc-keypd.el | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/lisp/calc/calc-keypd.el b/lisp/calc/calc-keypd.el index e517ac1942b..2c2a0f0f4aa 100644 --- a/lisp/calc/calc-keypd.el +++ b/lisp/calc/calc-keypd.el @@ -236,9 +236,21 @@ (define-key calc-keypad-mode-map (kbd "RET") 'calc-keypad-press) (define-key calc-keypad-mode-map (kbd "TAB") 'calc-keypad-menu) (define-key calc-keypad-mode-map "q" 'calc-keypad-off) - (define-key calc-keypad-mode-map [(mouse-3)] 'calc-keypad-right-click) - (define-key calc-keypad-mode-map [(mouse-2)] 'calc-keypad-middle-click) - (define-key calc-keypad-mode-map [(mouse-1)] 'calc-keypad-left-click) + (define-key calc-keypad-mode-map [down-mouse-1] 'ignore) + (define-key calc-keypad-mode-map [drag-mouse-1] 'ignore) + (define-key calc-keypad-mode-map [double-mouse-1] 'ignore) + (define-key calc-keypad-mode-map [triple-mouse-1] 'ignore) + (define-key calc-keypad-mode-map [down-mouse-2] 'ignore) + (define-key calc-keypad-mode-map [drag-mouse-2] 'ignore) + (define-key calc-keypad-mode-map [double-mouse-2] 'ignore) + (define-key calc-keypad-mode-map [triple-mouse-2] 'ignore) + (define-key calc-keypad-mode-map [down-mouse-3] 'ignore) + (define-key calc-keypad-mode-map [drag-mouse-3] 'ignore) + (define-key calc-keypad-mode-map [double-mouse-3] 'ignore) + (define-key calc-keypad-mode-map [triple-mouse-3] 'ignore) + (define-key calc-keypad-mode-map [mouse-3] 'calc-keypad-right-click) + (define-key calc-keypad-mode-map [mouse-2] 'calc-keypad-middle-click) + (define-key calc-keypad-mode-map [mouse-1] 'calc-keypad-left-click) (put 'calc-keypad-mode 'mode-class 'special) (make-local-variable 'calc-main-buffer)) @@ -529,8 +541,9 @@ (defun calc-keypad-left-click (event) "Handle a left-button mouse click in Calc Keypad window." (interactive "e") - (goto-char (posn-point (event-start event))) - (calc-keypad-press)) + (with-current-buffer calc-keypad-buffer + (goto-char (posn-point (event-start event))) + (calc-keypad-press))) (defun calc-keypad-right-click (event) "Handle a right-button mouse click in Calc Keypad window." -- 2.39.5