all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How do I set a timeout for `ffap-machine-p'?
@ 2018-10-29 16:33 Daniel King
  0 siblings, 0 replies; only message in thread
From: Daniel King @ 2018-10-29 16:33 UTC (permalink / raw)
  To: help-gnu-emacs

Hello!

I can rather easily make Emacs unresponsive for tens of seconds. I would like to prevent this behavior. I have isolated the cause of the behavior. I can also reproduce this behavior in vanilla Emacs:

1. start emacs: `emacs --no-init-file'
2. switch to the scratch buffer
3. type `gcr.io' on an empty line
4. move point to the `g' in `gcr.io’ 
5. execute `M-x find-file-at-point’

The messages buffer shows:

    Pinging gcr.io (British Indian Ocean Territory)...
    ffap-machine-p: Failed connect: Operation timed out

If I smash C-g several times I can prevent the second message from appearing; however, doing so does not seem to decrease the time I spend waiting. In fact, I would expect C-g to immediately cancel the network operation. I just timed this and I had to wait 80 seconds before Emacs responded to my commands.

Anyway, I’d like to set the timeout for `ffap-machine-p' to 1 second. For now, I’ve disabled this by setting `ffap-machine-p-known' to `'reject'.

I looked around a bit at docs for `open-network-stream', but don’t see anyway to specify a timeout. Moreover, there does not appear to be any way to configure the call within `ffap-machine-p', https://github.com/emacs-mirror/emacs/blob/master/lisp/ffap.el#L460 <https://github.com/emacs-mirror/emacs/blob/master/lisp/ffap.el#L460>.

Thanks!
--
Dan



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-10-29 16:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-29 16:33 How do I set a timeout for `ffap-machine-p'? Daniel King

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.