From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id sAd6KMKNaGfuCgAAe85BDQ:P1 (envelope-from ) for ; Sun, 22 Dec 2024 22:08:02 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id sAd6KMKNaGfuCgAAe85BDQ (envelope-from ) for ; Sun, 22 Dec 2024 23:08:02 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=web.de header.s=s29768273 header.b=AzYF58Ga; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=web.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734905282; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=CrbrmoVhtPrKmstFhczu6l+OM73ZmEpPv8F4yfNhocg=; b=R+NftH3iKMsm9oaxnKXauk3B4uoo5dNl8lYNBFrW0rbqCyaY6DIl+KBsG9SSy7pOiZrv9O i0CRTQC7mRZA6QbaIN5h2rUmIgb+Gj1Zxh8Pb9dXZDxvUDJMvBvLgvDFXAbYwniHEyJG5H xsZZBQI8XVw6vrPb98d0l9kB+WC5rhcTVNZflNwc+RGsYI/EfklXsZ0t7BdJ/zOl2duveM /WmJCdIAxK9pawDBQ3j+/WnKwFYvFkmFceuepvPNGWYmoQTjS0SKY5dBvETyc8wWkXUk1f 0FjwOENBB1U5Jrd4hE/loqx6VLdIjl68bPUkG9JtFBNTYWk5MASHGabY3rgmjg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=web.de header.s=s29768273 header.b=AzYF58Ga; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=web.de ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734905282; a=rsa-sha256; cv=none; b=BkCAWa1JtpRP8NHuPch+aFQaw5RCfs7fNeY7O3hLfxMWIrL5kQdkffuYTLKzY3pUDo0qta QtN7NMY8fYU5N8nZgoey1yk2gEUAng6w6v07wakPg+mZi7pfaCSSu1Shd5b4pu5U4/yCH6 OCMb0n3YzJRfhU1OMV/8JR7FkNDEiI/lsVDtphoPdkndxdmiXqfm857knPzyV64IzDD5mQ 527IOH/TFBFpIUpkxBwjH20fdxqEkngVkTSOuPpnM4NK9vpl8hwfCPH5KmDn9Ksaq4MiPe NmGksH7vVaPV/x7eEB+Z1tbniCVQzt4lBxMICzdm3kPNY4PTsxINg7+N9UN/dQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 26867870F4 for ; Sun, 22 Dec 2024 23:08:02 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPU6S-0005Nw-9j; Sun, 22 Dec 2024 17:07:12 -0500 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 1tPU6Q-0005NZ-E7 for emacs-orgmode@gnu.org; Sun, 22 Dec 2024 17:07:10 -0500 Received: from mout.web.de ([212.227.15.3]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tPU6O-000592-M6 for emacs-orgmode@gnu.org; Sun, 22 Dec 2024 17:07:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1734905224; x=1735510024; i=michael_heerdegen@web.de; bh=CrbrmoVhtPrKmstFhczu6l+OM73ZmEpPv8F4yfNhocg=; 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=AzYF58GaEhYDEFPHTDx1hsSUe2oYuy/+nSKnKz6XAICoqaxUK9Lt+H4ODqCfw4QK sWd1K/ckToUwexcYrM1iwjovY4XQRjxznKIaVyKhu2fTgtnPPWrfiyAm/HTYxBOOY GmYQmVr7fkck6D5vD2c3rTRGwDKEZnTzxKwvyZZRd3UxnPyFm4iQd4SnA/AQFN9CI 0vXokEhSV8jeali8RkFbhGQF2DbZq0X5VxA2wYqlztKUL3mAiGMvGQETs5f+wFKA5 lA8cJ/5sXwQvWKI1Rh+3QfN/kWI9M7hrChKXQFZpbTmSm03Va5KjJlCPszzr28QQD q2zrmQHo0DdFXoiKdQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([92.75.138.197]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MpCmZ-1ttuRr1eoB-00i189; Sun, 22 Dec 2024 23:07:04 +0100 From: Michael Heerdegen To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: How to handle both minor mode and major mode remapping a command? In-Reply-To: <87v7vd5jpz.fsf@localhost> (Ihor Radchenko's message of "Sat, 21 Dec 2024 12:00:40 +0000") References: <87r0691asn.fsf@localhost> <8734imtdtf.fsf@web.de> <87ikrf7ev6.fsf@localhost> <875xnfbh2g.fsf@web.de> <87v7vd5jpz.fsf@localhost> Date: Sun, 22 Dec 2024 23:08:13 +0100 Message-ID: <87a5cngylu.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:1ce5K1Esk5UEBQnjbXT/RamNd/s7/J7+5zkgDFFxCgxmrZMt5A9 jRaox0dy9Q2klhL+2wFDUX6hTXx6lBSxZlAphYvhcmPF6IT31OM2x89FW+r4a3hwoI3V2qB Lk3vvRX4zzVK76OeOdFgjF9ORIdyOgZVRRl6KWOlE8N2xiloH1QILA9EC9On9uLC3WUKGFY sK7/ez78H7EB8/nNJKSzw== UI-OutboundReport: notjunk:1;M01:P0:xH7p+v+rviE=;/mt/xAGlMOEicdHtqJA69V2hi2Z rETpYB6ncN/ZWRx4V6xNyDOMT0FZ4VQvW538G087aBXohjkqLeECpqGjfuZ0xB0KJCDqAqgkC +W8zwE6eMUbh6i5r8WHyFz6ti+NRQDWH9rlIJbIF+olON9MBbco4kNxdzL1RdJX0BO5nuJUUA fcndMInFrOjjdGBdUnfGqCeCbQmzDAUgVlIjNCez7RFB5BcMRuXSNJ9Ez9rQ/Jtdlm/gURIwr zjuZkprtZZQUAYwp/WzOEtkWgYdTDEhqb9SkVIUpi2cCNMe4/aUS59wZFj61rv2bEhDCVQuH1 i7E8LjDCKCoE1fGZWCPWJUYcKUUmRgbSfupAMssL7N2Vs3iJrhXBHPdICSCCudYcriJxKwsz3 lT3pTCjLCRW4OpRtFcl9FeFOLXQdDXsInY/hEqvOkcvdy4Rc11uGdmpRfXRTn2zw/EhTarA9C L5/Axf+74hsPi2IhrXYZe8Xaq34B4MHSCHBFCuP9KO5jeeVB3tJHKb0WgK5zYSZDMvnUz7Iso 8iqXiZ4/1+jqAFqzTFBeoWEtpEkRI6TyAarEoJZ8hf/ifD44NgLff9KgZGNx77GzpMrw1xQyg 1LakA7EaBPokKYHElUFmghPNBTGtNBXtW17lVn5pDjwLvy6nJeU6/Mb5ewSc0HJx45RfhP8nT UsRosozjeFBCmz9In995kceHK3NJMuHPcYpRYzuA0cknNCebdvYUPXtD6o7QzEMqUqTYwaPNp hJ9i2kjn4zgQ8ysRH6ZDQzzPtIzX9bPXMruGYtn9aB6P2OgSNGeEdRh+f+qNKfdAY46eLYQuL MkCg7YK9Y0va9CyMWvpaA2gPra3VrlqueS6xeMQfc9No1oR/b1cuzNCUdooWDZTLtKZCDTaL9 wfItdl7SBAfLv87wGc1dh9F9Sy3JmjYIj8s3Fwh1MCon6UGCgiBTklrOEBJxZgF7Kqn1VDhNS 7iz2vzORkaHrA7x0ecr9rRvEqhTvTaPmjtDwRIzNRgxZsHpr60RP0cyew/5eeeFRM0bppYoRz azvK4ANhZVoOaDc4zfzyos0CUbh0fJbSLy4H87mfslFsvYfM7tzha0s/35E5iv86aECQW5V6F FxxLGvxSA= Received-SPF: pass client-ip=212.227.15.3; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -7.76 X-Spam-Score: -7.76 X-Migadu-Queue-Id: 26867870F4 X-TUID: wFEprp93oZup Ihor Radchenko writes: > My main problem with the idea of kill-line-function is that I do not > fully understand how it can work in all cases. Specifically, imagine > what happens when visual-line-mode is activated _after_ Org mode is > activated. How can Org mode make sure that kill-visual-line does not > unconditionally override Org bindings? `add-function' wrappers are all combined, and that in a well defined way. When specifying the 'depth' property in the optional PROPS argument (using different depths of course), the order (or invocation times) of `add-function' calls of a place are irrelevant, the resulting semantics is controlled by the specified depths - for example: #+begin_src emacs-lisp (defvar my-f (lambda (x) (* x x))) (add-function :around my-f (lambda (o-f x) (if (< 0 x) 'important (funcall o-f x))) '((depth . -10) (name . outermost))) (add-function :filter-return my-f #'1+) (funcall my-f 2) --> important #+end_src A layer at the top has complete control over the behavior of the function since it can completely discard the code of the inner layers. It can also do that conditionally and fall back to or use the existing implementation only in some cases. As you see, this outermost layer is installed first in the above example. [ A second dimension of control: Outer layers can bind special variables around the call of the remaining layers (like (funcall o-f x) above) to modify the semantics of those inner layers when their implementation refers to those variables. ] For my taste this well defined function-only approach is better than trying to control competing keymaps using different mechanisms (minor vs. major modes vs. transient maps; key bindings vs. command remappings). Michael.