unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Robert J. Chassell" <bob@rattlesnake.com>
Subject: Re: Default Emacs keybindings
Date: Tue, 4 May 2004 12:20:17 +0000 (UTC)	[thread overview]
Message-ID: <m1BKyuH-000UN4C@rattlesnake.com> (raw)
In-Reply-To: <E1BKloQ-0000PK-PL@fencepost.gnu.org> (message from Richard Stallman on Mon, 03 May 2004 18:21:22 -0400)

   What we should do is include prominent documentation telling users how
   to remap their caps-lock key, with specific recipes.  (I have no idea
   where to find this information for GNU/Linux.)

I agree.  Here are my notes on installing sensible bindings in plain
text consoles, virtual consoles, using a shell and in X Windows.
These bindings apply to all applications, not just Emacs.

This is just a beginning.  Someone who knows more than I needs to
write the documentation to be more general and to work well.

First, plain text consoles:

The following is easiest for plain text consoles, but may not always
work:

    install-keymap emacs2

This command packages package all the keymaps needed for the complete
emacs2 keymap (i.e. linux-keys-bare.inc.gz,
linux-with-alt-and-altgr.inc.gz, qwerty-layout.inc.gz, and of course,
emacs2.kmap.gz) and puts them all together as:

    /etc/console/boottime.kmap.gz

and loads that file.

If `install-keymap' fails, the following succeeds, also for plain text
consoles:

    loadkeys /usr/share/keymaps/i386/qwerty/emacs2.kmap.gz


On my system, sensible key bindings are loaded at boottime
by   /etc/rcS.d/S05keymap.sh

That file is a link to  /etc/init.d/keymap.sh 
which contains a command to 

    loadkeys /etc/console/boottime.kmap.gz

(Actually, the command is `loadkeys ${CONFFILE}' where
`CONFFILE=${CONFDIR}/${CONFFILEROOT}.${EXT}.gz' and that ends up being
`/etc/console/boottime.kmap.gz'.)


Second, X Windows:

The `loadkeys' and `install-keymap' commands do not work with X
Windows.

Instead, it is necessary to use `xmodmap'.  (Other commands may also
work, but I do not know them.)

You can put the following commands in the global Xmodmap file which is
used by both xdm and xinit (startx) to change the X keymaps for all
users:

    /etc/X11/Xmodmap

Or you can put the commands in various users' ~/.xinitrc files.  When
the commands go into a user's ~/.xinitrc file, the commands are
executed when the user starts X and apply only to that user.

Please note that these keycodes are specific to my keyboard.  I
suspect that the commands suggested in the man page for `xmodmap' are
better than these, but have not tried them.

Alternatively, whoever writes the documentation should describe a
simple way to discover the keybinds.  I use `xev' and `xkeycaps', but
can never remember what is what.  Please describe a fool proof
technique, so people like me do not need to think or know anything.

    xmodmap -e "clear Lock"
    xmodmap -e "add Control = Caps_Lock"

    xmodmap -e "keycode 22 = BackSpace"
    xmodmap -e "keycode 107 = Delete"

The previous commands are different from the commands suggested in the
man page for xmodmap.  I suspect the man page commands are better, but
do not know enough myself to choose:

#             !
#             ! Swap Caps_Lock and Control_L
#             !
#             remove Lock = Caps_Lock
#             remove Control = Control_L
#             keysym Control_L = Caps_Lock
#             keysym Caps_Lock = Control_L
#             add Lock = Caps_Lock
#             add Control = Control_L

In addition, here are commands to set the right ALT and CTL keys to be
Super and Hyper respectively.  These are useful keys, both in Emacs
and in other X applications.  I think we should tell people how to do
this.

Please note the keycode.  Again, whoever writes the final
documentation should offer a better way.


    # Set right ALT key to be Super_R with mod3
    xmodmap  -e "keycode 0x71 = Super_R"
    xmodmap  -e "keysym Super_R = Super_R" \
             -e "add Mod3 = Super_R"     \
             -e "remove Mod1 = Super_R"
    xmodmap  -e "remove Mod2 = Super_R"


    # Set right CTL key to be a Hyper key with mod4
    xmodmap  -e "keycode 0x6d = Hyper_R"
    xmodmap  -e "keysym Hyper_R = Hyper_R" \
             -e "remove Control = Hyper_R"
    xmodmap  -e "remove Mod2 = Hyper_R" \
             -e "add Mod4 = Hyper_R"


