branch: externals/embark
commit 67ef67885a2a51c3171b5e47dbb7d9a8d2aab1db
Author: Omar Antolín <omar.anto...@gmail.com>
Commit: Omar Antolín <omar.anto...@gmail.com>

    Simplify test for URLs in file target finder
---
 embark.el | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/embark.el b/embark.el
index a07dd26e6f..2ba4d42e1c 100644
--- a/embark.el
+++ b/embark.el
@@ -738,16 +738,7 @@ In `dired-mode', it uses `dired-get-filename' instead."
                . ,(point)))
     (when-let* ((ffap-file (ffap-file-at-point))
                 (tap-file (thing-at-point 'filename))
-                ;; check the thingatpt candidate is a substring of the
-                ;; ffap candidate, this avoids URLs and keyword
-                ;; symbols when point is on the colon (see bug#52441)
-                ((string-match-p (regexp-quote
-                                  (if (derived-mode-p 'dired-mode)
-                                      ;; directory line, thingatpt includes ":"
-                                      (string-remove-suffix ":" tap-file)
-                                    tap-file))
-                                 ffap-file))
-                ((not (ffap-el-mode tap-file))))
+                ((not (or (ffap-url-p tap-file) (ffap-el-mode tap-file)))))
       `(file ,(abbreviate-file-name (expand-file-name ffap-file))
              ;; TODO the boundaries may be wrong, this should be generalized.
              ;; Unfortunately ffap does not make the bounds available.

Reply via email to