From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#6202: Async shell command, switching mode, and sleep-for Date: Wed, 06 Jul 2016 20:01:10 -0400 Message-ID: <87eg76co55.fsf@users.sourceforge.net> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1467849747 28834 80.91.229.3 (7 Jul 2016 00:02:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Jul 2016 00:02:27 +0000 (UTC) Cc: 6202@debbugs.gnu.org To: Arni Magnusson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 07 02:02:14 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bKwli-00070K-85 for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Jul 2016 02:02:14 +0200 Original-Received: from localhost ([::1]:36434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKwlh-0007Uk-8A for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Jul 2016 20:02:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKwla-0007TS-70 for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2016 20:02:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKwlV-0004Ju-8a for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2016 20:02:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKwlV-0004Jo-4X for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2016 20:02:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bKwlU-0004Cx-Oc for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2016 20:02:00 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Jul 2016 00:02:00 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6202 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6202-submit@debbugs.gnu.org id=B6202.146784967013674 (code B ref 6202); Thu, 07 Jul 2016 00:02:00 +0000 Original-Received: (at 6202) by debbugs.gnu.org; 7 Jul 2016 00:01:10 +0000 Original-Received: from localhost ([127.0.0.1]:40029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bKwkg-0003YB-9z for submit@debbugs.gnu.org; Wed, 06 Jul 2016 20:01:10 -0400 Original-Received: from mail-io0-f177.google.com ([209.85.223.177]:33008) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bKwke-0003RC-6D; Wed, 06 Jul 2016 20:01:08 -0400 Original-Received: by mail-io0-f177.google.com with SMTP id t74so9451802ioi.0; Wed, 06 Jul 2016 17:01:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=8MYan7qSYbXGYPBRXYAMyXgHvFi/joTyE5JlF6jLR3k=; b=nXHR0x7GgzRlbUJZ22/GzqHbZKRkYUBOuT6Xm6K9nYLKdbne6w6byFnqIQIC7yqOyf vQqQYdgHf9I7GC+31tXCBsmBWm+5NpoUqxYo3jzqh+et43sC+jMWRpLjraLYOiPEdFBT nZ44ieWfLRFUDVsr5sU8XtwYE7WoUnIv/0SMsNl/eI5QyvlXAZDGXrw0vCS4fGBRNSG0 3r7wzBe4WVE4/qUluGEYNNqcWKJGSR/o0SES7HuPiuXi6CQEX234jnqBy1RbY6y4fsQD d8DhBcfq2JQXseFw5mQ136uDG1/MOlHYraVm/zZ5pmWFMxFKcNjDCiHpgM/NUiCxshXL ZrbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=8MYan7qSYbXGYPBRXYAMyXgHvFi/joTyE5JlF6jLR3k=; b=Lgn3qyDNB9TLeVTWzLtQ1H27uhIRxDnBkR2iRnfSn6d1xMFlB0St2O3uE60KiOuib0 0QpE1oY048RH7T+6bdM0jsVC6Kn1MqEkpQ3Ot6GpN7xcfpJ8UbOsu9bhI31QAubxCTi0 ePR7/GvbFs1sEnfCtNcTRzjtWK1GwTk/oFcFN7cEFd3fzv5shKxFeVlsgk4t7/f5f5fT G8xQ4DEu0D+oMKwPMlv2cBGT8IH6vG1rGubKacoxMeo/0RvaM70e+kXXHoZYiKQNn4Pm vwQO1ElQDYUJoTaR7VBVjjGFY/W7HJ4v0lXJFjhAKR4cB6VKllJ/kDsWPAN9LXzncSa1 isCA== X-Gm-Message-State: ALyK8tL4Jft1p+CsHBkiWMYaJkGFHOBow5TGZPIzbNiyl7VeM49fPu+YSRMGBhMdS/OYVg== X-Received: by 10.107.131.162 with SMTP id n34mr123321ioi.126.1467849662407; Wed, 06 Jul 2016 17:01:02 -0700 (PDT) Original-Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id f131sm99457itc.3.2016.07.06.17.01.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jul 2016 17:01:01 -0700 (PDT) In-Reply-To: (Arni Magnusson's message of "Sun, 16 May 2010 15:01:55 +0000 (UTC)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) 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:120545 Archived-At: tags 6202 notabug quit Still happens with 25.0.95 Got this error: Debugger entered--Lisp error: (wrong-type-argument markerp nil) comint-output-filter(# "!;=;\\\nACLOCAL_PATH=C[...]") Edebbugging comint-output-filter I found problem happens at (set-marker comint-last-output-start (point)) comint-last-output-start is set (buffer-locally) in comint-mode, switching to fundamental-mode kills this variable (and all other buffer-local variables). Adding the sleep-for allows the subprocess to finish before this happens. I think this is not a bug, the foo command can be fixed by doing: (defun foo () (interactive) (shell-command "set &") (with-current-buffer (get-buffer "*Async Shell Command*") (comint-mode))) Arni Magnusson writes: > > I also stumbled upon a separate issue, where the above function (after > uncommenting the `sleep-for' line) makes Emacs dutifully freeze for 3 > seconds in Linux, but not in Windows. This bug/limitation is not > mentioned on the help page for `sleep-for'. I noticed (sleep-for 3) did not pause in Windows with Emacs 24.5, but did pause with 25.0.95, so it seems this problem has been fixed. And regarding use of call-process instead (mentioned elsewhere in this bug thread), current docstring of shell-command does have In Elisp, you will often be better served by calling `call-process' or `start-process' directly, since it offers more control and does not impose the use of a shell (with its need to quote arguments).