all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: Karl Voit <devnull@Karl-Voit.at>
Cc: Karl Voit <news1142@Karl-Voit.at>, help-gnu-emacs@gnu.org
Subject: Re: Migration from define-key to bind-key with prefix-command
Date: Mon, 09 Nov 2015 21:12:27 +0300	[thread overview]
Message-ID: <87twov9h4k.fsf@gmail.com> (raw)
In-Reply-To: <2015-11-09T13-54-56@devnull.Karl-Voit.at> (Karl Voit's message of "Mon, 9 Nov 2015 13:55:17 +0100")

Karl Voit (2015-11-09 15:55 +0300) wrote:

> Hi!
>
> 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/>?

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))

> I don't want to loose the ability to change my global prefix "my-map"
> to a different one on one single place. I also want to keep my habit
> of defining key bindings on many different places scattered all over
> my init file and not on one single spot.

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)

-- 
Alex



  reply	other threads:[~2015-11-09 18:12 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 [this message]
2015-11-10 12:54   ` Karl Voit
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=87twov9h4k.fsf@gmail.com \
    --to=alezost@gmail.com \
    --cc=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.