[Top][All Lists]

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

Re: Setting auto-indentation of braces

From: Kevin Rodgers
Subject: Re: Setting auto-indentation of braces
Date: Mon, 23 Feb 2009 21:56:00 -0700
User-agent: Thunderbird (Macintosh/20081209)

Juha Nieminen wrote:
Kevin Rodgers kirjoitti:
(global-set-key (kbd "M-7") "{")

  (global-set-key "M-7" "{") seems to work as well.

Well, it shouldn't: that binds a 3-character sequence (M, dash, 7) to left-brace.

This is exactly what I was looking for. I didn't know you could give directly a string to global-set-key, rather than a command (as I mentioned, my knowledge of elisp is next to nil).

You can bind anything that satisfies commandp, whose doc string says:

Interactively callable functions include strings and vectors (treated
as keyboard macros), lambda-expressions that contain a top-level call
to `interactive', autoload definitions made by `autoload' with non-nil
fourth argument, and some of the built-in functions of Lisp.

Also, a symbol satisfies `commandp' if its function definition does so.

Kevin Rodgers
Denver, Colorado, USA

reply via email to

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