all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* changing default name of shell
@ 2002-10-15  5:47 Chris
  2002-10-15  7:06 ` Miles Bader
  2002-10-18 15:15 ` Jesper Harder
  0 siblings, 2 replies; 5+ messages in thread
From: Chris @ 2002-10-15  5:47 UTC (permalink / raw)


Is there a way I can automatically change the name of a shell buffer when I 
open it? I would it to be called just "shell" or something without the * 
surrounding the name so it is easier to complete with tab completion...

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

* Re: changing default name of shell
  2002-10-15  5:47 changing default name of shell Chris
@ 2002-10-15  7:06 ` Miles Bader
  2002-10-18 15:15 ` Jesper Harder
  1 sibling, 0 replies; 5+ messages in thread
From: Miles Bader @ 2002-10-15  7:06 UTC (permalink / raw)


Chris <chrisl_ak@hotmail.com> writes:
> Is there a way I can automatically change the name of a shell buffer when I 
> open it? I would it to be called just "shell" or something without the * 
> surrounding the name so it is easier to complete with tab completion...

If you have a recent (21.x) version of emacs, give `M-x shell' command a
prefix argument, e.g., `C-u M-x shell', and it will prompt you for a
name.

Otherwise, you could always use `M-x rename-buffer' after you create
the shell.

-miles
-- 
P.S.  All information contained in the above letter is false,
      for reasons of military security.

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

* RE: changing default name of shell
@ 2002-10-15 15:40 Bingham, Jay
  0 siblings, 0 replies; 5+ messages in thread
From: Bingham, Jay @ 2002-10-15 15:40 UTC (permalink / raw)


Add this to your .emacs:
(add-hook 'shell-mode-hook (lambda () (rename-buffer "shell")))

If you want to have multiple shells each with a unique name generated without the asterisks you can do this:
(add-hook 'shell-mode-hook (lambda () (rename-buffer (generate-new-buffer-name "shell"))))

This will produce a buffer named shell on the first invocation and will produce buffers named shell<n>, where n is a unique number starting with 2 and incrementing by one, with each subsequent invocation of the shell.  If you don't like the <>'s you will have to get more creative inside the lambda expression to strip them out.


-_
J_)
C_)ingham
.    HP - NonStop Austin Software & Services - Software Product Assurance
.    Austin, TX
. Language is the apparel in which your thoughts parade in public.
. Never clothe them in vulgar and shoddy attire.          -Dr. George W. Crane-

 -----Original Message-----
From: 	Miles Bader [mailto:miles@lsi.nec.co.jp] 
Sent:	Tuesday, October 15, 2002 2:06 AM
To:	help-gnu-emacs@gnu.org
Subject:	Re: changing default name of shell

Chris <chrisl_ak@hotmail.com> writes:
> Is there a way I can automatically change the name of a shell buffer when I 
> open it? I would it to be called just "shell" or something without the * 
> surrounding the name so it is easier to complete with tab completion...

If you have a recent (21.x) version of emacs, give `M-x shell' command a
prefix argument, e.g., `C-u M-x shell', and it will prompt you for a
name.

Otherwise, you could always use `M-x rename-buffer' after you create
the shell.

-miles
-- 
P.S.  All information contained in the above letter is false,
      for reasons of military security.


_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnu-emacs

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

* RE: changing default name of shell
       [not found] <mailman.1034697434.15976.help-gnu-emacs@gnu.org>
@ 2002-10-15 17:18 ` Chris
  0 siblings, 0 replies; 5+ messages in thread
From: Chris @ 2002-10-15 17:18 UTC (permalink / raw)


on 15 Oct 2002, "Bingham, Jay" <Jay.Bingham@hp.com> spake thusly:

> If you want to have multiple shells each with a unique name generated
> without the asterisks you can do this: 
> (add-hook 'shell-mode-hook
> (lambda () (rename-buffer (generate-new-buffer-name "shell")))) 

Perfect, this is exactly what I needed despite my initial query being a bit 
vague. Thanks...

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

* Re: changing default name of shell
  2002-10-15  5:47 changing default name of shell Chris
  2002-10-15  7:06 ` Miles Bader
@ 2002-10-18 15:15 ` Jesper Harder
  1 sibling, 0 replies; 5+ messages in thread
From: Jesper Harder @ 2002-10-18 15:15 UTC (permalink / raw)


Chris <chrisl_ak@hotmail.com> writes:

> Is there a way I can automatically change the name of a shell buffer when I 
> open it? I would it to be called just "shell" or something without the * 

`C-u M-x shell' will query for the name.  You could also just make
wrapper and use that, e.g.:

(defun my-shell ()
  (interactive)
  (shell "shell"))

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

end of thread, other threads:[~2002-10-18 15:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-15  5:47 changing default name of shell Chris
2002-10-15  7:06 ` Miles Bader
2002-10-18 15:15 ` Jesper Harder
  -- strict thread matches above, loose matches on Subject: below --
2002-10-15 15:40 Bingham, Jay
     [not found] <mailman.1034697434.15976.help-gnu-emacs@gnu.org>
2002-10-15 17:18 ` Chris

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.