help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing window from term


From: Xah Lee
Subject: Re: Changing window from term
Date: Sun, 30 Nov 2008 11:48:39 -0800 (PST)
User-agent: G2/1.0

On Nov 30, 9:24 am, Florian Lindner <Florian.Lind...@xgm.de> wrote:
> Hello,
>
> so far I have discovered two different methods using the shell with
> Emacs. shell and term. shell I don't like because it's too much a text
> file. I prefer just to have my shell in a seperate window (with up and
> down recalling the command history).
> term does this so far. But once loaded some Emacs commands are not
> working anymore. For example I can't change to another buffer with C-x
> o. I know the problem is that the shell input interferes with the
> Emacs input.
>
> Any idea how to make this work?

The purpose of “Alt+x shell” is to let you do interactive shell in
emacs while retain much of the emac's functionalities.

The purpose of “Alt+x term” is to turn emacs into a terminal emulator.

Once you are in a terminal emulator mode, normal emacs bindings you
are used to no longer works because you told emacs to pretend it is a
terminal emulator.

So, basically you cannot have both worlds.

If you really want, you can modify keybinding in one or the other to
get the behavior you like.

e.g.

(add-hook 'comint-mode-hook
 (lambda ()
   (define-key comint-mode-map (kbd "<f11>") 'comint-previous-input)
   (define-key comint-mode-map (kbd "<f12>") 'comint-next-input)
   (define-key comint-mode-map (kbd "S-<f11>") 'comint-previous-
matching-input)
   (define-key comint-mode-map (kbd "S-<f12>") 'comint-next-matching-
input)
))

in your case, you want “<f11>” should be “<up>” and “<f12>” should be
“<down>”.

Btw, by default Ctrl+ up/down arrow should do what you want.

  Xah
∑ http://xahlee.org/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]