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: Remapping keys and creating my own keymap \\ too complicated\\ Date: Tue, 3 Dec 2024 19:59:44 +0300 Message-ID: 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="16985"; 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: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 04 03:00:43 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 1tIeh0-0004Ie-VL for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 04 Dec 2024 03:00:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIegQ-0001yb-7c; Tue, 03 Dec 2024 21:00:06 -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 1tIWFb-0006zP-Cy for help-gnu-emacs@gnu.org; Tue, 03 Dec 2024 11:59:51 -0500 Original-Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIWFZ-0005Ta-Ji for help-gnu-emacs@gnu.org; Tue, 03 Dec 2024 11:59:51 -0500 Original-Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-53de035ea13so5970007e87.0 for ; Tue, 03 Dec 2024 08:59:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733245187; x=1733849987; darn=gnu.org; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=0jCiYur+tHIRCIhVQHmdyqDzgo8VVU+QJfoSmoqHjss=; b=OkmG7unUvMn/T53yogM5PwR9RvXfsW23311tWp3YODvozmPkL22zxCYCgD15dPnYNW 1kRHdJ4riYI5qmrbbHJa8qyegvgLmbcScklgNiyw4pQ1Sf3cEWeVe3zZ/81DsKGKPsa0 EQOy6blC9Gu2Iy9cSqNNkfrY96UazQqwL+EQmEVd8HFdC2ZOmt1dfMvV1z0qNYTfFZ5Z DuSXK7Loxq1qhE+sx/SWWBiU+7cXDE1HlAFxfolgug0AHF+GHmnuwvqk+ouqZ4auMSj/ qbPGCkUd/WarT1j79UTLB748Au/0LSpK/OdkfmNkNqOgPtsS8xTrqmPKWknM0azcNde1 T/Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733245187; x=1733849987; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0jCiYur+tHIRCIhVQHmdyqDzgo8VVU+QJfoSmoqHjss=; b=IK0pZv3vRO472804n4S085RLFOhUeJ+LfDXOfZaAWVaDVqUEAlddrNhdBCZ2RGzyPS QSoWb7o5ZN8NnS3oA0OpqS/dFxpp3iQP+PvZ+1Z9Yo31Uxrz4cW5u/S2vy8KyluH06I7 wAF013XZ+wgnH7bvKYCxDk/S/zOxwKcbKxJjzubjvL4/E+2LzqvRTbaiVAP4aoSN1Pwe P+vs4D3uoaGBe0/Mq0pRgJ9rOSxm+M9r6ZcdB8ZJ1cx+nWhnQ80yrEfxdlf2dR1RTQzq kjvxgQR3gmDfpvbx2aMCSZ0y3FH2nLe9lNuMo7b/QOXvkmmg9v6nPywJzsRxffKnjhvX PJGw== X-Gm-Message-State: AOJu0YzsG54NO071Hsrh6YpnHEu3s4nF01r2Z9FX6s/uYiSyyjXTuLLg EmdEpJvVF+3UejvEiCGmsK4hIS1PZbd7S8kgeCCwPUhsn7nATBTqfGLjEQ== X-Gm-Gg: ASbGncu1etZ4ZzYGxWjrdQSCFYwEpw2c4leYJFWNu/TAGyveIYPcnY/E5IvQZi7P0R0 FyyoV3j4jMObaOWvdQOC/Yo1n9qz0TkMV9LQ34XLq+kTwX2EWWc9/P6CQ0MWnMHaFrC0nFpviIL ZYbv90M3o/y9irZYRasa3tGVFpY73sif78sBm4sjd9nyofG4D3HmaU9r7E48RH5z3vL2jkafRG9 BF+4Ktp+qVE+M6dUcqt2tvMAriE+GfgufVMqfOWzJDcaiwTV1PxQtW52DrKSmuM7M9MOpwgd3Xv uN6jGyqT5AZY8yuVXGoPDVza9WamopbbO7RNKM8= X-Google-Smtp-Source: AGHT+IHEtZAwldYsmvrxDplyiwk8euarFgw0OmjdSWeK/wgBfms06cOSNhp7Hiiusj+F1RndIThg+Q== X-Received: by 2002:a05:6512:3ba8:b0:53d:a4f9:6141 with SMTP id 2adb3069b0e04-53e129ff45fmr1747653e87.14.1733245186539; Tue, 03 Dec 2024 08:59:46 -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 2adb3069b0e04-53e18ec55afsm176618e87.274.2024.12.03.08.59.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Dec 2024 08:59:45 -0800 (PST) Content-Language: ru Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=tatsu.takamaro@gmail.com; helo=mail-lf1-x12f.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, HTML_MESSAGE=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-Mailman-Approved-At: Tue, 03 Dec 2024 21:00:04 -0500 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:148580 Archived-At: Good afternoon, I'm trying to reassign keys but have run into a number of difficulties and questions about the best way to do it and how to do it correctly. 1. Do I understand correctly that if I want to change hotkeys, the most logical, sensible and ‘beautiful’ way to do it is to create my own key map? That is, I create key mappings to commands, save it all in a file, and then just plug that map in instead of the default one (via the appropriate command in the ‘.emacs’ file). This seems like a more proper way, better than making changes to the default key map. Right? 2. Your original manual has a lot of complicated text on this topic. I honestly tried to figure it out on my own, though. However, I eventually found an article that explains in simple words how to do it. Here is that article: https://emacspal.com/extending-emacs-functionally-with-user-defined-keymaps/ However, I saw a large number of differences between the article and your official documentation. I already wrote to Emacs Pal (the authors of the article), but they haven't replied for a week now. On the one hand, the article is clear, but the syntax of the commands does not match your documentation on many points. For example, here they describe the define-keymap command: * **(define-keymap my-map** **  "Binding description."** **  :bind (("C-c C-a" . select-all)** **         ("C-c C-f" . find-file)))* And here's an example from the official docs: * **         (define-keymap :full t** **  "g" #'eww-reload** **  :menu '("Eww"** **          ["Exit" quit-window t]** **          ["Reload" eww-reload t]))* Huge difference. For example: 1) you don't specify the name of the keymap right after define-keymap. How do you plan to call it later, if not by name? And Emacs itself does not provide the name of the map in the command description either. 2) they probably have a description after the map name (line ‘Binding description.’), but official syntax does not provide any description in this place. 3) further they have the :bind key, which is also not officially provided. And other things, as you can see from the examples. Thus, I am even more confused. 3. So how do I create my key map correctly (in simple words)? I need a global map to replace the default one. But I don't want to prescribe all combinations at all, but only those that I want to set my own. The rest of the combinations should remain as in the default one.