unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* undo in shell buffer?
@ 2009-01-07  2:25 Samuel Wales
  2009-01-07  9:24 ` Peter Dyballa
  0 siblings, 1 reply; 9+ messages in thread
From: Samuel Wales @ 2009-01-07  2:25 UTC (permalink / raw)
  To: help-gnu-emacs

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?

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.

Thanks.

-- 
For personal gain, myalgic encephalomyelitis denialists are knowingly
causing further suffering and death by grossly corrupting science.  Do
you care about the world?
http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: undo in shell buffer?
  2009-01-07  2:25 Samuel Wales
@ 2009-01-07  9:24 ` Peter Dyballa
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2009-01-07  9:24 UTC (permalink / raw)
  To: Samuel Wales; +Cc: help-gnu-emacs


Am 07.01.2009 um 03:25 schrieb Samuel Wales:

> Is undo necessary in that buffer except for the last line?


No. You can also delete output and input manually. I am doing this  
quite often to get rid of unnecessary stuff, leaving just what could  
be useful in future.

--
Greetings

   Pete

We have to expect it, otherwise we would be surprised.







^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: undo in shell buffer?
       [not found] <mailman.4197.1231295141.26697.help-gnu-emacs@gnu.org>
@ 2009-01-07 18:20 ` Xah Lee
  2009-01-08 22:21 ` Tim X
  1 sibling, 0 replies; 9+ messages in thread
From: Xah Lee @ 2009-01-07 18:20 UTC (permalink / raw)
  To: help-gnu-emacs

On Jan 6, 6:25 pm, "Samuel Wales" <samolog...@gmail.com> wrote:
> 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?

it's just up to you.

> 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?

the practical diff is that in term you can call ssh, vi, top, etc
processes that requires a real terminal. In shell you can't. Also, in
term, the most traditional emacs kbd shortcuts won't work. Most people
use shell.

see also:

• Emacs and Unix Tips
  http://xahlee.org/emacs/emacs_unix.html

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: undo in shell buffer?
       [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
  2009-01-08 23:13   ` Samuel Wales
                     ` (2 more replies)
  1 sibling, 3 replies; 9+ messages in thread
From: Tim X @ 2009-01-08 22:21 UTC (permalink / raw)
  To: help-gnu-emacs

"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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: undo in shell buffer?
  2009-01-08 22:21 ` Tim X
@ 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 13:38   ` fmoreau
  2 siblings, 1 reply; 9+ messages in thread
From: Samuel Wales @ 2009-01-08 23:13 UTC (permalink / raw)
  To: Tim X; +Cc: help-gnu-emacs

On Thu, Jan 8, 2009 at 15:21, Tim X <timx@nospam.dev.null> wrote:
>> 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'

I found another drawback of shell mode.  For some reason, at least
when it is running su, c-c c-c and c-c c-z do not send the signals.

-- 
For personal gain, myalgic encephalomyelitis denialists are knowingly
causing further suffering and death by grossly corrupting science.  Do
you care about the world?
http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: undo in shell buffer?
  2009-01-08 23:13   ` Samuel Wales
@ 2009-01-08 23:49     ` Samuel Wales
  0 siblings, 0 replies; 9+ messages in thread
From: Samuel Wales @ 2009-01-08 23:49 UTC (permalink / raw)
  To: Tim X; +Cc: help-gnu-emacs

Term mode seems to work well.  I will try switching to it from shell
mode.  I like the idea of eshell too.

However, I tried mapping meta up to previous line in term and it didn't work:

(define-key term-mode-map [(meta up)] 'previous-line)

Any idea why?

-- 
For personal gain, myalgic encephalomyelitis denialists are knowingly
causing further suffering and death by grossly corrupting science.  Do
you care about the world?
http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: undo in shell buffer?
       [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
  0 siblings, 1 reply; 9+ messages in thread
From: Barry Margolin @ 2009-01-09  1:43 UTC (permalink / raw)
  To: help-gnu-emacs

In article <mailman.4363.1231456397.26697.help-gnu-emacs@gnu.org>,
 "Samuel Wales" <samologist@gmail.com> wrote:

> On Thu, Jan 8, 2009 at 15:21, Tim X <timx@nospam.dev.null> wrote:
> >> 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'
> 
> I found another drawback of shell mode.  For some reason, at least
> when it is running su, c-c c-c and c-c c-z do not send the signals.

That's because you can't send signals to a process running under a 
different userid.  To get the effect, you need to send the actual 
control character, so type C-q C-c RET or C-q C-z RET.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: undo in shell buffer?
  2009-01-09  1:43     ` Barry Margolin
@ 2009-01-09  2:48       ` Samuel Wales
  0 siblings, 0 replies; 9+ messages in thread
From: Samuel Wales @ 2009-01-09  2:48 UTC (permalink / raw)
  To: Barry Margolin; +Cc: help-gnu-emacs

Thanks!

I wonder why they don't send them.

-- 
For personal gain, myalgic encephalomyelitis denialists are knowingly
causing further suffering and death by grossly corrupting science.  Do
you care about the world?
http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: undo in shell buffer?
  2009-01-08 22:21 ` Tim X
  2009-01-08 23:13   ` Samuel Wales
       [not found]   ` <mailman.4363.1231456397.26697.help-gnu-emacs@gnu.org>
@ 2009-01-09 13:38   ` fmoreau
  2 siblings, 0 replies; 9+ messages in thread
From: fmoreau @ 2009-01-09 13:38 UTC (permalink / raw)
  To: help-gnu-emacs

On Jan 8, 11:21 pm, Tim X <t...@nospam.dev.null> wrote:
[...]

> 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).

That's not entirely true: for example in term mode where I use bash as
shell, I can't call the 'shell-expand-line' readline function anymore.
This
function is binded to M-C-e.

Francis


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-01-09 13:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
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

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).