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

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

Re: Distinguishing between interactive and asynchronous shell buffers


From: Deniz Dogan
Subject: Re: Distinguishing between interactive and asynchronous shell buffers
Date: Wed, 23 Feb 2011 19:28:03 +0100

2011/2/23 Stefan Monnier <monnier@iro.umontreal.ca>:
>> Digging into simple.el, the only difference I could find between
>> asynchronous and interactive shell buffers is that the former have
>> process sentinels associated with them when they're running; after they
>> finish, they of course have no process at all.  That led me to write:
>
> Indeed, there are very few differences between them.  Another way to
> distinguish them is to look at the buffer's history: if you never type
> in async-shell-command buffers, then the input history should be empty
> in those buffers.  E.g. maybe checking (eq (point-min)
> comint-last-input-start) will do the trick.
> Another way is to check (string-match "Async" (buffer-name)).
>

Aren't those methods a bit tacky?  I feel like there should be a
better way.

I barely know anything about comint/shell-mode but how about a
buffer-local variable which indicates whether or not the process is
running asynchronously?



reply via email to

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