]> git.eshelyaron.com Git - emacs.git/commitdiff
Declare unused function ediff-user-grabbed-mouse obsolete
authorStefan Kangas <stefan@marxist.se>
Sun, 7 Aug 2022 11:51:39 +0000 (13:51 +0200)
committerStefan Kangas <stefan@marxist.se>
Sun, 7 Aug 2022 12:50:05 +0000 (14:50 +0200)
* 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
lisp/vc/ediff-mult.el
lisp/vc/ediff-util.el
lisp/vc/ediff-wind.el

index 273bad5d3531d693d1d2d4624aaee9a3fffb6729..e83a172cb844f16cc291f882015a40fd01d8958f 100644 (file)
@@ -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")
index b7c349fc1cd9e2232992505e834d4739ed77d3b6..fc2d899c2eb0fc97c0b4d5e442067b98f2a45024 100644 (file)
@@ -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")
index 97dfc02201253f8f144411991a7d4a9a25f8bc86..dd01feb1a7c8912ff4a2efb48cc8801eb21b4c93 100644 (file)
@@ -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
index 6db3667545ef4ac0872a44a918abe7ae45856480..0579cee6ecf397e61963b67f2eae8ef73eadd8ac 100644 (file)
@@ -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))