From: Ian Zimmerman <itz@buug.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Buffer specific binding
Date: Wed, 26 Aug 2015 11:34:38 -0700 [thread overview]
Message-ID: <20150826183350.25886.0F058EC5@ahiker.mooo.com> (raw)
In-Reply-To: <874mjmo5n6.fsf@gnu.org>
On 2015-08-26 09:44 +0200, Tassilo Horn wrote:
> (let ((map (make-sparse-keymap)))
> (set-keymap-parent map (current-local-map))
> (define-key map (kbd "C-c c")
> (lambda ()
> (interactive)
> (message "Hey there!")))
> (use-local-map map))
>
> I guess you can easily wrap that into some function
> `iz/define-buffer-local-keys' and then call that conveniently from a
> file local variable section:
>
> ;; Local Variables:
> ;; eval: (iz/define-buffer-local-keys
> ;; (kbd "C-c c") #'iz/do-this
> ;; (kbd "C-c C") #'iz/do-that)
> ;; End:
Yes, this works great. Thanks!
--
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.
prev parent reply other threads:[~2015-08-26 18:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-25 21:04 Buffer specific binding Ian Zimmerman
2015-08-26 7:44 ` Tassilo Horn
2015-08-26 18:34 ` Ian Zimmerman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150826183350.25886.0F058EC5@ahiker.mooo.com \
--to=itz@buug.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.