bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#6202: Async shell command, switching mode, and sleep-for


From: npostavs
Subject: bug#6202: Async shell command, switching mode, and sleep-for
Date: Wed, 06 Jul 2016 20:01:10 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux)

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).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]