[Top][All Lists]

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

Re: Newbie questions

From: David Vanderschel
Subject: Re: Newbie questions
Date: Sun, 24 Dec 2006 11:19:03 -0600

<address@hidden> wrote in message
> 1) Is there a way to see what a keyboard shortcut is currently bound
> to? Before I write my own programs making my own, I want to make sure
> I'm not unbinding something really important.

Some useful help functions:

What does this key-sequence do?

    C-h k runs the command describe-key
       which is an interactive compiled Lisp function in `help'.
    (describe-key KEY)

    Display documentation of the function invoked by KEY.  KEY is a string.

What key-sequence invokes this function?

    C-h w runs the command where-is
       which is an interactive compiled Lisp function in `help'.
    (where-is DEFINITION &optional INSERT)

    Print message listing key sequences that invoke the command DEFINITION.
    Argument is a command definition, usually a symbol with a function
    If INSERT (the prefix arg) is non-nil, insert the
    message in the buffer.

What special keys are bound in the current mode?

    C-h m runs the command describe-mode
       which is an interactive compiled Lisp function in `help'.

    Display documentation of current major mode and minor modes.
    The major mode description comes first, followed by the minor modes,
    each on a separate page.

    For this to work correctly for a minor mode, the mode's indicator
    (listed in `minor-mode-alist') must also be a function whose
    describes the minor mode.

> 2) Is there a way to see a list of all functions that can possible be
> bound to keymappings, the list of files they appear in, and their
> descriptions?

The list is bigger than you would want to see all at
once.  There is really no limit, as you can create
your own functions as well.  In almost all cases, the
detailed documentation for an emacs package is in the
source code.  Just browse the emacs/lisp/ library to
get an idea of the magnitude of the problem.  But most
of the things you would be interested in are also
documented the Emacs info file:  C-h i.  I learned
Emacs by reading the info file.

> 3) Are there any key combos with meta and ctrl that are not allowed
> when creating my own key bindings? Any reason why I wouldn't use C-q,
> C-w, C-e, etc. just go through the keyboard and use what's not used yet?

Virtually all of the alphabetic keys with either the
control or meta modifier are already assigned for
something.  You can usurp the default bindings; but I
would not recommend it, as you may someday find need
for a function whose default key-sequence you assigned
to something else.  As long as you are just starting
with Emacs and have no history that makes key-binding
changes desirable for you, I would recommend staying
with the defaults.

I define lots of my own functions which I need to bind
somehow.  Unless mine is a replacement for an
already-bound function, I usually use a prefix key to
distinguish my own bindings.  (I have many prefixed
with each of C-z, F12, and F6.  (My C-z prefix
preempts the regular C-z binding which I have on C-z

You can also use the Windows Key as a modifier, which
will also keep you from running afoul of standard
Emacs bindings.  (Just avoid Windows Key combinations
defined by the OS.  In Emacs, I usually use the
Windows Key only in combination with ctrl or meta to
avoid things outside Emacs that might otherwise grab
the key; and I do it only for functions that would
make sense only on a PC.)

The keypad keys with ctrl and meta modifiers _are_

  David V.

reply via email to

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