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

C-u (universal-argument) doesn't multiply #24

Open
grothesque opened this issue Sep 19, 2018 · 4 comments
Open

C-u (universal-argument) doesn't multiply #24

grothesque opened this issue Sep 19, 2018 · 4 comments

Comments

@grothesque
Copy link

Thanks a lot for modalka, I find it so far very useful and much more practicable than other emacs modal extensions.

I have added

(modalka-define-kbd "u" "C-u")

so that pressing "un" moves the point down 4 lines. I notice that "uun" does not move the point down 16 lines like one would expect from "C-u C-u C-n".

@mrkkrp
Copy link
Owner

mrkkrp commented Sep 22, 2018

Thanks for reporting this! Indeed, I myself use this translation but "uun" results in moving point down 4 lines, the same as "un". This deserves an investigation, but unfortunately I have no time to perform it.

Could you try to investigate this perhaps?

@grothesque
Copy link
Author

grothesque commented Sep 25, 2018 via email

@contrapunctus-1
Copy link

This seemed to work for me -

(define-key universal-argument-map (kbd "u") 'universal-argument-more)

Adapted from
https://stackoverflow.com/questions/4808756/how-do-you-move-the-prefix-argument-to-a-different-key-in-emacs

(You don't want to undefine C-u in universal-argument-map though, if you see yourself using the modifier-based binding.)

Seems like a hack at best, though, because if you define translations via Modalka, you expect them to work in all situations.

@Kungsgeten
Copy link

I tried to define a new command in ryo-modal-mode (which started as a fork of modalka), and it seems to work for me:

(defun universal-argument-or-more ()
  "Call `universal-argument' or `universal-argument-more',
if there's already a `current-prefix-arg'."
  (interactive)
  (call-interactively
   (if current-prefix-arg
       #'universal-argument-more
     #'universal-argument)))

(modalka-define-kbd "u" #'universal-argument-or-more)

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

No branches or pull requests

4 participants