1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

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.
This commit is contained in:
Stefan Kangas 2022-08-07 13:51:39 +02:00
parent 4439a80407
commit 1f4f1358e6
4 changed files with 20 additions and 25 deletions

View 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")

View 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")

View 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

View 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))