all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Arni Magnusson <arnima@hafro.is>
Cc: 6202@debbugs.gnu.org
Subject: bug#6202: Async shell command, switching mode, and sleep-for
Date: Wed, 06 Jul 2016 20:01:10 -0400	[thread overview]
Message-ID: <87eg76co55.fsf@users.sourceforge.net> (raw)
In-Reply-To: <alpine.LFD.2.00.1005161346310.10157@hafstormur.hafro.is> (Arni Magnusson's message of "Sun, 16 May 2010 15:01:55 +0000 (UTC)")

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(#<process Shell> "!;=;\\\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 <arnima@hafro.is> 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).





  parent reply	other threads:[~2016-07-07  0:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-16 15:01 bug#6202: Async shell command, switching mode, and sleep-for Arni Magnusson
2010-05-16 20:48 ` Stefan Monnier
2010-05-17  9:55   ` Štěpán Němec
2010-05-17 13:30     ` Stefan Monnier
2016-07-07  0:01 ` npostavs [this message]
2016-07-07 15:37   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eg76co55.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=6202@debbugs.gnu.org \
    --cc=arnima@hafro.is \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.