From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: undo in shell buffer? Date: Fri, 09 Jan 2009 09:21:53 +1100 Organization: Rapt Technologies Message-ID: <87mye1wi9q.fsf@lion.rapttech.com.au> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1231454449 5238 80.91.229.12 (8 Jan 2009 22:40:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 Jan 2009 22:40:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 08 23:42:00 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LL3ZW-0004zh-8c for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Jan 2009 23:41:50 +0100 Original-Received: from localhost ([127.0.0.1]:45359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LL3YG-0006OX-6p for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Jan 2009 17:40:32 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!newshub.sdsu.edu!news.astraweb.com!border5.newsrouter.astraweb.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:dwzUqDjeeGKThlkyrliJ/NvXJJY= Original-Lines: 65 Original-NNTP-Posting-Host: d3e518f8.news.astraweb.com Original-X-Trace: DXC=EYK_oImE=DFI]J2Y9=AF]JL?0kYOcDh@J; >GTR`=ZX:BEoUSo:NPbnGHX:Jg409lNN>W?Li^IgohJ Original-Xref: news.stanford.edu gnu.emacs.help:165859 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:61191 Archived-At: "Samuel Wales" 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