From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Johnson Newsgroups: gmane.emacs.help Subject: Re: Trapping prefixes with universal argument component [solved]T Date: Sun, 22 Aug 2021 10:14:43 -0800 Message-ID: <73381b1f-c3ea-946d-12ce-b1339ec5a79d@akwebsoft.com> 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; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2145"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 22 20:15:39 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 1mHs0R-0000LC-39 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 22 Aug 2021 20:15:39 +0200 Original-Received: from localhost ([::1]:46518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHs0P-0006k4-Fx for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 22 Aug 2021 14:15:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHrze-0006jk-Nj for help-gnu-emacs@gnu.org; Sun, 22 Aug 2021 14:14:50 -0400 Original-Received: from gateway32.websitewelcome.com ([192.185.145.119]:16739) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHrza-0000zZ-FV for help-gnu-emacs@gnu.org; Sun, 22 Aug 2021 14:14:50 -0400 Original-Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 2B6531DD626 for ; Sun, 22 Aug 2021 13:14:45 -0500 (CDT) Original-Received: from host2075.hostmonster.com ([67.20.113.97]) by cmsmtp with SMTP id HrzYmKadjrJtZHrzZmu04m; Sun, 22 Aug 2021 13:14:45 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tj49.com; s=default; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version: Date:Message-ID:From:References:To:Subject:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=SW+RxT6MpQ7BY80SsQS08mECrvTLzma26NgQxOhUvBg=; b=PMeEiMnJ+r0d4q4/v1jJAEYEwo UaWdhTovi+D3RlTFkuy5ABuYXKcd8YTderawWiQd/rH2+DJl82I6DoqP3pk3qGmF7AZxL2RYCaEpD 3O/OiTc5JwdSzeQ9WN7cfltV4; Original-Received: from tjohnson.mtaonline.net ([64.4.232.191]:42510 helo=[192.168.1.2]) by host2075.hostmonster.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mHrzY-001Wm9-HO for help-gnu-emacs@gnu.org; Sun, 22 Aug 2021 12:14:44 -0600 In-Reply-To: Content-Language: en-US X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host2075.hostmonster.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - akwebsoft.com X-BWhitelist: no X-Source-IP: 64.4.232.191 X-Source-L: No X-Exim-ID: 1mHrzY-001Wm9-HO X-Source-Sender: tjohnson.mtaonline.net ([192.168.1.2]) [64.4.232.191]:42510 X-Source-Auth: tim@tj49.com X-Email-Count: 1 X-Source-Cap: bW9sZG92YXM7bW9sZG92YXM7aG9zdDIwNzUuaG9zdG1vbnN0ZXIuY29t X-Local-Domain: yes Received-SPF: neutral client-ip=192.185.145.119; envelope-from=tim@akwebsoft.com; helo=gateway32.websitewelcome.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, NICE_REPLY_A=-0.959, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_NEUTRAL=0.779 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:132695 Archived-At: See bottom: On 8/22/21 12:13 AM, Yuri Khan wrote: > 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’t 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 ?=)) > (call-interactively 'self-insert-command))) > > (global-set-key (kbd " ") 'my-insert-open-paren) > (global-set-key (kbd " ") 'my-insert-close-paren) > (global-set-key (kbd " ") 'my-insert-equal) Dang Dude! You nailed it. Those assignments all work. Thanks very much. I'm marking this solved and ripping off the duct tape. Thanks also to Drew, Emanuel and all else who chimed in. Good work. :) > > (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 “correct” solution, of course, would be to reprogram the keypad so > it sends different key codes, such as Shift+9, Shift+0, and = (or > whatever is appropriate for one’s 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. This is a mechanical keypad but it is not programmable. I've used xmodmap a lot in the past but from inspecting xev output, I'm afraid that any reassignment through xmodmap might also effect the keyboard too. cheers ... -- Tim tj49.com