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

port command-remapping #1477

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

brotzeit
Copy link
Member

@brotzeit brotzeit commented May 4, 2019

No description provided.

Copy link
Collaborator

@agraven agraven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, only some minor changes are necessary.

/// remapping in all currently active keymaps.
#[lisp_fn(min = "1")]
pub fn command_remapping(
command: Option<LispSymbolRef>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's quite strange that the original function behaves this way, but the original function accepts any type and returns Qnil if it's not a symbol. I recommend changing command to a LispObject and then doing let c = match command.as_symbol() ...

key_binding(command_remapping_vector, false, true, position)
} else {
lookup_key(
LispObject::cons(Qkeymap, keymaps),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LispObject::cons(Qkeymap, keymaps),
(Qkeymap, keymaps).into(),


(define-key my-mode-map [remap kill-line] 'my-kill-line)


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whitespace looks very strange in the changes in this file, and the body of test-command-remapping is empty. Is this part unfinished?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I pushed the wrong branch.

@shaleh
Copy link
Collaborator

shaleh commented Jan 10, 2020

@brotzeit wanna update this one?

@brotzeit brotzeit changed the title port command-remapping [WIP] port command-remapping Jan 10, 2020
@brotzeit brotzeit changed the title [WIP] port command-remapping port command-remapping Jan 10, 2020
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.

None yet

3 participants