From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Trapping prefixes with universal argument component Date: Sun, 22 Aug 2021 15:13:47 +0700 Message-ID: References: <34c1e5b2-b51f-af62-7f46-f1edd2347e3b@akwebsoft.com> <875yvzaigm.fsf@zoho.eu> <2c62eabd-0a0a-f8af-edd6-8d127f9323f1@akwebsoft.com> <87zgtb4bj8.fsf@zoho.eu> <87wnoe387m.fsf@zoho.eu> <87r1em1itp.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17435"; mail-complaints-to="usenet@ciao.gmane.io" To: Emanuel Berg , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 22 10:14:43 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mHict-0004Gl-Kh for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 22 Aug 2021 10:14:43 +0200 Original-Received: from localhost ([::1]:60730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHicr-0006xf-BO for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 22 Aug 2021 04:14:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHicE-0006xU-Ny for help-gnu-emacs@gnu.org; Sun, 22 Aug 2021 04:14:02 -0400 Original-Received: from mail-vs1-xe31.google.com ([2607:f8b0:4864:20::e31]:45758) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mHicD-0006Er-1e for help-gnu-emacs@gnu.org; Sun, 22 Aug 2021 04:14:02 -0400 Original-Received: by mail-vs1-xe31.google.com with SMTP id d16so9038808vsf.12 for ; Sun, 22 Aug 2021 01:14:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=zgFkZ3YvN+ou+GDTI/laIP+b6Bid6SUH8t8/Q7JX8iE=; b=HjFR/uUz2aQuEfX8GeF7d/RLz0TBHL2H7THL435StOLIEZ++GM1O2BZHAVfWrZse2A eRWmpFvwHqmuzy8W6BdhfHb4jhPTleThsbmE1k+VVTOKauid164RKbiYihWLhUpsFnbk oqjbe4dBSZT5qyF3umSz7LaWnXdufME/vW+80AmOkpi10pJD1QuZgNDWU5cbu7IW2tN/ r92MQpCi7Ina2KyFVOm+33nzlsdqLhdkJ7PGaOB20Q0ColyLzvjWPZ+K82PLz1F5Qi1s kCaiofYpecOJTQ57lQmtzPAhGG1hB8CLMWmohVpJoRGwwo2NbCLAXahjTj5NkxQFldd1 T0Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=zgFkZ3YvN+ou+GDTI/laIP+b6Bid6SUH8t8/Q7JX8iE=; b=Mw4GKy4zmEg3J0TrdAzZa4vWqgp5wfIFEo7YkBqEYk1vAadpljNwTf9TYtu9p/RlDh BPQeoobcIDlgS0qoxLy09d++mMWIxIyRhmFotjPb+Vbu/EO4pvT1IKRe0WG02cSikd9J 7MPuIOz0/kMW3vS9/ln2xe8HZHUbkrUxuKQylm1THk+1LybjuFcb95HKzd0HVUvBgpKy yUq0bs/KQPj738f8yyWjsmqT1iIVrEqVimgyW332tnm4dl4dilEihcesZTHyK23+juv9 JRgOz5ysRBkc/1KW46sP5/Zt1hoBnOTrbzAxen6xPduj3nbj3F7CaBVG6XpmNqpImvet CvRA== X-Gm-Message-State: AOAM531IK7j2uuEP/CVE9uNXJ+YrcPygt5C5l5fPMesyGNeeCsDiRn2F YaTvR3A8dzMESlszKHnr6Me6/gk8LGiubg6rOeVaPDZcdK4lGA== X-Google-Smtp-Source: ABdhPJx9Rgc7n/a4LjyZHyahsn+B374gvse8ve3nHfsLiwgon+Lh8z1M61+wHhQxq0QLdwqhS+aF3694CxvzF93AkvU= X-Received: by 2002:a67:e8d0:: with SMTP id y16mr20958497vsn.51.1629620039570; Sun, 22 Aug 2021 01:13:59 -0700 (PDT) In-Reply-To: <87r1em1itp.fsf@zoho.eu> Received-SPF: pass client-ip=2607:f8b0:4864:20::e31; envelope-from=yurivkhan@gmail.com; helo=mail-vs1-xe31.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:132683 Archived-At: On Sun, 22 Aug 2021 at 06:30, Emanuel Berg via Users list for the GNU Emacs text editor wrote: > Try this then ... should work > > (global-set-key [M-kp-0] nil) Binding the offending key to nil isn=E2=80=99t going to help because when Emacs sees this (lack of) binding it will just proceed to key translation. And kp-0 translates to 0 and M-0 is bound to universal-argument. Instead: (global-set-key (kbd "") 'ignore) (global-set-key (kbd "") 'ignore) (global-set-key (kbd "") 'ignore) (global-set-key (kbd "") 'ignore) Alternatively: (defun my-insert-open-paren () (interactive) (let ((last-command-event ?\()) (call-interactively 'self-insert-command))) (defun my-insert-close-paren () (interactive) (let ((last-command-event ?\))) (call-interactively 'self-insert-command))) (defun my-insert-equal () (interactive) (let ((last-command-event ?=3D)) (call-interactively 'self-insert-command))) (global-set-key (kbd " ") 'my-insert-open-pare= n) (global-set-key (kbd " ") 'my-insert-close-par= en) (global-set-key (kbd " ") 'my-insert-equal) (Why not (insert "(")? Because self-insert-command also handles the numeric prefix argument, is affected by overwrite-mode, expands abbreviations, and does a lot of other things.) The =E2=80=9Ccorrect=E2=80=9D solution, of course, would be to reprogram th= e keypad so it sends different key codes, such as Shift+9, Shift+0, and =3D (or whatever is appropriate for one=E2=80=99s national keyboard layout), or if = the device does not allow reprogramming, then harvest key switches and build one that does ;) Plenty of macropad kits on the market right now, some based on Free firmwares such as TMK or QMK.