From 1f4f1358e62e2df2b15e557c0008e13d93b9393a Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 7 Aug 2022 13:51:39 +0200 Subject: [PATCH] Declare unused function ediff-user-grabbed-mouse obsolete * lisp/vc/ediff-init.el (ediff-user-grabbed-mouse): Declare unused function obsolete. As far as I can tell, this has been unused since 1996. * lisp/vc/ediff-wind.el (ediff-mouse-pixel-position): Make variable obsolete. It is only used in the above obsolete funct * lisp/vc/ediff-mult.el (ediff-filegroup-action) (ediff-registry-action): * lisp/vc/ediff-util.el (ediff-setup): Don't set above unused variable. * lisp/vc/ediff-init.el (ediff-spy-after-mouse): Make obsolete. * lisp/vc/ediff-util.el (ediff-setup): Don't add above obsolete function to pre-command-hook. --- lisp/vc/ediff-init.el | 37 +++++++++++++++++++------------------ lisp/vc/ediff-mult.el | 2 -- lisp/vc/ediff-util.el | 4 ---- lisp/vc/ediff-wind.el | 2 +- 4 files changed, 20 insertions(+), 25 deletions(-) diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el index 273bad5d353..e83a172cb84 100644 --- a/lisp/vc/ediff-init.el +++ b/lisp/vc/ediff-init.el @@ -1419,26 +1419,27 @@ This default should work without changes." ))) (defsubst ediff-spy-after-mouse () - (setq ediff-mouse-pixel-position (mouse-pixel-position))) + (declare (obsolete nil "29.1")) + (with-suppressed-warnings ((obsolete ediff-mouse-pixel-position)) + (setq ediff-mouse-pixel-position (mouse-pixel-position)))) -;; It is not easy to find out when the user grabs the mouse, since emacs and -;; xemacs behave differently when mouse is not in any frame. Also, this is -;; sensitive to when the user grabbed mouse. Not used for now. (defun ediff-user-grabbed-mouse () - (if ediff-mouse-pixel-position - (cond ((not (eq (car ediff-mouse-pixel-position) - (car (mouse-pixel-position))))) - ((and (car (cdr ediff-mouse-pixel-position)) - (car (cdr (mouse-pixel-position))) - (cdr (cdr ediff-mouse-pixel-position)) - (cdr (cdr (mouse-pixel-position)))) - (not (and (< (abs (- (car (cdr ediff-mouse-pixel-position)) - (car (cdr (mouse-pixel-position))))) - ediff-mouse-pixel-threshold) - (< (abs (- (cdr (cdr ediff-mouse-pixel-position)) - (cdr (cdr (mouse-pixel-position))))) - ediff-mouse-pixel-threshold)))) - (t nil)))) + (declare (obsolete nil "29.1")) + (with-suppressed-warnings ((obsolete ediff-mouse-pixel-position)) + (if ediff-mouse-pixel-position + (cond ((not (eq (car ediff-mouse-pixel-position) + (car (mouse-pixel-position))))) + ((and (car (cdr ediff-mouse-pixel-position)) + (car (cdr (mouse-pixel-position))) + (cdr (cdr ediff-mouse-pixel-position)) + (cdr (cdr (mouse-pixel-position)))) + (not (and (< (abs (- (car (cdr ediff-mouse-pixel-position)) + (car (cdr (mouse-pixel-position))))) + ediff-mouse-pixel-threshold) + (< (abs (- (cdr (cdr ediff-mouse-pixel-position)) + (cdr (cdr (mouse-pixel-position))))) + ediff-mouse-pixel-threshold)))) + (t nil))))) (define-obsolete-function-alias 'ediff-frame-char-height #'frame-char-height "27.1") diff --git a/lisp/vc/ediff-mult.el b/lisp/vc/ediff-mult.el index b7c349fc1cd..fc2d899c2eb 100644 --- a/lisp/vc/ediff-mult.el +++ b/lisp/vc/ediff-mult.el @@ -1861,7 +1861,6 @@ all marked sessions must be active." ;; handle an individual session with a live control buffer ((ediff-buffer-live-p session-buf) (ediff-with-current-buffer session-buf - (setq ediff-mouse-pixel-position (mouse-pixel-position)) (ediff-recenter 'no-rehighlight))) ((ediff-problematic-session-p info) @@ -2005,7 +2004,6 @@ all marked sessions must be active." (ediff-show-meta-buffer ctl-buf t) ;; it's a session buffer -- invoke go back to session (ediff-with-current-buffer ctl-buf - (setq ediff-mouse-pixel-position (mouse-pixel-position)) (ediff-recenter 'no-rehighlight))) (beep) (message "You've selected a stale session --- try again") diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index 97dfc022012..dd01feb1a7c 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -296,10 +296,6 @@ to invocation.") (if (string-match "buffer" (symbol-name ediff-job-name)) (setq ediff-keep-variants t)) - (if (ediff-window-display-p) - (add-hook 'pre-command-hook 'ediff-spy-after-mouse nil 'local)) - (setq ediff-mouse-pixel-position (mouse-pixel-position)) - ;; adjust for merge jobs (if ediff-merge-job (let ((buf diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el index 6db3667545e..0579cee6ecf 100644 --- a/lisp/vc/ediff-wind.el +++ b/lisp/vc/ediff-wind.el @@ -179,6 +179,7 @@ Used internally---not a user option.") (ediff-defvar-local ediff-mouse-pixel-position nil "Position of the mouse. Used to decide whether to warp the mouse into control frame.") +(make-obsolete-variable 'ediff-mouse-pixel-position "it is unused." "29.1") ;; not used for now (defvar ediff-mouse-pixel-threshold 30 @@ -901,7 +902,6 @@ Create a new splittable frame if none is found." fheight fwidth adjusted-parameters) (with-current-buffer ctl-buffer - ;;(setq user-grabbed-mouse (ediff-user-grabbed-mouse)) (run-hooks 'ediff-before-setup-control-frame-hook)) (setq old-ctl-frame (with-current-buffer ctl-buffer ediff-control-frame)) -- 2.39.2