[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Keybinding doubt about ARG
From: |
Bruno Barbier |
Subject: |
Re: Keybinding doubt about ARG |
Date: |
Sun, 19 Jun 2022 18:49:14 +0200 |
Ypo <ypuntot@gmail.com> writes:
> Is it possible to use ARG when defining keybindings?
>
> For the command (scroll-up-command &optional ARG) I want to define this
> keybind:
>
>
> (define-key global-map (kbd "M-n") 'scroll-up-command 1)
>
>
> But:
>
> eval-region: Wrong number of arguments: define-key, 4
I don't think that 'define-key' allows to specify extra arguments.
But, you can easily define your own command.
(defun my-scroll-up-of-1 ()
(interactive)
(scroll-up-command 1))
(define-key global-map (kbd "M-n") 'my-scroll-up-of-1)