Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make keymap an optional argument of modalka-define-key #26

Closed
wants to merge 1 commit into from

Conversation

KaiHa
Copy link

@KaiHa KaiHa commented Feb 3, 2019

With an optional keymap argument it is possible to also create prefix
commands in "normal" mode. Eg. like a mapping from x s to C-x C-s:

(let* ((keymap (define-prefix-command 'modalka-Control-X-prefix)))
  (define-key modalka-mode-map (kbd "x") keymap)
  (modalka-define-key (kbd "s") (kbd "C-x C-s") keymap))

Note, that I am by no means an Emacs wizard, so it is quite possible
that this can be achieved much simpler or cleaner or is a total stupid
idea altogether.

Related to #25.

With an optional keymap argument it is possible to also create prefix
commands in "normal" mode. Eg. like a mapping from `x s` to `C-x C-s`:

  (let* ((keymap (define-prefix-command 'modalka-Control-X-prefix)))
    (define-key modalka-mode-map (kbd "x") keymap)
    (modalka-define-key (kbd "s") (kbd "C-x C-s") keymap))

Note, that I am by no means an Emacs wizard, so it is quite possible
that this can be achieved much simpler or cleaner or is a total stupid
idea altogether.

Related to mrkkrp#25.
@mrkkrp
Copy link
Owner

mrkkrp commented Feb 3, 2019

But that's already supported:

(modalka-define-kbd "x s" "C-x C-s")

@KaiHa
Copy link
Author

KaiHa commented Feb 4, 2019

But that's already supported:

(modalka-define-kbd "x s" "C-x C-s")

Ohh, then disregard my request. I simply didn't know that this was already possible. Nice work

@KaiHa KaiHa closed this Feb 4, 2019
@mrkkrp
Copy link
Owner

mrkkrp commented Feb 4, 2019

No problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants