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: Remapping keys and creating my own keymap \\ too complicated\\ Date: Tue, 10 Dec 2024 01:34:52 +0300 Message-ID: <05f56e2f-cc66-3fe1-0a22-0ae6423ec853@gmail.com> References: <87plm7cu05.fsf@gmail.com> <48d40943-c50f-6cfe-21a5-b6ea8a9662c0@gmail.com> <87h67jcsg6.fsf@gmail.com> <871pymctpx.fsf@gmail.com> <1a163863-2992-186f-3f67-f9dd9d35b986@gmail.com> <87o71pb0bz.fsf@gmail.com> <87frn1ar0m.fsf@gmail.com> <17dad089-c11c-9494-b740-e47039c1927a@gmail.com> <87ttbdydsv.fsf@gmx.net> 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="21987"; 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 Cc: Robert Pluim , Jean Louis , help-gnu-emacs@gnu.org To: Stephen Berman Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 09 23:35:40 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 1tKmLs-0005eI-4x for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 09 Dec 2024 23:35:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKmLI-0003Jg-47; Mon, 09 Dec 2024 17:35:04 -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 1tKmLG-0003Ix-Jo for help-gnu-emacs@gnu.org; Mon, 09 Dec 2024 17:35:02 -0500 Original-Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKmLE-0000ps-DF for help-gnu-emacs@gnu.org; Mon, 09 Dec 2024 17:35:02 -0500 Original-Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-5401bd6cdb4so1833265e87.2 for ; Mon, 09 Dec 2024 14:34:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733783698; x=1734388498; darn=gnu.org; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=RHz/P3jGgd+f3/m1Fa46vK8xGG670/7WHry6Ur/MH+8=; b=XI9J+3iP11+Dih2pCo42es9GnFu4l+velsQy6mBVyc5fmXTJTAZZ3X4Z2fuNGniv7+ PVXIm4CQwknmEHhlfu2cIl/Wi6mNdnwniawxEYA59k+ZIeatiRZt7A+Gs4PY5InCFbFw XtEm2hpW9H7onBowgd3wjEfVcuFFiYDFznk446AgWulDrHhP84bx7gLq7tWYbGImNXRA 5uKQMUGKbpQjG42nwv26AZDeFm5/2d18tGvb/26K27oQZ1h1j3/0lnC8zGBBcFnuIXzr 2629wXna637N9gffRbSPOJIvzLHt/099LN59MUntuMY0MO+iMLsUQwOHstTemyeIfIQ9 dFyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733783698; x=1734388498; h=in-reply-to:from:references:cc: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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X-Received: by 2002:a05:6512:3d22:b0:540:20c5:ea9f with SMTP id 2adb3069b0e04-54024112fa8mr909884e87.44.1733783697238; Mon, 09 Dec 2024 14:34:57 -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-53e34569209sm1089053e87.128.2024.12.09.14.34.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Dec 2024 14:34:55 -0800 (PST) Content-Language: ru In-Reply-To: <87ttbdydsv.fsf@gmx.net> Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=tatsu.takamaro@gmail.com; helo=mail-lf1-x12d.google.com X-Spam_score_int: -47 X-Spam_score: -4.8 X-Spam_bar: ---- X-Spam_report: (-4.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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, NICE_REPLY_A=-2.709, 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:148734 Archived-At: Yes, true. Thanks, now it works. Well, that's what I have now: (keymap-global-unset "C-q") (keymap-global-set "C-q" #'save-buffers-kill-terminal) (keymap-global-unset "") (keymap-global-set "" #'quoted-insert) (keymap-global-unset "C-a") (keymap-global-set "C-a" #'mark-whole-buffer) (keymap-global-unset "C-z") (keymap-global-set "C-z" #'undo) (keymap-global-unset "C-/") (keymap-global-set "C-/" #'suspend-frame) (keymap-global-unset "C-s") (keymap-global-unset "C-f") (keymap-global-set "C-s" #'save-buffer) (keymap-global-set "C-f" #'isearch-forward) (keymap-global-unset "C-x") (keymap-global-set "C-x" #'kill-region) (keymap-global-unset "") (keymap-set global-map "" ctl-x-map) (keymap-global-unset "C-c") (keymap-global-set "C-c" #'kill-ring-save) (keymap-global-unset "C-v") (keymap-global-set "C-v" #'yank) (keymap-global-unset "C-o") (keymap-global-set "C-o" #'find-file) (keymap-global-unset "M-o") (keymap-global-set "M-o" #'open-line) (keymap-global-unset "C-") (keymap-global-set "C-" #'backward-sentence) (keymap-global-unset "C-") (keymap-global-set "C-" #'forward-sentence) (keymap-global-unset "M-") (keymap-global-set "M-" #'backward-paragraph) (keymap-global-unset "M-") (keymap-global-set "M-" #'forward-paragraph) (keymap-global-unset "C-") (keymap-global-set "C-" #'scroll-down-command) (keymap-global-unset "C-") (keymap-global-set "C-" #'scroll-up-command) (keymap-global-unset "C-S-") (keymap-global-set "C-S-" #'backward-kill-word) (keymap-global-unset "C-S-") (keymap-global-set "C-S-" #'kill-word) The keys work. Not as ideal but work. The main problem is resolved. But if I may continue, there are some details that still bother me. 1. What if I want not to cut (or how you call it - kill) a word with "backward-kill-word" and "kill-word", but delete it (so as not to put the words into the exchange buffer)? 2. Commands "forward-sentence" and "backward-sentence" do not move by sentences actually. I tried in both Text and Fundamental modes. If there are two sentences in a line, they ignore the dot in the middle. I guess it is somehow connected with an internal mode's settings (what is considered to be a sentence). But it seems logical that when I'm in a Text mode, I await to treat literary sentences as sentences, where a dot sign is a delimiter. 3. I would like to have my keys working more widely so that I could trust them more. But for now (see my bindings above - they are all global) some of them don't work. Eg in a Help buffer C-c doesn't work as a copy action. 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, but I will have to turn it on in every buffer manually, which is also not very comfortable. What would you advice? With respect. Tony. пн, 09.12.2024 2:07, Stephen Berman пишет: > On Sun, 8 Dec 2024 19:16:02 +0300 Tatsu Takamaro wrote: > >> I did as you said and just added some commands to an .emacs file. And >> everything worked untill I tried to change the C-x binding. Here is my exact >> code: >> >> (keymap-global-unset "C-x") >> (keymap-global-set "C-x" #'kill-region) >> (keymap-set global-map "" 'ctl-x-map) >> >> It seems logical, but it doesn't work properly. The Ctrl + x works just fine >> and cuts the selected fragment. Pressing Ctrl + x also doesn't have an effect >> as a C-x prefix (for example, keys C-x-s don't work to save). But then there >> is an unexpected behaviour. Pressing the Menu button () doesn't act as >> C-x, and I can't use it to run commands that start with C-x. For example, I >> can't do save-buffer by pressing -s. Why is it so? What am I missing? > `ctl-x-map' is a variable whose value is a keymap, and you want to bind > that value, so don't quote the name: > > (keymap-set global-map "" ctl-x-map) > > Steve Berman