unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: keybinding help
Date: Mon, 15 May 2006 17:39:41 -0600	[thread overview]
Message-ID: <e4b3h7$n05$1@sea.gmane.org> (raw)
In-Reply-To: <c5b438120605151434ra0bf004xd1b9a87deb0afe5@mail.gmail.com>

Ryan Krauss wrote:
 > I had read that section.  The thing that was keeping me from getting
 > what I wanted was the combination of keybindings with lambda functions
 > (which I didn't know existed in Lisp - or how to write them).
 >
 > In the versions that I looked at, there was no simple example of
 > writing a key binding to insert text.

What you are calling a lambda function is actually an anonymous
function.  But strictly speaking, a Lisp function (anonymous or not) is
not necessary for this.

Assuming that all you need to do to insert "\lstinline!" is to type
those 10 characters literally, this is how you would define a keyboard
macro to do that:

C-x ( \lstinline! C-x )

Now `C-x e' will insert "\lstinline!".  You might next want to name that
macro and bind it to `C-c l':

M-x name-last-kbd-macro RET insert-lstinline RET
M-x global-set-key RET C-c l insert-lstinline RET

See the "Naming and Saving Keyboard Macros" section of the manual for
more details.  Or you could short circuit all of those commands and just
put this in your .emacs file:

(global-set-key "\C-cl" "\\lstinline!")

-- 
Kevin

  reply	other threads:[~2006-05-15 23:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1844.1147718776.9609.help-gnu-emacs@gnu.org>
2006-05-15 19:12 ` keybinding help Maarten Bergvelt
2006-05-15 21:34   ` Ryan Krauss
2006-05-15 23:39     ` Kevin Rodgers [this message]
2006-05-15 19:12 ` Tassilo Horn
2006-05-19 13:54 ` Mathias Dahl
2006-05-15 18:46 Ryan Krauss
2006-05-15 18:51 ` Michaël Cadilhac
2006-05-15 18:59   ` Ryan Krauss

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='e4b3h7$n05$1@sea.gmane.org' \
    --to=ihs_4664@yahoo.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.
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).