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

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

Re: Different key maps in different dired buffers


From: tomas
Subject: Re: Different key maps in different dired buffers
Date: Thu, 26 May 2016 11:06:13 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, May 26, 2016 at 01:14:45AM -0700, Whitfield Diffie wrote:
>     The function local-set-key seems to be local to major mode, not
> local to an individual buffer.  Can anyone tell me how to set keys to
> special functions in only some dired buffers?
> 
>                 With anticipatory thanks,
> 
>                             Whit

This happens because usually, the buffer's local keymap is set up as a
a *reference* to the major mode's keymap [1]. If you want to change
that, you'd have to dissociate this reference by copying. Something
like (warning: untested code ahead)

  (use-local-map (copy-keymap (current-local-map))

might do the trick [2], [3]

regards

[1] 
https://www.gnu.org/software/emacs/manual/html_node/elisp/Active-Keymaps.html#Active-Keymaps
[2] 
https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Keymaps.html#Creating-Keymaps
[3] 
https://www.gnu.org/software/emacs/manual/html_node/elisp/Controlling-Active-Maps.html#Controlling-Active-Maps

- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAldGvIUACgkQBcgs9XrR2kbYngCeOSPdXhhpy2DPoPyT9EG8NTqy
ehoAn1Mexm3CLo8YwgRCcj5z0M+JBx7B
=4a0D
-----END PGP SIGNATURE-----



reply via email to

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