From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel,gmane.emacs.orgmode Subject: Re: How to handle both minor mode and major mode remapping a command? Date: Tue, 17 Dec 2024 18:33:00 +0100 Message-ID: <8734imtdtf.fsf@web.de> References: <87r0691asn.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14786"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Nathan Collins , emacs-orgmode@gnu.org, emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 17 18:32:53 2024 Return-path: Envelope-to: ged-emacs-devel@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 1tNbRF-0003bo-6g for ged-emacs-devel@m.gmane-mx.org; Tue, 17 Dec 2024 18:32:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNbQV-0005Ts-G4; Tue, 17 Dec 2024 12:32:12 -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 1tNbQM-0005So-In; Tue, 17 Dec 2024 12:31:58 -0500 Original-Received: from mout.web.de ([212.227.15.14]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNbQK-0001sV-Pd; Tue, 17 Dec 2024 12:31:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1734456713; x=1735061513; i=michael_heerdegen@web.de; bh=ASm3dlmQvGmozLJdhaWcw4jrNxPuamwb1CHUWz7F4ho=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=fGwkyLoI62HrfLiHsgMwVJDFEUwmRV1C7vAxW+dFL05Frs80OpXpH2SVUp9UUeS2 ClyihuSbb+WHXDHkTncDzKMx2z0MNJIi7BuzHbT8DI0jZHej3BBsOKJfPu1kFmBw5 /kXTG3bDwRnpsJMjJkWuf+buAHc7OAMfKta8xqBZme4rfaXYTO7G54cWgD50foYvt o72M01FV06QJwBVB8tZRXPLWZE3rOUMJ9NuASv5w4JHVeo7BlJlNxa3kMC0sL+PVD WjV+rZwdun1XDzn5v11jbxKxTI39TugggdQvoawko1EKcea7fo4W9GzmreqoVBXaQ jqd5eKnv1V3lwqYwqg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([92.75.138.197]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MDdy7-1tG8mU0NJn-00FY3f; Tue, 17 Dec 2024 18:31:53 +0100 In-Reply-To: <87r0691asn.fsf@localhost> (Ihor Radchenko's message of "Sun, 15 Dec 2024 10:48:56 +0000") X-Provags-ID: V03:K1:h0Y9E54jNkcfbN9wCeMKJNT6+4t7hwt6MNH5vrqkPsQfii8b897 0Fqdg1RT7FRvBCbQG+pPmhdJauqNd+GbIYJyYH/8aVbQe236x6PLtF9aW1yZKMUAZfZjDF6 F/bYt17s/U41Lk6xMHgUOq/gJLl/lIH0puYkK4qFQEswsixPAkKKWMs3eCRcW0D864AM/Ar SzcB4gNm5vqSvyZwrFrQA== UI-OutboundReport: notjunk:1;M01:P0:VHy5QGfFRRA=;6bd+Wg2Dnv0kWCFto6gq4Ygq3Tu /169zkjJRh79flPIHacQkTwrrvUQdXNY5rl6NTnY2VilR93KP0qwmHf4NPOhRUVSsj3OWfCqg AWpbXHzD1JunUfiRSrTEXmnIaVOk6KDKXspDauUbqC2qmlSCu7UZCjF9Bu8d3v0yzSSHFMQS2 Pjqc5wdvidVjuk9jzli5SJh4fbskKkr4mjRzyNOO0c62fR83qB42XuKdJiRukEIb6PmlfT+MT pLhojFAtSmwqxQIou2IO0VO3JPHvYfooeb1jw6JeHBT42IXkB1VTZ3+dhufJ9LKjC14CbZ1JD jccLFKYsYpGiezas0FVhxePh89CtrlDPfywvqb8xWn04LJE08IyYsuIu3qar7xbwbkVK/3cdt 0OSWqBZwojankWeInzsYFIpUdmRMQrTbZspca4hq6d3D775S4MGZelgyJxiNvBvMycOUHf588 eBszyUf+XlfnsMw7+cuoKGe07DBej4Wx51JdhiLBRFE7sk9b3Sq16sexDD2MOB8PjS6cn9GMI Ts91Dlt6mRLZqs42SLNhY8oQg2lx39XLkzAv0QsFySTevl8646Vhi4ILjSYDO/2WaybxrcrhF kpuws9wBy3PI2z+4kGcrXgki9/IqMP802JrY3MmhnB5/ERQdsmMyukPUkg24w+NvYyJESvURG lqU2upP7+Aew8a2pUp0KGilyTFwfBybahsZb/E/8QubxMK5/A6ivjOB5JPj7K1SL8D0QTdjYj t/z6SdtvTonfaRjBENlm9xM7wPIxY651sXI4/hR20Dl349CW0CPuWWQQ8CI6RqGYN5LqEFWR Received-SPF: pass client-ip=212.227.15.14; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -38 X-Spam_score: -3.9 X-Spam_bar: --- X-Spam_report: (-3.9 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1.116, 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: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326603 gmane.emacs.orgmode:164210 Archived-At: Ihor Radchenko writes: > I am wondering if there is some canonical way to handle similar scenarios > recommended for major modes. > > Any suggestions? Why not, as in similar situations, define a `kill-line-function' variable with default value `kill-line-default-function' which is a function (more or less our current `kill-line'). Any mode that wants to modify the behavior would `add-function' on that variable binding. We would have one single place where the thing is controlled, while the behavior can still be modified by future modes. `add-function' has priorities that can be used to specify which mode should win in case of conflicts. Michael.