Re: More (US) xterm/emacs/keyboard madness
Re: More (US) xterm/emacs/keyboard madness
- Subject: Re: More (US) xterm/emacs/keyboard madness
- From: "Joseph R. Kiniry" <email@hidden>
- Date: Tue, 21 Jan 2003 00:29:02 +0100
Hi Steve,
I think that there is a better alternative solution to this puzzle, but it
will have to wait for action on Apple's part.
First, I believe that the key at the upper right of your keyboard, labeled
"delete" on my Apple keyboard, but "backspace" on many UNIX keyboard,
should be mapped to the "BackSpace" keysym. The little key just to the
right of that, below the "help" key, labeled "del" with a little right
arrow with an 'X' in it, should be mapped to the "Delete" keysym. The
first should delete one character to the left of the current cursor; the
latter one character to the right. Alternatively, to delete one character
to the right in Emacs, a Ctrl-d is typically used.
According to the X event program ("xev"), the backspace key is keycode 59
on my keyboard. The delete key ("del") is keycode 125. Unfortunately, as
you have already noted, in an xterm, the del key performs a backspace
rather than a delete. Using your xmodmap binding, the del key acts as a
backspace, rather than the strange default behavior of inserting a tilde
character ('~') and causing an alert noise to sound. Unfortunately, this
problem is not specific to xterm. I have tried running a number of other
apps (e.g., xedit, xmh, etc.) and they all show the same behavior. I
believe this is just one of those things that Apple will have to work out
in later X releases. One of us should be sure to file a detailed bug
report on the issue. Perhaps one of our friendly Apple ears will do so
using this series of emails.
As far as Emacs goes, I simply prefer to use either the Fink build or my
own CVS build, both of which perfectly well via X11 or via a native Mac
interface. Both misbehave in an xterm, as you mention, but if you are
going to use Emacs, why cripple it by running in a terminal? <g>
Finally, there is one other option: you can hint to Emacs what its
backspace/delete keybindings should be via the option "normal erase is
backspace". Appended below is its documentation.
Best,
Joe Kiniry
---
Joseph R. Kiniry http://www.kindsoftware.com/
KindSoftware, LLC ID 78860581 ICQ 4344804
P.S. I have always used "Ctrl-x u", so I guess I'm the lucky one. The
standard shortcut that you use works fine when you run either of the
Emacsen I mentioned via a non-tty interface.
---
Normal Erase Is Backspace: Hide Toggle on (non-nil)
State: you have set this option, but not saved it for future sessions.
If non-nil, Delete key deletes forward and Backspace key deletes backward.
Hide
On window systems, the default value of this option is chosen
according to the keyboard used. If the keyboard has both a Backspace
key and a Delete key, and both are mapped to their usual meanings, the
option's default value is set to t, so that Backspace can be used to
delete backward, and Delete can be used to delete forward.
If not running under a window system, customizing this option accomplishes
a similar effect by mapping C-h, which is usually generated by the
Backspace key, to DEL, and by mapping DEL to C-d via
`keyboard-translate'. The former functionality of C-h is available on
the F1 key. You should probably not use this setting if you don't
have both Backspace, Delete and F1 keys.
Setting this variable with setq doesn't take effect. Programmatically,
call `normal-erase-is-backspace-mode' (which see) instead.
Parent groups: Editing Basics
--On maandag, 20 januari 2003 12:59 -0500 Steve Linberg
<email@hidden> wrote:
I'm still trying to work out all the messy details to making my US
keyboard behave under X11/xterm the same way it does under Terminal.app,
particularly as it applies to running emacs from a terminal, which is
where I live most of my life. After more hours than I care to describe,
I've got some voodoo that MOSTLY works, and I'm trying to dot the i's now.
The main issue was the DELETE key not working in emacs, but being mapped
to c-h. I'll spare the gory process and jump right to the magic words,
for anyone still struggling with it, and then there's one problem left
for me.
In .xinitrc, add this line:
xmodmap -e "keysym BackSpace = Delete"
That allows the xterm environment to distinguish between the "delete" key
and control-h. Then you have to map it to the DEL function within xterm,
otherwise you get "~" in xterm and forward-delete (triggering
<deletechar> instead of <DEL> in emacs). Add this to your .Xdefaults:
XTerm*VT100*deleteIsDEL: true
And it will all work like magic on the next X start. Does for me anyway.
The question I have left is: I use "control-(hyphen)" for undo in emacs.
Unfortunately, under xterm/X11, control-(hyphen) doesn't register as a
key chord, it just comes out as a plain hyphen. I've got many, many,
many years of using control-hyphen this way, and changing keys is going
to be hard for that.
Is there any way to get the xterm environment to recognize control-hyphen
as a key chord? How does this work?
Thanks for any tips.
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe: http://www.lists.apple.com/mailman/listinfo/x11-users
Do not post admin requests to the list. They will be ignored.