From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id OCEgIrKIt2RPaQEASxT56A (envelope-from ) for ; Wed, 19 Jul 2023 08:54:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id wG5AIrKIt2R/7gAA9RJhRA (envelope-from ) for ; Wed, 19 Jul 2023 08:54:42 +0200 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 0270E4925B for ; Wed, 19 Jul 2023 08:54:42 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=d+UCtrZm; 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=1689749682; 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=rp2h/6W2Bv/eh2vDXlXBMhGeAJXmgJTK4Y8UExrdoe8=; b=e/0nBtYxlqEvRbcDSV2ZCWxWmXXy8lp2j5EAcO3JNprpKF8PvJ+7Fe0gzxtO9elu7kZJ3z IeT7c+/RThkot5rxCkV2XKkIzgj2BG83Mq17/Gu/QWNUjFfejWljGz+cEzgBzydz7274eX cMwBRTHI2dftfbF2EauWqTfKXywtZj5O5V+t+Q7keuTAfLhKotroxA2fWeGEAgbhpWnfZz mb0JmT1vLpXumkQUockJzlv2DK+f2Hzo2bQJTD2/Ho37UGyheDJK3d4MM7oJNKG5TB9GNI bgKzfN9OLFhPzK+xI1pK/dlb/vC49HVj4UJhMbjOi9KZBJ1j16YTYmCiqW7rdg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=d+UCtrZm; 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-Seal: i=1; s=key1; d=yhetil.org; t=1689749682; a=rsa-sha256; cv=none; b=IcPh/u/xfTV5A/Cr5BXx/8O2O9rP5NToN0Y350VLEV7l1Rkqzlk3W0cf+G8zBkAfsQ3/gS /OLUlBJy7HDyIHNxgZKjCBiXKBNquSVaH9wNHTHAGKbNQLLIJZOq3B8U2KEgI6ARC5ax+b lGXGcRKgzVp/ivBoV/6faEcM3CqXQYhtJ+ZGYD5TvchPYv8/h1Vv+fy/8ySOLuw/8iMQiV EALZFgZK2OQKJ0ZxDmtoeZP5YH6tF8S0ikkt8Nft1wvSt7/2vUPQapXG23NxeCjUvKvvCe ZHB1Jd45lPpqnBvIKXA4rI4UrGrqA3lsBJvVgz0r1r83QSZyeuVNBx5xQAM+FA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qM14F-0003KV-91; Wed, 19 Jul 2023 02:53:47 -0400 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 1qM14C-0003KF-OX for emacs-orgmode@gnu.org; Wed, 19 Jul 2023 02:53:44 -0400 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 1qM149-0001JM-O1 for emacs-orgmode@gnu.org; Wed, 19 Jul 2023 02:53:44 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 06BCF240103 for ; Wed, 19 Jul 2023 08:53:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1689749619; bh=/VaZ1UlVLboWfvblR/KnnYt2MRjYVmJG8H2COKz0Mk8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=d+UCtrZmzyn8uJEs266T/dWNMaoBx/X8/la6HnZzlmaakdr0SmpRGi3zGOO4RGMBQ DAWPn6w+Z1GIoJxU6dCPETYw+qGKFyLSj/5OhKj0TvEU0pGc12EYy9ypuRGRsqc0F5 3XMcUzWkzYeovhqK0P6w41Quyq/I6m8SnwBR53gfDXL4gE+VRDJAvMVA7tEQBbBosV +r7IH7r+Op4JX+bxxkNaWfWU0DX4gVw/QpoZRwYoBfgCctZxxZ9RXteKadE5mYIq3V AxnZKbBFk2h7jb5IYtibKag+iusk40SRdv/XGDCEND756CtF0BfMP882xVZPU3bO73 I8r5BvkTyU4Yg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4R5RNy39YMz9rxB; Wed, 19 Jul 2023 08:53:38 +0200 (CEST) From: Ihor Radchenko To: Jens Schmidt Cc: emacs-orgmode@gnu.org Subject: [BUG] Emphasis markers should be considered word constituents (was: [BUG] SPACE jumps to tag in header line after hidden emphasis marker [9.7-pre (release_9.6.7-562-g5b6268 @ /home/jschmidt/work/org-mode/lisp/)]) In-Reply-To: <87ilag1pth.fsf@localhost> References: <8b691a7f-6b62-d573-e5a8-80fac3dc9bc6@vodafonemail.de> <87edl53ae3.fsf@localhost> <87ilag1pth.fsf@localhost> Date: Wed, 19 Jul 2023 06:53:39 +0000 Message-ID: <87edl41jf0.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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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-Spam-Score: -6.53 X-Migadu-Queue-Id: 0270E4925B X-Migadu-Spam-Score: -6.53 X-Migadu-Scanner: mx0.migadu.com X-TUID: lleI8LbAs3JW > Jens Schmidt writes: > ... >> Well, I have one not-so-minor nit here: With that commit you cannot >> insert text *before* some text having hidden emphasis without breaking >> the emphasis. More concretely (in an empty org-mode buffer): >> (setq org-hide-emphasis-markers t) *foo* >> ... >> C- ;; left-word >> SPC ;; org-self-insert-command >> >> The last SPC breaks the emphasis around the middle "test", which it did >> not previously. Previously, the SPC would just move the whole >> emphasized word one space to the right. Which I somehow got used to, >> and probably many others as well. The root cause revealed by my change is that Org mode does not always consider emphasis markers to be word boundaries. Note how when you do not hide emphasis markers, C- will end up in *foo* When emphasis markers are not hidden, things were the same, except that Emacs adjusted point right to sticky invisible text in the direction of point movement, leading to inconsistent behaviour between hiding and not hiding emphasis markers. Yet, Org sometimes does treat emphasis markers as word constituents: At least, `org-fill-element' and `org-transpose-words' temporarily turn emphasis markers into parts of words. The situation is clearly a bit chaotic. One of the reasons why we have such a mess is because *_/~+ are not always representing emphasis. Proper distinction between *_/~+ that are and aren't part of actual emphasis would require a custom `syntax-propertize-function' that would query Org element API to determine the context. Unfortunately, using `syntax-propertize-function' it is not very practical yet. We need parser context down to object level, while we only cache parser state down to element (paragraph) level. So, querying element API in this case will lead to significant performance degradation, with quadratic (N_objects_in_paragraph^2) complexity in some cases. I will leave this bug report open until we have a better caching and can reasonably implement custom `syntax-propertize-function'. Or, if any, please post arguments against making emphasis markers word constituents. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at