]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove some compat code from ffap.el
authorStefan Kangas <stefan@marxist.se>
Thu, 19 Nov 2020 16:46:16 +0000 (17:46 +0100)
committerStefan Kangas <stefan@marxist.se>
Thu, 19 Nov 2020 19:44:55 +0000 (20:44 +0100)
* lisp/ffap.el (ffap-mouse-event, ffap-event-buffer): Make obsolete.
(ffap-menu-ask, ffap-at-mouse): Adjust callers.

lisp/ffap.el

index 9ad421c2777a60084c88c2cc7d5954d2aef10753..d4bddd0574fd9b69d33e4f82de42dad675dd92dd 100644 (file)
@@ -301,15 +301,14 @@ disable ffap most of the time."
   :version "20.3")
 
 \f
-;;; Compatibility:
-;;
-;; This version of ffap supports only the Emacs it is distributed in.
-;; See the ftp site for a more general version.  The following
-;; functions are necessary "leftovers" from the more general version.
+;;; Obsolete:
 
 (defun ffap-mouse-event ()             ; current mouse event, or nil
+  (declare (obsolete nil "28.1"))
   (and (listp last-nonmenu-event) last-nonmenu-event))
+
 (defun ffap-event-buffer (event)
+  (declare (obsolete nil "28.1"))
   (window-buffer (car (event-start event))))
 
 \f
@@ -1736,7 +1735,9 @@ Function CONT is applied to the entry chosen by the user."
   (let (choice)
     (cond
      ;; Emacs mouse:
-     ((and (fboundp 'x-popup-menu) (ffap-mouse-event))
+     ((and (fboundp 'x-popup-menu)
+           (listp last-nonmenu-event)
+           last-nonmenu-event)
       (setq choice
            (x-popup-menu
             t
@@ -1829,7 +1830,7 @@ Return value:
           (ffap-guesser))))
     (cond
      (guess
-      (set-buffer (ffap-event-buffer e))
+      (set-buffer (window-buffer (car (event-start e))))
       (ffap-highlight)
       (unwind-protect
          (progn