From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alain.Cochard@unistra.fr Newsgroups: gmane.emacs.help Subject: Re: Q1 - the keys' bindings to work more widely Date: Sun, 15 Dec 2024 11:05:39 +0100 Message-ID: <26462.43507.306572.307952@frac.u-strasbg.fr> References: <6fc3743a-6a0c-cc4d-9470-dcd634d3b461@gmail.com> Reply-To: alain.cochard@unistra.fr Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36500"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Tatsu Takamaro Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 15 11:06:44 2024 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 1tMlWO-0009O5-01 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 15 Dec 2024 11:06:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMlVl-000194-PK; Sun, 15 Dec 2024 05:06:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMlVe-00018f-0y for help-gnu-emacs@gnu.org; Sun, 15 Dec 2024 05:05:58 -0500 Original-Received: from smtpout01-ext2.partage.renater.fr ([194.254.240.33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMlVa-00071c-8N for help-gnu-emacs@gnu.org; Sun, 15 Dec 2024 05:05:57 -0500 Original-Received: from zmtaauth01.partage.renater.fr (zmtaauth01.partage.renater.fr [194.254.240.25]) by smtpout10.partage.renater.fr (Postfix) with ESMTP id 4508A649D1; Sun, 15 Dec 2024 11:05:41 +0100 (CET) Original-Received: from zmtaauth01.partage.renater.fr (localhost [127.0.0.1]) by zmtaauth01.partage.renater.fr (Postfix) with ESMTPS id 3E221140009; Sun, 15 Dec 2024 11:05:41 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zmtaauth01.partage.renater.fr (Postfix) with ESMTP id 2EA591400DE; Sun, 15 Dec 2024 11:05:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.10.3 zmtaauth01.partage.renater.fr 2EA591400DE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unistra.fr; s=CF279DD4-6F58-4C59-BB33-73FDC6DFC1E3; t=1734257141; bh=jiNks1EoGK67uLA09afwJ4tgyLurzHS1RQd8YFOi6ns=; h=MIME-Version:Message-ID:Date:From:To; b=VoS67AqBFvv/CHW/FUCF6Tljmzx0Qzz3v7NG15ojWqhkR9fppyj9lbUiPI+SU9Rr3 U6OufEdal+FhDSSvGvPdUWRPAdvCZ4p5sI3vhPpkw/EhHL7fi4wTiZ7JIxJXQSZfeh eDIM7oJZaJLQ06wsk3zogUZr0hm4FROB5Qs1Uub6A8CdT94PilXANlBYZOhYVztRMv DAkbLVsg95CXX9iDTFsZ7o62UUN1R5D/ul5TfgiY4pEMqprCXZ4iGQSxBx7mm+LuiF ly197YptggE/nYz4Hkuctf8ZksubrxtzgoqODm18BpBzZjevJ8IXFtYDUC7VmcOuv0 BrpWWEHdAWL3Q== Original-Received: from zmtaauth01.partage.renater.fr ([127.0.0.1]) by localhost (zmtaauth01.partage.renater.fr [127.0.0.1]) (amavis, port 10026) with ESMTP id PK8RDPGJcdp1; Sun, 15 Dec 2024 11:05:41 +0100 (CET) Original-Received: from 90.33.60.1 (unknown [194.254.241.251]) by zmtaauth01.partage.renater.fr (Postfix) with ESMTPA id BEF8C140009; Sun, 15 Dec 2024 11:05:40 +0100 (CET) In-Reply-To: <6fc3743a-6a0c-cc4d-9470-dcd634d3b461@gmail.com> X-Mailer: VM 8.2.0b under 29.4 (x86_64-redhat-linux-gnu) X-Virus-Scanned: clamav-milter 0.103.8 at clamav04 X-Virus-Status: Clean X-Renater-Ptge-SpamState: clean X-Renater-Ptge-SpamScore: -100 X-Renater-Ptge-SpamCause: gggruggvucftvghtrhhoucdtuddrgeefuddrledugdduudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucftgffptefvgfftnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeggtgfgkfffhffvvefujghfofhrsehtqhertdertddunecuhfhrohhmpeetlhgrihhnrdevohgthhgrrhgusehunhhishhtrhgrrdhfrhenucggtffrrghtthgvrhhnpedtvefftdeuhfeifeevgeejhffffffftdduvdegfeduudfghfetgfeuffdvhfffgeenucfkphepudelgedrvdehgedrvdeguddrvdehudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleegrddvheegrddvgedurddvhedupdhhvghlohepledtrdeffedriedtrddupdhmrghilhhfrhhomheptehlrghinhdrvehotghhrghrugesuhhnihhsthhrrgdrfhhrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohephhgvlhhpqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhgpdhrtghpthhtohepthgrthhsuhdrthgrkhgrmhgrrhhosehgmhgrihhlrdgtohhm Received-SPF: pass client-ip=194.254.240.33; envelope-from=Alain.Cochard@unistra.fr; helo=smtpout01-ext2.partage.renater.fr X-Spam_score_int: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.8 / 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, NICE_REPLY_A=-0.348, RCVD_HELO_IP_MISMATCH=2.368, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148810 Archived-At: Tatsu Takamaro writes on Sun 15 Dec 2024 02:46: > I would like to have my keys (my bindings) working more widely so th= at I > could trust them more. But for now some of them don't work. E. g. in= a > Help buffer C-c doesn't work as a copy action (though it works globa= lly > as I set). And this is not surprising. I understand that major mode= s > have priority over the global one. What is the best idea to make my = keys > more reliable=3F One way is to change all the major and minor modes,= but > it's a big load of work and code. Another way is to create my own mi= nor > mode key bindings and make it be turned on by default, and I managed= to > find how it should be done ("init-value" and "global" should be non-= nil, > in the "define-minor-mode" call). So I hope I'm somewhere close to t= he > solution. Here is my function call with an example of C-c rebinding:= >=20 > (define-minor-mode ttkeys-mode "My key bindings" > :init-value 1 :lighter " TT" :global 1 > :keymap > '( > ("C-c" . #'kill-ring-save) > ("C-a" . #'mark-whole-buffer) > ) > ) >=20 > The TT mode is being shown normally, I can switch in on and off, but= the=20 > C-c and C-a don't work as I told them to. I tried to vary signs like= #=20 > and ', but no result. What am I doing wrong=3F >=20 > And, maybe there is some other advice that you could give to make my= =20 > keys more reliable (make them work everywhere in Emacs)=3F Don't off= er a=20 > CUA mode, I know about it, but it doesn't meet my needs. I am not sure it addresses your question (in particular, I do not redef= ine C-c), and I have read that this way is frowned upon, but here is what I= do: ;; First: (defvar my-keys-minor-mode-map (make-keymap) "my-keys-minor-mode keymap= .") ;; Then all my keys like that: (define-key my-keys-minor-mode-map "\M-." 'scroll-up) --=20 EOST (=C9cole et Observatoire des Sciences de la Terre)=20 ITE (Institut Terre & Environnement) | alain.cochard@unistra.fr 5 rue Ren=E9 Descartes | Phone: +33 (0)3 68 85 50 44=20= F-67084 Strasbourg Cedex, France | bureau 110, ancien b=E2t.