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

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

Re: unassigning cntl-Z in cua mode


From: Emanuel Berg
Subject: Re: unassigning cntl-Z in cua mode
Date: Mon, 23 Mar 2015 19:04:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Stuart McGraw <smcg4191@frii.com> writes:

> I have recently started using CUA mode and it is ok
> except for one thing... I don't like having cntl-z
> mapped to undo. I run emacs in a terminal window
> (emacs -nw) a lot and routinely need to suspend
> emacs with cntl-z, do something in the shell, then
> resume emacs.

If you are a terminal, 'emacs -nw' and shell user are
you sure you want Cua-mode? If you take a look on the
keyboard and see where the kill and yank keys are
positioned you see they are closer, and therefore
faster and more ergonomic than the "Cua" keys, which
is also important to your thinking. So if you dont
"mind", using the kill and yank keys will in time make
you take an interest in the mechanics of the kill ring
which is a very practical tool when writing tons of
data and text and code everyday (and especially every
night). In time, you will want all that functionality
anyway so then you'll have a hybrid between the
standard kill/yank keys and the kill/yank keys that
aren't covered by the Cua keys.

As for suspending Emacs, instead of doing that, have
a tabbed terminal (urxvt had a Perl module for this,
I remember) or have several windows in X, plus
a window manager so you can switch quickly: e.g.,
Openbox and then just M-TAB (in Emacs notation) to
iterate the windows. Or, if you want to stick with one
window, use tmux with different panes that are easily
switched between (some people use screen for that).
Or, do

    M-x shell RET

and do the shell work in Emacs as well.

> How can I undo the mapping the CUA mode applies to
> the cntl-z key? I am elisp-illiterate so a cut and
> paste solution would be greatly appreciated.

I'm sure you have already received help, so I won't
tell you again, instead, why not "start stopping"
being an Elisp illiterate right now by picking apart
the (very simple) form you got, to understand what it
does. Baby steps first. It is a very good way of
acquiring LISP because you do simple and useful things
that work, and then you continue, all the while
increasing the complexity (or quantity at least).
So you learn LISP not to learn LISP but while
sharpening your tools and increasing your
understanding of them. Make it work, by outworking
the opposition!

> Emacs 24.4 on Fedora 21 if it matters.

I don't think it should matter unless the Cua-mode
changed dramatically since a previous version.
The distribution do not matter, it is rather the
terminal emulator that matters because that intercepts
the keystroke before Emacs can do anything with it.
For example, C-z doesn't do what you describe for me,
neither in the Linux VTs nor in X with xterm. I don't
remember configuring that, but there have been so many
configurations. `suspend-frame' is related for the
dreamer and digger.

-- 
underground experts united


reply via email to

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