emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bruno Barbier <brubar.cs@gmail.com>
To: Ypo <ypuntot@gmail.com>, Org-mode <emacs-orgmode@gnu.org>
Subject: Re: Keybinding doubt about ARG
Date: Sun, 19 Jun 2022 19:24:15 +0200	[thread overview]
Message-ID: <E1o2ydZ-0007CL-Ot@lists.gnu.org> (raw)
In-Reply-To: <da30eada-e23a-008e-943f-d341991ddf4e@gmail.com>

Ypo <ypuntot@gmail.com> writes:

> Working, thanks Bruno!
>
Thanks for the feedback.

> I needed it, because what I was using is not working well:
>
> (global-set-key (kbd "M-n") (kbd "C-u 1 C-v"))

FWIW, your previous method works for me in org mode buffers (emacs 28 -Q and my custom emacs
29 with custom org). And:

    (define-key global-map (kbd "M-n") (kbd "C-u 1 C-v"))
    
works too.

Best regards,




>  From some time ago, it doesn't work in .org buffers, although it works 
> in elisp buffers.
>
> In .org buffers I receive this message:
>
> After 0 kbd macro iterations: command-execute: Keyboard macro terminated 
> by a command ringing the bell
>
> Best regards
>
> El 19/06/2022 a las 18:49, Bruno Barbier escribió:
>> 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)
>>


      reply	other threads:[~2022-06-19 17:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-19 15:50 Keybinding doubt about ARG Ypo
2022-06-19 16:49 ` Bruno Barbier
2022-06-19 17:21   ` Juan Manuel Macías
     [not found] ` <62af533d.1c69fb81.96299.c52dSMTPIN_ADDED_MISSING@mx.google.com>
2022-06-19 16:56   ` Ypo
2022-06-19 17:24     ` Bruno Barbier [this message]

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1o2ydZ-0007CL-Ot@lists.gnu.org \
    --to=brubar.cs@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ypuntot@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).