From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 uFbkDMpbr2ItgQAAbAwnHQ (envelope-from ) for ; Sun, 19 Jun 2022 19:24:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KPfiDMpbr2L+bgAA9RJhRA (envelope-from ) for ; Sun, 19 Jun 2022 19:24:26 +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 B0D6C17E1A for ; Sun, 19 Jun 2022 19:24:25 +0200 (CEST) Received: from localhost ([::1]:54540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2yeu-0007FI-Qf for larch@yhetil.org; Sun, 19 Jun 2022 13:24:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2ydZ-0007CL-Ot for emacs-orgmode@gnu.org; Sun, 19 Jun 2022 13:23:01 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:12198) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2ydX-0003X5-W3 for emacs-orgmode@gnu.org; Sun, 19 Jun 2022 13:23:01 -0400 Received: from tosh-laptop (unknown [IPv6:2a01:e0a:505:3460:1a16:a0c4:3f89:c0d9]) by smtp1-g21.free.fr (Postfix) with ESMTPS id BDCB9B0053D; Sun, 19 Jun 2022 19:22:55 +0200 (CEST) Received: by tosh-laptop (sSMTP sendmail emulation); Sun, 19 Jun 2022 19:24:15 +0200 From: Bruno Barbier To: Ypo , Org-mode Subject: Re: Keybinding doubt about ARG In-Reply-To: References: <62af533d.1c69fb81.96299.c52dSMTPIN_ADDED_MISSING@mx.google.com> Date: Sun, 19 Jun 2022 19:24:15 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: softfail client-ip=212.27.42.1; envelope-from=brubar.cs@gmail.com; helo=smtp1-g21.free.fr X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, MISSING_MID=0.497, NML_ADSP_CUSTOM_MED=0.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action Message-Id: 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=1655659465; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=s4dCai5onarvxoHaMXshBHBuKL6itglt4/7QIGCmw9E=; b=m6FyqleVP94e3lVsN5JE8GD1cMuYF74KUZsHgZYihMrcKOzyoHkSD2M7DnbvFfe/m9d5jC 2kFd+yiF196LOBcpVjwY1Yyr2gMNQhaxseh+Zv13qz8G4g2v6oB6iN9MEWnbKC1M7YSTtC nXA3R1f2V8MluCdGkyBoDjx4QXJPvL8aV60GN4KOeBQesTwg20cH/twHE6yPOcU1lRVRw9 w8KdXnhkdGRmuh+im6btJAPRbnM1F8GS1175PrfvjDe/DCqUvm3HIaSXJ01ekhqLhz4RM9 qC1UgIfqBPgkeNgaGL9sYgl7eSznYZ1Gqkc0SDwVq4THfMSBvsjPa4PVkY8oGQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655659465; a=rsa-sha256; cv=none; b=LlzhmZDiA3k+UqV2u+v+/JxFABrnJ38myayU/ywCG5UihnbTNaL+22ZfVdCVLX3/V0yBuz MyynZnvr2MMoJ79CZ9V9V4rRybGoNhHfnsCs/Qq/ilrK/0vw8GV92U2RWE2zBKRc1ZJa86 x08KodUNpEr4qzCU4ktoV8nqVUm2nH633R/6L8pAgb8eNFjG7WkHNWH3LnUrxIcVtYlAbB f6oHy+b4mY0L7apbZJbBucDa6H1tp71LM2NYz2xVgdZqF6sNKkPuTIsqZ+GiSulv0pL6Ve hPSn/XYJuxAl9y2izQgtaDG4XoUQyCa3fermWEPoKPZ+H7yxwPmxRAdtjuOvgw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: 2.22 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: B0D6C17E1A X-Spam-Score: 2.22 X-Migadu-Scanner: scn1.migadu.com X-TUID: U9nBADMcXCE8 Ypo 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 an= d my custom emacs 29 with custom org). And: (define-key global-map (kbd "M-n") (kbd "C-u 1 C-v")) =20=20=20=20 works too. Best regards, > From some time ago, it doesn't work in .org buffers, although it works=20 > in elisp buffers. > > In .org buffers I receive this message: > > After 0 kbd macro iterations: command-execute: Keyboard macro terminated= =20 > by a command ringing the bell > > Best regards > > El 19/06/2022 a las 18:49, Bruno Barbier escribi=C3=B3: >> 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) >>