From: Deniz Dogan <deniz.a.m.dogan@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Distinguishing between interactive and asynchronous shell buffers
Date: Wed, 23 Feb 2011 19:28:03 +0100 [thread overview]
Message-ID: <AANLkTi=vQSSSwj+xAjiWD-=fbi97sKrX-3kN9DcRqo+t@mail.gmail.com> (raw)
In-Reply-To: <jwvlj16wxla.fsf-monnier+gnu.emacs.help@gnu.org>
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?
prev parent reply other threads:[~2011-02-23 18:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-21 0:02 Distinguishing between interactive and asynchronous shell buffers Sean McAfee
2011-02-21 2:43 ` Barry Margolin
2011-02-22 0:24 ` Sean McAfee
2011-02-22 0:50 ` Perry Smith
[not found] ` <mailman.7.1298335846.7153.help-gnu-emacs@gnu.org>
2011-02-22 18:48 ` Sean McAfee
2011-02-22 19:59 ` Perry Smith
2011-02-22 21:18 ` Sean McAfee
2011-02-23 16:03 ` Stefan Monnier
2011-02-23 18:28 ` Deniz Dogan [this message]
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='AANLkTi=vQSSSwj+xAjiWD-=fbi97sKrX-3kN9DcRqo+t@mail.gmail.com' \
--to=deniz.a.m.dogan@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.