Here are my comments on how to set the right ALT key to be a true ALT,
rather than a Meta key.

    # # Set right ALT key to be an ALT with mod3
    # xmodmap  -e "keycode 0x71 = Alt_R"
    # xmodmap  -e "keysym Alt_R = Alt_R" \
    #          -e "add Mod3 = Alt_R"     \
    #          -e "remove Mod1 = Alt_R"
    # xmodmap  -e "remove Mod2 = Alt_R"

In addition, I found that Shift-Tab works when I do the following:

    xmodmap -e 'keysym Tab = Tab'

Emacs should contain default key bindings and menu bindings to run a
shell command that changes the key bindings both for all the virtual
consoles and, if the user is in X Windows, for that session of X.

The command should appear on the Emacs splash page.  

Also, the documentation should explain what to put in both general and
user specific shell scripts that can be run from a shell.  Moreover,
it should tell how how to invoke one or other shell script
automatically at boot.

-- 
    Robert J. Chassell                         Rattlesnake Enterprises
    As I slowly update it,                     bob@rattlesnake.com
        I rewrite a "What's New" segment for   http://www.rattlesnake.com

  parent reply	other threads:[~2004-05-04 12:20 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-23 21:24 Menu suggestion David Kastrup
2004-04-24 13:29 ` Robert J. Chassell
2004-04-24 23:02 ` Kim F. Storm
2004-04-25 23:35   ` Richard Stallman
2004-04-26  8:23     ` Default Emacs keybindings (was: Re: Menu suggestion) Per Abrahamsen
2004-04-26 13:35       ` Luc Teirlinck
2004-04-26 14:22         ` Default Emacs keybindings Per Abrahamsen
2004-04-26 13:44       ` Default Emacs keybindings (was: Re: Menu suggestion) Alan Mackenzie
2004-04-26 15:16         ` David Kastrup
2004-04-26 22:33           ` Kim F. Storm
2004-04-26 21:36             ` David Kastrup
2004-04-26 23:06               ` Luc Teirlinck
2004-04-27 14:04               ` Stefan Monnier
2004-04-27 14:22                 ` David Kastrup
2004-04-29 19:42                   ` Stefan Monnier
2004-05-24 14:08               ` Richard Stallman
2004-05-26 16:18                 ` Stefan Monnier
2004-05-26 17:01                   ` David Kastrup
2004-05-27 23:53                   ` Richard Stallman
2004-05-28 21:06                   ` Stefan Monnier
2004-04-27 23:59             ` Default Emacs keybindings Stefan Daschek
2004-04-30 13:06         ` Per Abrahamsen
2004-04-30 21:41           ` Miles Bader
2004-05-01 17:50           ` Richard Stallman
2004-05-01 18:20             ` Andreas Schwab
2004-05-02 19:52               ` Richard Stallman
2004-05-02 21:15                 ` Miles Bader
2004-05-03  6:11                   ` Lars Brinkhoff
2004-05-03  5:53                     ` Kim F. Storm
2004-05-03  8:34                       ` Miles Bader
2004-05-03  7:32                         ` Kim F. Storm
2004-05-03  9:55                           ` Miles Bader
2004-05-03  9:36                         ` Kai Grossjohann
2004-05-07 12:34                         ` Jose E. Marchesi
2004-05-03  9:08                       ` Jan Nieuwenhuizen
2004-05-03  7:25                         ` Kim F. Storm
2004-05-03  9:51                           ` Jan Nieuwenhuizen
2004-05-03 10:33                         ` Per Abrahamsen
2004-05-03 11:28                         ` Kenichi Handa
2004-05-03 11:54                           ` Jan Nieuwenhuizen
2004-05-03 23:15                             ` Masatake YAMATO
2004-05-04  0:11                             ` Kenichi Handa
2004-05-03 22:21                         ` Richard Stallman
2004-05-03 22:59                           ` Luc Teirlinck
2004-05-04  6:01                             ` Eli Zaretskii
2004-05-04  7:02                               ` David Kastrup
2004-05-04  7:42                               ` Alan Mackenzie
2004-05-04 13:54                                 ` Stefan Monnier
2004-05-04 15:37                                   ` Alan Mackenzie
2004-05-04 21:45                                     ` Luc Teirlinck
2004-05-04 21:35                               ` Luc Teirlinck
2004-05-05  5:53                                 ` Eli Zaretskii
2004-05-05 14:29                                   ` Luc Teirlinck
2004-05-05 22:20                                     ` Thien-Thi Nguyen
2004-05-05 14:34                                   ` Luc Teirlinck
2004-05-04 20:07                             ` Richard Stallman
2004-05-04 12:20                           ` Robert J. Chassell [this message]
2004-05-05 20:20                             ` Richard Stallman
2004-05-06 12:41                               ` Robert J. Chassell
2004-05-06 14:22                                 ` Andreas Schwab
2004-05-06 14:54                                   ` Robert J. Chassell
2004-05-06 15:28                                     ` Andreas Schwab
2004-05-08  1:20                                 ` Richard Stallman
2004-05-08 23:20                                   ` Robert J. Chassell
2004-05-04 12:25                           ` Robert J. Chassell
2004-05-03 22:21                       ` Richard Stallman
2004-05-03  7:48                     ` Jan Nieuwenhuizen
2004-04-26  9:56     ` Menu suggestion Kim F. Storm
2004-04-26  8:39       ` Miles Bader
2004-04-26 11:37         ` Kim F. Storm
2004-04-27  8:24           ` Richard Stallman
2004-04-27 11:05             ` Kim F. Storm
2004-04-27 10:38               ` Jan Nieuwenhuizen
2004-04-27 14:04                 ` Kim F. Storm
2004-04-30 13:13                 ` Per Abrahamsen
2004-04-30 14:03                   ` Stefan Monnier
2004-04-30 17:30                     ` Kim F. Storm
2004-04-30 19:35                       ` Stefan Monnier
2004-04-30 19:55                         ` Kim F. Storm
2004-05-03  7:18                       ` Juanma Barranquero
2004-05-03 10:25                         ` Kim F. Storm
2004-05-04  7:32                           ` David Kastrup
2004-04-27 14:21             ` Stefan Monnier
2004-04-28 10:12               ` Richard Stallman
2004-04-28  5:09             ` Juri Linkov
2004-04-28  6:40               ` Eli Zaretskii
2004-04-28  5:55                 ` Juri Linkov
2004-04-28 11:25                   ` Eli Zaretskii
2004-04-28 12:57                   ` Robert J. Chassell
2004-04-28  6:46               ` Miles Bader
2004-04-28 12:51               ` Robert J. Chassell
2004-04-29 10:44               ` Richard Stallman
2004-04-29 11:27                 ` Juri Linkov
2004-04-26 10:35       ` Eli Zaretskii
2004-04-26 16:36         ` jargon translation up-front in doc (was: Menu suggestion) Drew Adams
2004-04-27  6:43           ` Eli Zaretskii
2004-04-29  1:48             ` Drew Adams
2004-04-29 15:44               ` Kevin Rodgers
2004-04-29 17:37                 ` Drew Adams
2004-04-29 23:36                   ` Kim F. Storm
2004-04-29 23:48                     ` Drew Adams
2004-04-30  9:02               ` Richard Stallman
2004-04-25 18:08 ` Menu suggestion Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2004-04-26 11:33 Default Emacs keybindings (was: Re: Menu suggestion) Lars Hansen
2004-04-27  8:24 ` Richard Stallman
2004-04-27  9:54   ` David Kastrup
2004-04-27 10:23     ` Default Emacs keybindings Lars Hansen
     [not found] <20040503092848.7F3BFBEDE9@imf.math.ku.dk>
2004-05-03 10:32 ` Lars Hansen
2004-05-03 11:01   ` Miles Bader
2004-05-03 12:37   ` Kai Grossjohann
     [not found] <20040503133902.EF5FEBEBF0@imf.math.ku.dk>
2004-05-03 14:18 ` Lars Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1BKyuH-000UN4C@rattlesnake.com \
    --to=bob@rattlesnake.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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