unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim X <timx@nospam.dev.null>
To: help-gnu-emacs@gnu.org
Subject: Re: undo in shell buffer?
Date: Fri, 09 Jan 2009 09:21:53 +1100	[thread overview]
Message-ID: <87mye1wi9q.fsf@lion.rapttech.com.au> (raw)
In-Reply-To: mailman.4197.1231295141.26697.help-gnu-emacs@gnu.org

"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


  parent reply	other threads:[~2009-01-08 22:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.4197.1231295141.26697.help-gnu-emacs@gnu.org>
2009-01-07 18:20 ` undo in shell buffer? Xah Lee
2009-01-08 22:21 ` Tim X [this message]
2009-01-08 23:13   ` Samuel Wales
2009-01-08 23:49     ` Samuel Wales
     [not found]   ` <mailman.4363.1231456397.26697.help-gnu-emacs@gnu.org>
2009-01-09  1:43     ` Barry Margolin
2009-01-09  2:48       ` Samuel Wales
2009-01-09 13:38   ` fmoreau
2009-01-07  2:25 Samuel Wales
2009-01-07  9:24 ` Peter Dyballa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mye1wi9q.fsf@lion.rapttech.com.au \
    --to=timx@nospam.dev.null \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).