Function: local-set-key
local-set-key is an interactive and byte-compiled function defined in
subr.el.gz.
Signature
(local-set-key KEY COMMAND)
Documentation
Give KEY a local binding as COMMAND.
COMMAND is the command definition to use; usually it is a symbol naming an interactively-callable function. KEY is a key sequence; noninteractively, it is a string or vector of characters or event types, and non-ASCII characters with codes above 127 (such as ISO Latin-1) can be included if you use a vector.
The binding goes in the current buffer's local map, which in most cases is shared with all other buffers in the same major mode.
Probably introduced at or before Emacs version 1.3.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defun local-set-key (key command)
"Give KEY a local binding as COMMAND.
COMMAND is the command definition to use; usually it is
a symbol naming an interactively-callable function.
KEY is a key sequence; noninteractively, it is a string or vector
of characters or event types, and non-ASCII characters with codes
above 127 (such as ISO Latin-1) can be included if you use a vector.
The binding goes in the current buffer's local map, which in most
cases is shared with all other buffers in the same major mode."
(interactive "KSet key locally: \nCSet key %s locally to command: ")
(let ((map (current-local-map)))
(or map
(use-local-map (setq map (make-sparse-keymap))))
(or (vectorp key) (stringp key)
(signal 'wrong-type-argument (list 'arrayp key)))
(define-key map key command)))