From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#27036: Acknowledgement (25.1; Blocking call to accept-process-output with quit inhibited!!) Date: Sat, 27 May 2017 03:22:19 +0300 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------11B0BE0D224FA836E16EFD42" X-Trace: blaine.gmane.org 1495844592 32457 195.159.176.226 (27 May 2017 00:23:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 27 May 2017 00:23:12 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Thunderbird/54.0 To: Francesco =?UTF-8?Q?Potort=C3=AC?= , 27036@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 27 02:23:08 2017 Return-path: Envelope-to: geb-bug-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 1dEPVb-0008L6-Qg for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 May 2017 02:23:08 +0200 Original-Received: from localhost ([::1]:38997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEPVh-0006zS-8C for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 May 2017 20:23:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEPVb-0006z6-4H for bug-gnu-emacs@gnu.org; Fri, 26 May 2017 20:23:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEPVX-0001D2-OD for bug-gnu-emacs@gnu.org; Fri, 26 May 2017 20:23:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37064) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dEPVX-0001Ct-Jy for bug-gnu-emacs@gnu.org; Fri, 26 May 2017 20:23:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dEPVX-0006Yv-BK for bug-gnu-emacs@gnu.org; Fri, 26 May 2017 20:23:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 May 2017 00:23:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27036 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 27036-submit@debbugs.gnu.org id=B27036.149584454925164 (code B ref 27036); Sat, 27 May 2017 00:23:03 +0000 Original-Received: (at 27036) by debbugs.gnu.org; 27 May 2017 00:22:29 +0000 Original-Received: from localhost ([127.0.0.1]:39741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dEPUz-0006Xo-8K for submit@debbugs.gnu.org; Fri, 26 May 2017 20:22:29 -0400 Original-Received: from mail-wr0-f177.google.com ([209.85.128.177]:34104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dEPUy-0006Xa-GD for 27036@debbugs.gnu.org; Fri, 26 May 2017 20:22:28 -0400 Original-Received: by mail-wr0-f177.google.com with SMTP id j27so9330020wre.1 for <27036@debbugs.gnu.org>; Fri, 26 May 2017 17:22:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=wC7KhfEQs9BEhudLdHIxr5MD1sCjzAQ80X+OgINuvPE=; b=q5j9NINqcANd8XLQrcVDWX4kClSFenRYi4RusSrjExugk0uCdHNi6gxHXaZx9d2Syu h/6oYszzsivlYfGU90oiOPQoXntl6V1UjeBFXfcw7UN9nFU+XPsbH5j7z100EkFQw9w0 lMnKGEsNABcoJX1GnP2M6Yktu2melJuIntoLH5N03TmEbs29Y5ufxgnxAAlWP4aivm5l ao6WQisYmixDsqeEtlcXhFIZ9sBCjhwMpMk645U1Jr/vw9f0SvTWXdQMqKac8BFx/RVw 4jyQOPwWHkTnTyE87h5Yc9JW6D7MCEQxK4rsu5plh1jyfTeYIQFOQTMX4sS+Lo8YJcpP wApg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language; bh=wC7KhfEQs9BEhudLdHIxr5MD1sCjzAQ80X+OgINuvPE=; b=gn3oegwDpY4hKMdlhA1k2WGWZXWSje7AuzVox7u1EsIV+JqpdoLUWb6cGfH9uY2SBN tpBZvLcoF+Yc34l6oHmC0dXyXTcG6pxyeaIVy1CVOGf/aipenyXn2pGWG/yWHQNcDtY4 R14yLWNGaU65wX9Fyp7azgZlm5A7sT0AJKHiwcNtLicIySlFh9rxN9OLYs4sBTQrAorc niTzvoViC5031cxNQnmMN1Jzadbw62HUbbDzHTi98w1nbYbA8SOPQGp2eKTtrfQ0l/Ya pGE99OVF7gvjr0IFJim8Ve7Qcnxs8ZFkont1f3BWSaH2JIpylZ70y+9jI+DB5ZrcusOe lI+g== X-Gm-Message-State: AODbwcAzj7kXOJuJLSPLXB7tRHpSrXek2giWrVetUR9a+1hyqwiOHqx6 T+S2yI7p3Wrbm9w1j/w= X-Received: by 10.223.178.85 with SMTP id y21mr3241964wra.58.1495844542551; Fri, 26 May 2017 17:22:22 -0700 (PDT) Original-Received: from [192.168.1.3] ([185.105.174.193]) by smtp.googlemail.com with ESMTPSA id m17sm3750431wmi.6.2017.05.26.17.22.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 May 2017 17:22:21 -0700 (PDT) In-Reply-To: Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:132901 Archived-At: This is a multi-part message in MIME format. --------------11B0BE0D224FA836E16EFD42 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 5/26/17 4:17 PM, Francesco Potortì wrote: > if Octave is running a long command it > locks Emacs until the long command execution finishes and the prompt is > returned. Yes, this problem should be common for all modes that use the REPL for fetching information like this. E.g. python-eldoc-function. Normally, we don't see long-running commands in the user REPL. Or don't expect the user to switch back to the source buffer and continue editing. Octave might be a significant exception in that regard. Anyway, please try the attached combined patch and see if it fixes your problem. > It also makes damage in some other cases that I cannot identify. If you have company-mode installed and enabled, similar problem can occur (when completion is triggered automatically). --------------11B0BE0D224FA836E16EFD42 Content-Type: text/x-patch; name="octave-eldoc.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="octave-eldoc.diff" diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index ac9ba63..d0a92d8 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -938,12 +938,19 @@ inferior-octave-send-list-and-digest (while (setq string (car list)) (setq inferior-octave-output-string nil inferior-octave-receive-in-progress t) - (comint-send-string proc string) - (while inferior-octave-receive-in-progress - (accept-process-output proc)) + (process-send-string proc string) + (while + (and inferior-octave-receive-in-progress + (with-local-quit + (accept-process-output proc)))) (setq list (cdr list))) (set-process-filter proc filter)))) +(defun inferior-octave--busy-p () + (not + (buffer-local-value 'comint-last-prompt + (process-buffer inferior-octave-process)))) + (defvar inferior-octave-directory-tracker-resync nil) (make-variable-buffer-local 'inferior-octave-directory-tracker-resync) @@ -1586,19 +1593,21 @@ octave-eldoc-message-style (defvar octave-eldoc-cache nil) (defun octave-eldoc-function-signatures (fn) - (unless (equal fn (car octave-eldoc-cache)) - (inferior-octave-send-list-and-digest - (list (format "print_usage ('%s');\n" fn))) - (let (result) - (dolist (line inferior-octave-output-list) - (when (string-match - "\\s-*\\(?:--[^:]+\\|usage\\):\\s-*\\(.*\\)$" - line) - (push (match-string 1 line) result))) - (setq octave-eldoc-cache - (cons (substring-no-properties fn) - (nreverse result))))) - (cdr octave-eldoc-cache)) + (if (equal fn (car octave-eldoc-cache)) + (cdr octave-eldoc-cache) + (unless (inferior-octave--busy-p) + (inferior-octave-send-list-and-digest + (list (format "print_usage ('%s');\n" fn))) + (let (result) + (dolist (line inferior-octave-output-list) + (when (string-match + "\\s-*\\(?:--[^:]+\\|usage\\):\\s-*\\(.*\\)$" + line) + (push (match-string 1 line) result))) + (setq octave-eldoc-cache + (cons (substring-no-properties fn) + (nreverse result)))) + (cdr octave-eldoc-cache)))) (defun octave-eldoc-function () "A function for `eldoc-documentation-function' (which see)." --------------11B0BE0D224FA836E16EFD42--