[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to start shell and rename the buffer
From: |
Decebal |
Subject: |
Re: How to start shell and rename the buffer |
Date: |
Fri, 16 Jan 2009 02:58:00 -0800 (PST) |
User-agent: |
G2/1.0 |
On Jan 15, 4:34 pm, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
> You're assuming that --eval will loop. If that had been the case, it
> would have been called --eval-loop. Instead it is called --eval, and
> therefore it only does that.
>
> When you want to group several expressionsions in a sequence, you must
> use prog1, prog2 or in general, progn:
>
> emacs --eval '(progn (shell) (rename-buffer "shell"))'
I allready did this.
> But since you don't pass -q, emacs will read your ~/.emacs, so you
> can as well put there a function such as:
>
> (defun shell-and-rename (name)
> (interactive "sName: ")
> (shell)
> (rename-buffer name))
>
> and then:
>
> emacs --eval '(shell-and-rename "shell")'
In principal a good idea, but it is done in a script. At the moment I
am the only one using the script, but you never know, so I like to
keep the dependicies as low as possible.
I am also thinking about:
emacs --eval '(shell)' --eval '(rename-buffer "shell")'
or
emacs --eval '(shell)'\
--eval '(rename-buffer "shell")'
I think that is more clear.