branch: externals/ivy-hydra
commit d8378716f552174380542c404b12e61808ad8538
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy-thing-at-point): Don't hang when pinging machine
Call stack:
- ivy-thing-at-point
- file-name-at-point-functions
- ffap-guess-file-name-at-point
- ffap-guesser
- ffap-machine-at-point
- ffap-machine-p
Fixes #2311
---
ivy.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ivy.el b/ivy.el
index 80d867c..425e60f 100644
--- a/ivy.el
+++ b/ivy.el
@@ -521,6 +521,8 @@ the restoring themselves.")
(defvar inhibit-message)
+(defvar ffap-machine-p-known)
+
(defun ivy-thing-at-point ()
"Return a string that corresponds to the current thing at point."
(substring-no-properties
@@ -532,7 +534,8 @@ the restoring themselves.")
(buffer-substring-no-properties beg (min end eol))))
((thing-at-point 'url))
((and (eq (ivy-state-collection ivy-last) #'read-file-name-internal)
- (let ((inhibit-message t))
+ (let ((inhibit-message t)
+ (ffap-machine-p-known 'reject))
(run-hook-with-args-until-success
'file-name-at-point-functions))))
((let ((s (thing-at-point 'symbol)))
(and (stringp s)