From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yPl8DKZVr2L2FQEAbAwnHQ (envelope-from ) for ; Sun, 19 Jun 2022 18:58:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 6L6EC6ZVr2IbqAAAG6o9tA (envelope-from ) for ; Sun, 19 Jun 2022 18:58:14 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AF62E16F68 for ; Sun, 19 Jun 2022 18:58:13 +0200 (CEST) Received: from localhost ([::1]:37890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2yFY-0003Kx-QB for larch@yhetil.org; Sun, 19 Jun 2022 12:58:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2yF5-0003Kh-Rf for emacs-orgmode@gnu.org; Sun, 19 Jun 2022 12:57:43 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:56047) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2yF4-0008FX-Bh for emacs-orgmode@gnu.org; Sun, 19 Jun 2022 12:57:43 -0400 Received: by mail-wm1-x32a.google.com with SMTP id a10so4644510wmj.5 for ; Sun, 19 Jun 2022 09:57:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to; bh=AD+2nWw2TCt6j9NrNQ9/krAxiboxzzZ/h8OazJ4v0RU=; b=FC+jGrNxuZLJPIhalRPkZfr8AkT+1wYv1mzafGVb9dmzH3gEyLjd+5nqzSESArblVX r3MqLpJs0OzUFB+2PHP1moAfY0zoFwWhQAz9aX29XYMUQPztmn2Nw87ddzJVEq92ROVo UYBaDXc88W50Gp6lAHr38OXqaEdWg7EhGKLU8HDwgdrUX5YKzpiaW3Q7U3LyGnQDwgfX u66PlEJ0/uECiKUS4n5Fjugxg5/kSKdDfp9E126DbIgTvwk0t/BaGqS50D3+nxTVFfEj RxQuBpPz/Fu/++UgSyI1+ZKYUUHZqnIy5QXFOrn6nDihdqPMFwioQ0vMkTX+MTDFjoBz v9JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to; bh=AD+2nWw2TCt6j9NrNQ9/krAxiboxzzZ/h8OazJ4v0RU=; b=KX3wMkWOKQ0W0k23qT97f7Fq2mQ/9J4daA1a6Yxd6dTocMxdMhffjspTMCjoHDJYJ7 AoteWVS++ForRjUTjvtKVVMtDy2g00mLgZf/baL91DzPfQYgHzHGj1fIJRZnflPWPwCT kqUS7DKf6+J2LkdFl6b6peS+eMh/lorEhVPbl84Qr11hdbsu9dBm73YTp94Hhrc9teay ykNfgyig7B2PXSW9Zku54KYMOZyV7ZdAJZW+JIh+la5fp1jShPKasHpRp+14gEB/90x3 ff9BfGHJNROb4784ZZr7O6Bn8gMiVoro3zhRP2YvG6DffFKXwr6MKrINLC797Egkt21N gAbQ== X-Gm-Message-State: AJIora9Kettvw0ExFnO5diYBeIl/E0UOe3N/Sg2meyu5VmdABKT+3YG6 VPECQ5MlGJ9xDuXA/4y3OMo= X-Google-Smtp-Source: AGRyM1tJPZbrX32hfGpC8gpuc7ogyyk2gs8rBCuElsmi9NstmjR33Q+dDoz2Hc3M7Y+7t21yyP8T7w== X-Received: by 2002:a05:600c:590:b0:39c:5cd4:8623 with SMTP id o16-20020a05600c059000b0039c5cd48623mr20483436wmd.45.1655657859174; Sun, 19 Jun 2022 09:57:39 -0700 (PDT) Received: from [192.168.0.97] (static-146-90-24-46.ipcom.comunitel.net. [46.24.90.146]) by smtp.gmail.com with ESMTPSA id t15-20020adfeb8f000000b0020e63ab5d78sm10607298wrn.26.2022.06.19.09.57.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 19 Jun 2022 09:57:38 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------ZhT48AAqOmy1qksDWuuIGVPq" Message-ID: Date: Sun, 19 Jun 2022 18:56:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: Keybinding doubt about ARG Content-Language: en-GB To: Bruno Barbier , Org-mode References: <62af533d.1c69fb81.96299.c52dSMTPIN_ADDED_MISSING@mx.google.com> From: Ypo In-Reply-To: <62af533d.1c69fb81.96299.c52dSMTPIN_ADDED_MISSING@mx.google.com> Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=ypuntot@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1655657893; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=AD+2nWw2TCt6j9NrNQ9/krAxiboxzzZ/h8OazJ4v0RU=; b=KGM7wM57z4X3AD1qijzKgU2xI31Hjyazx1xEggWXAo7uAKcX9tVmUVso7QyI3y445Z/iXO XEDSxFM4p6sRiScu3h6duJr2ldV4NnQkwXoPQkAhmrHCEEniO3dGqf7RvD856lQ1AZmSVS UrAzoYbr9MA7DWM8gKhlKgWozN9vVdiUVjHDipRGpAyYKkTlZ1LrG+RoDfZ4xuuQS+xZiX /IlrXjlrWWLKdnZ+bs5UbpA8+dlaE7r/ot+iC56RxfwGvfXVxcb4JXvrYyo5no7of/kles TLppGySGNDtvKIIdIJa0TMj+N5rmiaDX6hFosfGyhxGZrG9Bsjh+6+I86AYG3g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655657893; a=rsa-sha256; cv=none; b=l7SbCRlMwg+hnqTvsxWdyDqhBgvsdu9AaiG68uIH9BPhoNWTXDwy6MyQdRDKr9gwRxHVzA b6r7gHglmBzWfJpQKexUY3k8GIWUeOH3YPWa0tGSmEqLmLl78mgl1KpNZ0q+cfnqS0KFIE 1nyOfKg1ZbII89zp60ojPU84WzAqdluDzjO2zysUgUeEeyEpLwBDZXJCoaueR3xNkeFkVp QpSqP4Nqilgx4DVPxLSQE3UExW5MiiU+9pY5trn0qmclB0aZZnEo4unEFJh83MGpEkhuL4 89fCtwqvFp8vlGqJF/mRyHi/ngU4jMKuWPeFc6nGHZ6bmkHMDoyJRYIJwASuXA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FC+jGrNx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -8.98 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FC+jGrNx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: AF62E16F68 X-Spam-Score: -8.98 X-Migadu-Scanner: scn0.migadu.com X-TUID: 1/kBJiEPFkz2 This is a multi-part message in MIME format. --------------ZhT48AAqOmy1qksDWuuIGVPq Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Working, thanks Bruno! I needed it, because what I was using is not working well: (global-set-key (kbd "M-n") (kbd "C-u 1 C-v")) 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 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) > --------------ZhT48AAqOmy1qksDWuuIGVPq Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Working, thanks Bruno!

I needed it, because what I was using is not working well:

(global-set-key (kbd "M-n") (kbd "C-u 1 C-v"))

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)

--------------ZhT48AAqOmy1qksDWuuIGVPq--