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 03:16:21 +0300 Message-ID: References: <6fc3743a-6a0c-cc4d-9470-dcd634d3b461@gmail.com> <43a99cfc-fb6a-6751-7eda-48bb322e6fb1@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="33242"; 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 01:17:14 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 1tNLGz-0008YE-QX for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 17 Dec 2024 01:17:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNLGK-0003sJ-BJ; Mon, 16 Dec 2024 19:16:32 -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 1tNLGH-0003s5-Cq for help-gnu-emacs@gnu.org; Mon, 16 Dec 2024 19:16:30 -0500 Original-Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNLGE-0005cZ-95 for help-gnu-emacs@gnu.org; Mon, 16 Dec 2024 19:16:28 -0500 Original-Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-38637614567so2112171f8f.3 for ; Mon, 16 Dec 2024 16:16:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734394584; x=1734999384; 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=0LXwbYlx+2KqDr9oXf2dhthLCwgBsYdCwWezPa/RRFk=; b=HH6BEFfmEAc6u9i53OJ5vL1UhtoZlpc1dxO02ZKC6lls/uT/vJzHQtReTy49b+Tok1 7B/jqkFYt38cOUIGLF4XMPLK1loj9SscJZSJCs9WFDq2/7oSucLLbGci7RRcSJEfhmZl u6BLMmjdM2ERgd00vAai74BtjpI/mKfTAPNMRuDioAzzEURrRPiyKzztfZbZOATs/j1U D81C6bDKIm1+IYwZvNqlmZfOA/ijqmwkYXfL42jJipmDRGaJ4oHt3uBqChZlFES1I7RT vHYAjCJnK4nwxXMJrkeqRrOx+S+6GwRtOHmnGW7yDB5/uA0MeT7wvMKCM4tIRyH1KTpi wqIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734394584; x=1734999384; 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=0LXwbYlx+2KqDr9oXf2dhthLCwgBsYdCwWezPa/RRFk=; b=D8J6BozEd9jvFDE89LHXP5FkwmLZRJQCHv8K6JCptzhkhyayWHMsVVbJ3uH/VWbJVP BCRoSdKYB0VXjRfWLzrxaYqeNoZ7WNC9J7EEJgDVJBvJhat0+/E0PtqwQo6rhRWsN6UJ rE7Qve+pFpdbVmJMOpRwKvhU20UXlP2X1jXgkOfiEeRZX32RFT2PSMuaBii7/2bTUGCV j6JFYtaHa6qqRTa5+r5BJ1gQkzPrcU4d5mtNotWpB16kMLd00dEGqysc+QGEOt5XNMpk Q7Kv8d2GHQR5I5fZhytf9cDfgjwVd/dUJAi8WsT7e8P4BhPwLNu/oJjb7xfBlvCW1ZgR hfzQ== X-Forwarded-Encrypted: i=1; AJvYcCV79XCjzanJHugasxJ4pYke1+FZn7okkqfkAeo6jk9BspuBPUTq2X1ONdo16l9h/eou/6OIsLP+8CNUEUQFtA==@gnu.org X-Gm-Message-State: AOJu0YxTyyAnbDCOf9z9y1gyKHSCvLIIc4hY7V4I4nWX+Kz9k99QafXX 1TDEff8nzwijFUwhzng6ycsMrxrTJ5YsFG0yk7NM1OpmEuLktbNU X-Gm-Gg: ASbGncu+1qxLnyPHBbrGtzG1jpUK+5fSSPqzHUEHZ12PziyPYt4aF7hvLokG0v1tM2J cxDOsMnZBV+uRAlO5VlYHf3C7oRMmEKT5UWiPh0bzcpYHYkJMyFrzBHczOfqH7+luHrm5fa6OJP 3SHoAjEJvrTVQM+BnrTQ6416kJdO7IzTFDSfNseyceFibFSNpL9CwnA3sPgjfvb4mDEexsASUuA sZ5lOn2KPv/Hd2tQfs8jzwm2A5x8vsdOVrijw/UYr1SRq1g8EZ+9sIqF1UgA2SV8p05XomJcnzG J7b3o58GfmBnuiNg9eVEdm8pHwKvd4qooYK4n82mdkvObYt2D0/i X-Google-Smtp-Source: AGHT+IEjnBCTPOrB9Oduw3UGt6Q26IACYakTvfxY0nvx6w3mKxt0RHoIyGDM1Fbhds4IvK4RR7grsg== X-Received: by 2002:a5d:6c64:0:b0:386:4669:571b with SMTP id ffacd0b85a97d-388da393ce9mr1268676f8f.13.1734394584024; Mon, 16 Dec 2024 16:16:24 -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 5b1f17b1804b1-43625550518sm154687235e9.5.2024.12.16.16.16.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Dec 2024 16:16:23 -0800 (PST) Content-Language: ru In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=tatsu.takamaro@gmail.com; helo=mail-wr1-x42f.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:148848 Archived-At: >> You can't bind non-interactive functions to keys. But I rebound globally and this works: *(keymap-global-unset "C-c")** **(keymap-global-set "C-c" #'kill-ring-save)* * * * * >> This is a keymap: '(keymap ("a" . #'kill-ring-save))) Do you mean this: *(define-minor-mode ttkeys-mode "Normal key bindings"** **:init-value 1 :lighter " TT" :global 1** **:keymap** **'(keymap      ("a" . #'kill-ring-save)))* Doesn't work either. вт, 17.12.2024 3:05, Drew Adams пишет: > Reformatting... > ___ > > Below. > >> 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 of C-c >> followed 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. > A user can use any keys s?he likes. That Elisp convention tells you which > keys are reserved for users. Other keys (not reserved for users) are > likely to have bindings provided by Emacs or packages, so if you bind > them to different keys you might change some behavior. That's all - just > useful to know, for users too. > >> 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) >> ) >> ) > This isn't a keymap: '(("a" . #'kill-ring-save))) > > (keymapp '(("a" . #'kill-ring-save))) ; returns nil > > This is a keymap: '(keymap ("a" . #'kill-ring-save))) > > (keymapp '(keymap ("a" . #'kill-ring-save))) ; returns t > >> Well, this variant doesn't work either. I get the message: "Wrong type >> argument: commandp, #'kill-ring-save" > Yes, that too. You can't bind non-interactive functions to keys.