From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tatsu Takamaro Newsgroups: gmane.emacs.help Subject: Re: [External] : Q1 - the keys' bindings to work more widely Date: Tue, 17 Dec 2024 02:11:45 +0300 Message-ID: <43a99cfc-fb6a-6751-7eda-48bb322e6fb1@gmail.com> References: <6fc3743a-6a0c-cc4d-9470-dcd634d3b461@gmail.com> 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="40488"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 To: Drew Adams , "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 17 00:12:32 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 1tNKGN-000AMo-Ct for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 17 Dec 2024 00:12:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNKFq-0001cq-Ei; Mon, 16 Dec 2024 18:11:59 -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 1tNKFk-0001cO-KJ for help-gnu-emacs@gnu.org; Mon, 16 Dec 2024 18:11:52 -0500 Original-Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNKFi-0006TP-0T for help-gnu-emacs@gnu.org; Mon, 16 Dec 2024 18:11:51 -0500 Original-Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-385e27c75f4so3632473f8f.2 for ; Mon, 16 Dec 2024 15:11:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734390708; x=1734995508; darn=gnu.org; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=MG5Rmr1qpyZJzHTLOYdJzFUtUG3wDcHIdnlnr0H26r8=; b=Msrw0vMN2WwslCAC/bgHxp156Nfe57hM7pkjFQsyeGpRUInccjBmsNhmDG4pgLC8tI ozQ9FfYHjqq0jCrmVf13zUDAmIalVomOaFYuYCxYOpHCh4PG6nBNyM4q2BkT5fiYPjEc arq332UnBgKWU2qDk2DkIfY97Hu/XejVAHQTtzS7KQuHCRUn4+jLAN2uIk8eb7/PJSYJ 4NHs/Y7Hm/3gq/I2OdMMsenZpO1gvi2mlf0Gw5mwtQsW04dAGFu4485hOu9Nj6Nloas2 kMzyH+Y8yH72uyFq5JUhnC73rU9yChMjr2nBD8J6aRSiVRImjlXxv27Reiy1t8PV9kq1 cRJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734390708; x=1734995508; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=MG5Rmr1qpyZJzHTLOYdJzFUtUG3wDcHIdnlnr0H26r8=; b=HBpUshcLRw9DjKa4dVOtheVcNOAwtxcdXLhF71EjXFum7GyTPh4Ru4z6QVFdEjoR/c /U/uUsdbaGocP0NsLjBsPLXOULyp/SJn30EkmYFtocnPnQkWx9sTtnA1Hn2qrA+zND+n bsujxB+FqPtVlZ5Sbxyl0Jn1C/LGCzoy4SgS1Uj8CWI907Z7ZfdQak4QtS4qKx4pLeIT +KYnOP8edcSljUJiKxo/61Ut2dj57+yHA/dpv3GCP9R8FNUYx1Ewd6/KUDaCVRdyccKm ycrW2c6Mej+kNio7veMteX133rTciWRYTHBaeEnZ5SbOKTW/asGJnRV+XtGWNQR7+JSE XIwQ== X-Forwarded-Encrypted: i=1; AJvYcCVy3yXxbwapI8HyBTkxB7h1oK0ttdCRYo3Fg4fBFJJeiolQRKbqJtkUMYNnwnoLxd6cGC9d4v+aP3FcPZEigg==@gnu.org X-Gm-Message-State: AOJu0YzBcXwBoSHyxuT2CJUTngBBZ5ea8nmTWinVmPD3mvl/5Cb1zmbm +XhhdrWgvFNNm8CPhnSm3jy772IYp3uw8h0XqQ4Nc4IKQpYciBX4HYgNdA== X-Gm-Gg: ASbGncuWtVhXy5PmdfuIc6TNFOKsUUUli2k8mSgE6zQsdvQBkbXOpJtqnLWwOUwT1TZ QhZZfZznDggXb4Gvky76JN+Hyls3zUmJWHmWBeY8ERp5c/znMMczu5gFA5lTqre8jUJW1hVn+nf B79KGcq2rk/4Ka4JiNzzo2UaES+dfnwUd8CPbmf426pWED6CMGrVLbMXWTzkX/QxO7GhUCRASry oxqIZGPQDO/aNtaAplh4L1kv1f4mCL+zbvg4EhABwrT1w4hvRNoArMxPKsl27M6TF7MfaqGa6Qw SOWO7fBXfl2ZhkJ2cZJaHmuomc8bfTFrQDE3rDhgDuiIDJcuAdqy X-Google-Smtp-Source: AGHT+IEk/yARB9ZbpwJ5C68TTo8QNGy++rebSIRZ1vcLpU06jmbWYr4pGKrqUAaoiu3kfuREAjinaA== X-Received: by 2002:a05:6000:188d:b0:385:f00a:a45b with SMTP id ffacd0b85a97d-38880acda0emr11282480f8f.21.1734390707938; Mon, 16 Dec 2024 15:11:47 -0800 (PST) Original-Received: from [192.168.1.120] (broadband-37-110-24-126.ip.moscow.rt.ru. [37.110.24.126]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c8060fb3sm9276937f8f.94.2024.12.16.15.11.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Dec 2024 15:11:47 -0800 (PST) Content-Language: ru In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=tatsu.takamaro@gmail.com; helo=mail-wr1-x42c.google.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 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.934, 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-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:148843 Archived-At: >>See also the Emacs manual (`C-h r'), node `CUA Bindings'. As I told: "Don't offer a CUA mode, I know about it, but it doesn't meet my needs." I've read conventions, but did not find any answer to my questions. The only thing that may be close to it is about "Sequences consisting ofC-cfollowed by...", but it is irrelevant because 1) My "C-c" is not followed by anything, 2) I don't make any plugin for other users, I just try to set Emacs _for myself_. All the World uses Ctrl + c for copy, so the whole world would not sag under one program. Anyway, my question here is why the key bindings in my minor mode don't work. Is there some syntax mistake? Lets' for example change them to others: (define-minor-mode ttkeys-mode "Normal key bindings" :init-value 1 :lighter " TT" :global 1 :keymap '( ("a" . #'kill-ring-save) ) ) Well, this variant doesn't work either. I get the message: "Wrong type argument: commandp, #'kill-ring-save" вс, 15.12.2024 5:15, Drew Adams пишет: >> I would like to have my keys (my bindings) >> working more widely so that 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 globally as I set). And this is not surprising. >> I understand that major modes have priority over the global one. What is >> the best idea to make my keys more reliable? 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 minor 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 the solution. Here is my function call with >> an example of C-c rebinding: >> >> (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) >> ) >> ) >> >> The TT mode is being shown normally, I can switch in on and off, but the >> C-c and C-a don't work as I told them to. I tried to vary signs like # >> and ', but no result. What am I doing wrong? >> >> And, maybe there is some other advice that you could give to make my >> keys more reliable (make them work everywhere in Emacs)? Don't offer a >> CUA mode, I know about it, but it doesn't meet my needs. > See node `Key Binding Conventions' in the Elisp manual: > > https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Conventions.html > > That's `C-h i m elisp RET', then `g key binding conventions RET'. > > See also the Emacs manual (`C-h r'), node `CUA Bindings'. >