unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Reusing dead shell buffers
@ 2009-01-11 20:19 jemarch
  2009-01-13 23:27 ` Juri Linkov
  2010-11-17 15:16 ` Stefan Monnier
  0 siblings, 2 replies; 3+ messages in thread
From: jemarch @ 2009-01-11 20:19 UTC (permalink / raw)
  To: emacs-devel


Hi.

Just a tiny patch for shell.

The patch assumes that the person launching M-xshell while in a
shell-mode buffer with a terminated process really wants to launch a
shell process in the current buffer instead to switch to "*shell*".

The semantics of C-uM-xshell are not changed by the patch.

Index: shell.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/shell.el,v
retrieving revision 1.165
diff -u -r1.165 shell.el
--- shell.el	5 Jan 2009 03:19:45 -0000	1.165
+++ shell.el	11 Jan 2009 19:46:35 -0000
@@ -555,6 +555,9 @@
 		      (read-file-name
 		       "Default directory: " default-directory default-directory
 		       t nil 'file-directory-p))))))))
+  ;; If the current buffer is a dead shell buffer, use it.
+  (if (and (not buffer) (eq major-mode 'shell-mode))
+      (setq buffer (current-buffer)))
   (setq buffer (get-buffer-create (or buffer "*shell*")))
   ;; Pop to buffer, so that the buffer's window will be correctly set
   ;; when we call comint (so that comint sets the COLUMNS env var properly).




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

end of thread, other threads:[~2010-11-17 15:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-11 20:19 Reusing dead shell buffers jemarch
2009-01-13 23:27 ` Juri Linkov
2010-11-17 15:16 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).