From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel King Newsgroups: gmane.emacs.help Subject: How do I set a timeout for `ffap-machine-p'? Date: Mon, 29 Oct 2018 12:33:10 -0400 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1540831635 22820 195.159.176.226 (29 Oct 2018 16:47:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 29 Oct 2018 16:47:15 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 29 17:47:11 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHAh4-0005rO-R7 for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Oct 2018 17:47:10 +0100 Original-Received: from localhost ([::1]:46876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHAjB-0007AJ-92 for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Oct 2018 12:49:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHATo-00075s-E0 for help-gnu-emacs@gnu.org; Mon, 29 Oct 2018 12:33:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHATi-0004qO-GC for help-gnu-emacs@gnu.org; Mon, 29 Oct 2018 12:33:27 -0400 Original-Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:43460) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHATc-0004ga-Gf for help-gnu-emacs@gnu.org; Mon, 29 Oct 2018 12:33:20 -0400 Original-Received: by mail-qk1-x743.google.com with SMTP id r71so5309297qkr.10 for ; Mon, 29 Oct 2018 09:33:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadinstitute-org.20150623.gappssmtp.com; s=20150623; h=from:mime-version:subject:message-id:date:to; bh=3vjhb4n/5q0ifrnaEXzBJst66v0MIXTIFTunFgX888E=; b=fjtzzJD/r3onrudLFsnzQatuETPh2GJPtWola7CfxDiv0/1+dLptEoGrbnGT86qAy9 qdKWEOadWUqNRUdI6gOyrg0zhcNe99+DYEvtfBY//IUItXbXqRLxqVr79o+HC+/UTO7V zk3mP3n6WJXwM3z+MzH5/pZzCnBDL9IqkV1Appw+XTCB9dDj26WW8FUtcdo1EQwuSVSP k7XH2+PnPvAMt71nAo+EErHbYrwm1i2DRd+WhEfwkgM+/ALg+LQl1saj5PONoycpbUaj vTKG8whRRrPKJqnypVhIPjOiBKUER0byZkmWl+ZrEQy0R/TYUFiDANl/iDORAD5Aq5vg kEKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=3vjhb4n/5q0ifrnaEXzBJst66v0MIXTIFTunFgX888E=; b=jYH3u/hdRzOSCARyCS17PIV+tjgjwEAEkE9tr6xSfdRqIja9xsJ9iJ159DuvUb/+GL qyoXTIjhveIW9BNGrJQVtEpDdosq9I7DqG5z+MsiM4k7NXGZfq2QeVAQMH8zBc4RENdo W+rSTlvdzlAZOwpetypd9HotU63cfVT+fcA94lWknCE1kTvdcQKcL4ebwB2lzfnODxe3 KnaM0KGXnzNdEg+JJXcTIqlPSYCz1t1ZHzd07PpIdGbTzlEAn0CBU/wdjx6RZqt7KoiF wiVplJZYljdGJgrCD41Q/a65TjKbDGmYS7qL3Da0dYI2UmikP4ZFpG1xXvImR0KGzW/w SVww== X-Gm-Message-State: AGRZ1gK7iz/UGpLDa1eK6SIvhYgAEgW+WCqZwvw3B4IEgTG0GHru58OW fKzJefPTsx/gwRFa7jyweqfomdH7HNg= X-Google-Smtp-Source: AJdET5f5BjljGwcxJWD0O/LeCWQzNMZ4lxexr+lR7r/knrshgwtBouJ1vxwSOo8ujTlN6KIWdCPdrw== X-Received: by 2002:a37:b683:: with SMTP id g125-v6mr12737665qkf.179.1540830791872; Mon, 29 Oct 2018 09:33:11 -0700 (PDT) Original-Received: from [10.10.97.28] ([69.173.127.229]) by smtp.gmail.com with ESMTPSA id g46-v6sm5228923qta.79.2018.10.29.09.33.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 09:33:10 -0700 (PDT) X-Mailer: Apple Mail (2.3445.9.1) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 X-Mailman-Approved-At: Mon, 29 Oct 2018 12:38:04 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118488 Archived-At: 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=E2=80=99=20 5. execute `M-x find-file-at-point=E2=80=99 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=E2=80=99d like to set the timeout for `ffap-machine-p' to 1 = second. For now, I=E2=80=99ve disabled this by setting = `ffap-machine-p-known' to `'reject'. I looked around a bit at docs for `open-network-stream', but don=E2=80=99t= 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 = . Thanks! -- Dan