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

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

Re: undo in shell buffer?


From: Tim X
Subject: Re: undo in shell buffer?
Date: Fri, 09 Jan 2009 09:21:53 +1100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

"Samuel Wales" <samologist@gmail.com> writes:

> I ran a large output, and found that a warning popped up about undo
> using up too much memory.
>
> Is undo necessary in that buffer except for the last line?  Is it safe
> to make undo-limit buffer-local and set it to a low value?
>

Never done this myself, but it seems reasonable. 

> Also, I'm not sure I know the benefits and drawbacks of shell vs.
> term.  Both seem to work with a little tweaking.  Which do most people
> use?
>
> I find m-r to be inconvenient in the shell buffer, because you have to
> press ret.  i also find it inconvenient that cycling the command line
> history wraps around instead of stopping.  Yet perhaps I would have to
> get used to things in term, like moving around to copy stuff.  And my
> prompt isn't working in term yet.
>

There are essentially three different methods to interact with a 'shell'
under emacs. Each of them has their own advantages and
disadvantages. The choice as to which is better depends on what you are
wanting to do and your own preferred way of working. 

1. Shell mode: This is essentially a low level 'dumb' terminal
interface. It is good for simple command line operations or running
programs that don't need higher level terminal I/O. As its a dumb
terminal, you cannot run programs that use things like ncurses to
control terminal I/O. Many of the progrms/utilities you can run from
shell mode also have native emacs commands, such as grep, find, locate
etc. 

2. Term mode: this is a more sophisticated shell interface with support
for ANSI escape characters and can run programs that require more
sophisticated terminal I/O, such as ncurses based programs. To get the
best out of this mode, you should install the etc/e/term-color terminfo
file in the appropriate place e.g. /etc/terminfo/e on your system. Term
mode also provides two different operational modes - character mode and
line mode. In terminal character mode, all your characters are sent to
the shell, so hitting the up arrow will be interpreted by the shell
(under bash, this would usually cycle through command history). In
terminal line mode, some characters are interpreted by emacs e.g. the up
arrow will move the cursor to the previous line in the buffer). Many of
the standard emacs key bindings don't work in term mode because they are
characters that would normally have shell interpretations. some emacs
keybindins are modified to use a control c prefix instead of the normal
prefix e.g. C-b is switch to buffer instead of the normal X-b. 

3. eshell mode: This is a shell mode written in emacs lisp. It provides
useful low level interface with the OS, but has some significant
restrictions, particularly in the area of file redirection. It has the
advantage of a tight integration with emacs lisp and you can call emacs
functions directly on the command line. 

I find I frequently use all three different shell modes depending on
what I want to do. 

Tim


-- 
tcross (at) rapttech dot com dot au


reply via email to

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