help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to bind a key locally to a buffer (not mode!)


From: Marcin Borkowski
Subject: Re: How to bind a key locally to a buffer (not mode!)
Date: Mon, 20 Oct 2014 16:02:21 +0200

On 2014-10-20, at 14:16, Artur Malabarba wrote:

> Here it is:
>
> (use-local-map (copy-keymap (current-local-map)))
> (local-set-key "x" #'some-function)
>
> This will bind x to some-function only on the current buffer.

Cool, thanks!  Though I ended up defining a minor mode (which has its
advantages, too, like the "lighter").

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



reply via email to

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