Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Nov 2001 07:40:08 -0600
From:      Mike Meyer <mwm@mired.org>
To:        parv <parv_@yahoo.com>
Cc:        questions@freebsd.org
Subject:   Re: how to modify a "word" definition
Message-ID:  <15351.47672.902880.823722@guru.mired.org>
In-Reply-To: <58119620@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
parv <parv_@yahoo.com> types:
> in message <5kzo5k4t8e.o5k@localhost.localdomain>, 
> wrote Gary W. Swearingen thusly...
> > If you want really good control over mousing things (in or out of X),
> > use the XEmacs (or similar) shell mode where you can make the mouse
> > recognize any thing you want and even have it (with ctrl, shift, alt,
> > extra characters, etc.) grab words, lines, URLs, filenames, or whatever,
> > and have it run commands (eg "Netscape -remote", "xemacs --read-only")
> > on the selection. 
> i see only 2 "standard" editing modes in bash and ksh: "emacs" and 
> "vi". no "XEmacs" mode; i suppose you were referring to "emacs"
> mode... which i already have.

Since I don't see Gary's picking up on this in either of the digests,
I'll correct this here.

Gary is referring to running a shell inside of Emacs - or XEmacs. In
emacs, it's possible to associate a process with a buffer, such that
output from the process is appended to the buffer, and the newline key
causes input back to the prompt to be sent to the process. Back in the
bad old days, when I had a real terminal at work and didn't have SLIP
for dialin, I would change the buffer name to include the hostname,
and have multiple shell buffers with rlogins to various hosts I needed
to work on. This beat the alternative - rsh sessions to all those
hosts with only one active at a time - hands down.

> > (Unfortunately, the terminal emulation is not as
> > good as xterm, so I wind up having to use xterm for running interactive
> > non-GUI programs.  It has a second terminal emulator which is is good
> > enough for such programs but I don't use it for reasons I forget.)
> i am confused now as i thought you were referring to a shell and now
> you are referring to xterm (emulation)... going dizzy...

The terminal emulation for the shell in emacs is pretty poor, being
pretty much at the teletype level. There is a real terminal emulator
good enough to run vi inside of emacs. However, you lose a lot of the
features of the standard shell mode. It's also truly moded, as opposed
to having quasimodes, which makes for bad UI design. If I were stuck
on a glass tty, I'd probably learn to use it so I could use things
that needed an addressable cursor inside of emacs, but in a windowed
environment, running a real terminal emulator in another window is a
bit saner and provides the same functionality.

> > Of course, it's also much better than xterm for keybanging of shell
> > command input and output.  You have all the standard editing features
> > and more.  Searching of the input+output history (arbitrarily long)
> > is especially handy.  Another handy command is "delete output of last
> > shell command" (ctrl-c ctrl-o).  
> what exactly is "output history"? and, how is it possible to "delete 
> output of last shell command" if the output was sent to stdout/stderr? 

Since you're running inside an editor and all the output is in the
editor buffer, all the output is available - thus you can search
through the complete output history, as well as the input commands
provided by the emacs mode of bash.  Deleting the output of the last
command means you go back to the last prompt, and delete everything
from there to the current prompt. No problem. Actually, one of my
favorite features is "ctrl-c r", which makes the last prompt the first
line of the window, so *all* you see is the last command and it's
output.

> > (The special shell-mode commands
> > all start with ctrl-c, so "ctrl-c ctrl-c" is xterm's "ctrl-c".)
> i will take a wild guess as i am thoroughly confused now, but could
> you be implying here "emacs-ctlx" keymap as introduced (but not 
> explained) in the bash(1)?

Nope. As he says, shell-mode in emacs - as opposed to emacs mode in
the shell - prefixes it's commands with C-c. So to send a C-c, you
have to hit it twice. For me, it's four times, because I have the
window ratpoison's prefix key bound to C-c, so sending one to emacs
takes two C-c's, thus getting two to the shell buffer takes for.

Which brings back memories of the song - published in one of the
ACM journals, no less - Control-uparrow Q.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Q: How do you make the gods laugh?		A: Tell them your plans.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15351.47672.902880.823722>