From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.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 AMKvFQO0XmdVCQEA62LTzQ:P1 (envelope-from ) for ; Sun, 15 Dec 2024 10:48:35 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id AMKvFQO0XmdVCQEA62LTzQ (envelope-from ) for ; Sun, 15 Dec 2024 11:48:35 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=dFuz+A39; 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=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734259715; 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=rnLIQIoCBp7cX1wzk+F97iUty4MfOPLIl5gfaT5llTc=; b=W67QVC9/clwmSrW9zCJn+Y+sxbcRmjpIs2daMJidJNslE4L6v6eJlWnvOq8nICm4CX2nPR GuwwJxGaWodd5gDzTmVv6N09JPiIgl8R8lfFDIdeqN4ZwhN2NqqD69bgxsHWBLyTQn4B9/ ETO8C59F+oweWVenjSuO/oZ+3vQpqpwRFeDvTd2dKKdjHF2top8GtvQoc1yIVG/Fpo9gvp g5nXyV/eKf7pDLVxAZIEwCd79U55xvocvDr5bHdjkFr50XM+QUNmp9B8WU8UuZhBd2+nWg m7tIdxEuvFarV8YPCCC72+F/9QoaMQ5dqbd6A1e68qNYdT1gwJnHlxf5QThM5A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734259715; a=rsa-sha256; cv=none; b=d3N73/c8e6hcBTN+tqSCZ3/Mnh7Epei9sBi2tV640kipxklYCl+330lGNeXcrtnlo1g2Vx qE6Mqn/0UWhiaJIfznf4Gu6dWP1xFZbVOY4nRchzmcC4Kk2DjZemnFacmBVctJ2nOv/zvP UbjZygZ1jv1w8DqDClTK8K1iH+I1fWaz/VV2dnc/8TtiUGXprL9Kvs3SDw7i5CxemPZ+f4 0QWpSWkev2SCDj1GmSSBFkuKv5UVtyW71vcefvSgKKTpuLbLzAXn/xoqOm5aTQAkRKm8FV +kzCPxQWYbjn83Go8pI3czNGAoL1kkf0YJe/koKLTbYgEcQ+jKVtMCf31tzPvQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=dFuz+A39; 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=none) header.from=posteo.net 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 3DD527A158 for ; Sun, 15 Dec 2024 11:48:35 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMmA0-0007K6-SJ; Sun, 15 Dec 2024 05:47:41 -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 1tMm9y-0007Jd-EU for emacs-orgmode@gnu.org; Sun, 15 Dec 2024 05:47:39 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMm9t-0004MF-Fc for emacs-orgmode@gnu.org; Sun, 15 Dec 2024 05:47:38 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B0C76240101 for ; Sun, 15 Dec 2024 11:47:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1734259648; bh=N7dCYS2d/l6nAaGWTiSAeONkau1bTlYFvPeQXli9PJg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=dFuz+A39i5KueelSPIjzpPoc4tduM1b8S6nUvDYPVgo2zPeHkpYLikQLH4RW2grMD QYpsZNvjGv8dN0nC6PEfc0m1gX0fWZoc1BdWKwi87Q8Fmif8BkRMnLhAySMOUI6fQc EoHFHxYKkKfebLbzHW4q80ZiMLBS8vFpYBnxNg3FRvo+AUKhzrR1aucnE9s66kpsF8 sUfq7EwbJYrB0zAlljKwuywUU+NGT8i0PnUfIZIqfvJG7vqdSt3kdZ0dSYtVh5L36b zhqXPJxYzpVjANgOIPCV7DIe87SENkAP0/84vXWt7dXJnDK/vFVqQizMqyVeGTJ9AG IXiBUa5k5KABg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YB0C40kYwz9rxF; Sun, 15 Dec 2024 11:47:28 +0100 (CET) From: Ihor Radchenko To: Nathan Collins Cc: emacs-orgmode@gnu.org, emacs-devel@gnu.org Subject: How to handle both minor mode and major mode remapping a command? (was: Bug: org-kill-line shouldn't assume visual-line-mode means kill-visual-line) In-Reply-To: References: Date: Sun, 15 Dec 2024 10:48:56 +0000 Message-ID: <87r0691asn.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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-Spam-Score: -5.92 X-Spam-Score: -5.92 X-Migadu-Queue-Id: 3DD527A158 X-Migadu-Scanner: mx11.migadu.com X-TUID: dAYL3mckT5W6 Hi, We have the following situation in Org mode: 1. Org mode remaps `kill-line' to `org-kill-line' 2. `org-kill-line' performs special action when point is on a heading and otherwise falls back to `kill-line' 3. visual-line-mode, if active, sets up minor mode map remapping `kill-line' to `kill-visual-line' In the past, activating `visual-line-mode' caused Org mode binding to be completely shadowed. Later, we tried to fix the problem by 1. Overriding `visual-line-mode' remapping by force 2. Hard-coding a special case for `visual-line-mode' to call `kill-visual-line' instead of `kill-line' as a fallback in `org-kill-line' However, the situation is not ideal. Below is a recent bug report where user changed the default remapping in `visual-line-mode-map' to something else (not considered by Org) I am wondering if there is some canonical way to handle similar scenarios recommended for major modes. Any suggestions? Nathan Collins writes: > Hello, > > In the latest version of org.el, at line 21367 [1], inside `defun > org-kill-line`, we have > > (if (bound-and-true-p visual-line-mode) 'kill-visual-line 'kill-line))) > > but I think instead this should just call whatever `kill-line` is > bound to in `visual-line-mode-map`. By default, `visual-line-mode-map` > remaps `kill-line` to `kill-visual-line`, but I remove this remap > because I prefer the default `C-k` behavior. But in org-mode, I can't > figure out a way to disable this behavior of `org-kill-line`, except > by removing org-mode's remap of `kill-line` to `org-kill-line`, which > loses the other fancy logic of `org-kill-line`. > > Cheers, > > -nathan > > [1]: https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/org.el#n213667 > -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at , or support my work at