all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Distinguishing between interactive and asynchronous shell buffers
@ 2011-02-21  0:02 Sean McAfee
  2011-02-21  2:43 ` Barry Margolin
  2011-02-22 21:18 ` Sean McAfee
  0 siblings, 2 replies; 9+ messages in thread
From: Sean McAfee @ 2011-02-21  0:02 UTC (permalink / raw)
  To: help-gnu-emacs

I find that dired is a much better way of navigating around a large
directory hierarchy than staying in my shell buffer and issuing lots of
cd/ls commands.  To bring my shell buffer to a directory I've located
with dired, I wrote an interactive command
bring-last-shell-buffer-to-this-directory (aliased to "c'mere") which
locates the most-recently-used shell buffer like this:

  (let ((buffer (or (loop for buffer being the buffers
                          if (with-current-buffer buffer 
                               (eq major-mode 'shell-mode))
                          return buffer)
                    (error "No shell buffers!"))))
    ;; Issue a "cd" command in buffer that sends that shell
    ;; to the starting buffer's default-directory

This works great most of the time, but once I started an asynchronous
shell command after moving around in dired, and when I did M-x c'mere,
my routine tried to send a cd to the *Async Shell Command* buffer.

What's the best way to distinguish asynchronous shell command buffers
from interactive shell buffers?


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-02-23 18:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

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.