Skip to main content
replaced http://emacs.stackexchange.com/ with https://emacs.stackexchange.com/
Source Link

Keys can only be bound to commands.

A command is (usually) a function which contains an interactive form. This form must be included even if your function takes no arguments.

Hence:

(global-set-key (kbd "C-x 8 l") (lambda () (interactive) (insert "λ")))

In addition, keyboard macros are also commands, and can therefore similarly be bound to keys.

"λ" is a valid keyboard macro for inserting a lambda character, and so (as per Dan's comment above) the following also works:

(global-set-key (kbd "C-x 8 l") "λ")

See also:

Keys can only be bound to commands.

A command is (usually) a function which contains an interactive form. This form must be included even if your function takes no arguments.

Hence:

(global-set-key (kbd "C-x 8 l") (lambda () (interactive) (insert "λ")))

In addition, keyboard macros are also commands, and can therefore similarly be bound to keys.

"λ" is a valid keyboard macro for inserting a lambda character, and so (as per Dan's comment above) the following also works:

(global-set-key (kbd "C-x 8 l") "λ")

See also:

Keys can only be bound to commands.

A command is (usually) a function which contains an interactive form. This form must be included even if your function takes no arguments.

Hence:

(global-set-key (kbd "C-x 8 l") (lambda () (interactive) (insert "λ")))

In addition, keyboard macros are also commands, and can therefore similarly be bound to keys.

"λ" is a valid keyboard macro for inserting a lambda character, and so (as per Dan's comment above) the following also works:

(global-set-key (kbd "C-x 8 l") "λ")

See also:

Added the keyboard macro info
Source Link
phils
  • 53.1k
  • 3
  • 84
  • 127

Keys can only be bound to commands.

A command is (usually) a function which contains an interactive form. This is necessaryform must be included even if your commandfunction takes no arguments.

Hence:

(global-set-key (kbd "C-x 8 l") (lambda () (interactive) (insert "λ")))

In addition, keyboard macros are also commands, and can therefore similarly be bound to keys.

"λ" is a valid keyboard macro for inserting a lambda character, and so (as per Dan's comment above) the following also works:

(global-set-key (kbd "C-x 8 l") "λ")

See also:

Keys can only be bound to commands.

A command is a function which contains an interactive form. This is necessary even if your command takes no arguments.

Hence:

(global-set-key (kbd "C-x 8 l") (lambda () (interactive) (insert "λ")))

See also:

Keys can only be bound to commands.

A command is (usually) a function which contains an interactive form. This form must be included even if your function takes no arguments.

Hence:

(global-set-key (kbd "C-x 8 l") (lambda () (interactive) (insert "λ")))

In addition, keyboard macros are also commands, and can therefore similarly be bound to keys.

"λ" is a valid keyboard macro for inserting a lambda character, and so (as per Dan's comment above) the following also works:

(global-set-key (kbd "C-x 8 l") "λ")

See also:

added 50 characters in body
Source Link
phils
  • 53.1k
  • 3
  • 84
  • 127

Keys can only be bound to commands.

A command is a function which contains an interactive form. This is necessary even if your command takes no arguments.

Hence:

(global-set-key (kbd "C-x 8 l") (lambda () (interactive) (insert "λ")))

See also: C-hig (elisp) Defining Commands RET

Keys can only be bound to commands.

A command is a function which contains an interactive form. This is necessary even if your command takes no arguments.

Hence:

(global-set-key (kbd "C-x 8 l") (lambda () (interactive) (insert "λ")))

See also: C-hig (elisp) Defining Commands RET

Keys can only be bound to commands.

A command is a function which contains an interactive form. This is necessary even if your command takes no arguments.

Hence:

(global-set-key (kbd "C-x 8 l") (lambda () (interactive) (insert "λ")))

See also:

Source Link
phils
  • 53.1k
  • 3
  • 84
  • 127
Loading