all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Karl Voit <devnull@Karl-Voit.at>
To: help-gnu-emacs@gnu.org
Subject: Re: Migration from define-key to bind-key with prefix-command
Date: Tue, 10 Nov 2015 13:54:57 +0100	[thread overview]
Message-ID: <2015-11-10T13-53-26@devnull.Karl-Voit.at> (raw)
In-Reply-To: 87twov9h4k.fsf@gmail.com

* Alex Kost <alezost@gmail.com> wrote:
> Karl Voit (2015-11-09 15:55 +0300) wrote:
>
>> How can I define "define-key" commands with a global prefix-command to
>> bind-key(s) syntax?
>
> Do you mean you want to use 'bind-key' package from
> <https://github.com/jwiegley/use-package/>?

Yes. However, I installed it from (M)Elpa directly.

> If so, you can use something like this:
>
> (bind-keys
> :prefix-map my-map
> :prefix-docstring "My favourite map"
> :prefix "C-c ,"
>  ("-" . text-scale-decrease)
>  ("+" . text-scale-increase))
>
> You are not forced to use a single spot.  You can add keys to your map
> later:
>
> (bind-keys
> :map my-map
>  ("f" . forward-char)
>  ("b" . backward-char))
>
> or:
>
> (bind-key "RET" 'hanoi my-map)

Great!

My first attempts did overwrite each other but your examples made
everything clear to me. I was able to migrate my config to bind-key
thanks to you.

Greetings from Graz/Austria!

-- 
All in all, one of the most disturbing things today is the definitive
fact that the NSA, GCHQ, and many more government organizations are
massively terrorizing the freedom of us and the next generations.
                                                  http://Karl-Voit.at




  reply	other threads:[~2015-11-10 12:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-09 12:55 Migration from define-key to bind-key with prefix-command Karl Voit
2015-11-09 18:12 ` Alex Kost
2015-11-10 12:54   ` Karl Voit [this message]
2015-11-10 21:53     ` Emanuel Berg

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=2015-11-10T13-53-26@devnull.Karl-Voit.at \
    --to=devnull@karl-voit.at \
    --cc=help-gnu-emacs@gnu.org \
    --cc=news1142@Karl-Voit.at \
    /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.