From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id +MZPLZmi8WVJDQEAqHPOHw:P1 (envelope-from ) for ; Wed, 13 Mar 2024 13:56:57 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id +MZPLZmi8WVJDQEAqHPOHw (envelope-from ) for ; Wed, 13 Mar 2024 13:56:57 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=gGvdhIc9; 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=1710334531; 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=ueFcahP0ep3eBSvyzndiTP+QTKJZHqbWY1ZsS56vo68=; b=snvfpaBLqNg3IHYQLKT01qYqigsgAdn8ifi05WLW2TsHVgwrLnU37P5OGcMOrWuzAB25GR PNGY6Cf8tIq6tAEwUSWrqmqiViCK3V9trM1r3TLZ3HmWQDEUDRNyRmnL3BlKM3v2UsgUcg 0OcREZ7r8GGMxGM2tvcuZ63AkEiJiuUExwKvuAw11IhYBJBf08rYALsFKjzqLGfQbj1ElY Xl5mAp66AE9H+5ZNCE/VVsafLIJAp9p8Xizm+mN0kkI5T4RUJX5vDJ13VWb94rrCb5TJI5 Xhi7JrdCzHorKc9F8T0fLmW3zYt8MyAodcV6RbgLsfPyMRZDwDCpcBZCZvx63g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1710334531; a=rsa-sha256; cv=none; b=Pon2DhNfq0czKW3yF4INo3UcMewF//6au8HNh1DeZ8nAQm6xReSCPzCZvodHRjU8dspNlL FH+qmCcVRXuLPGXYPxcRYULkMx2ZLycGqJVQlkKjDTRkznbOe88kjLT5bTK4NtkwVxXa3S WQWExAKWo2e659eIETAf4hM7c9BrjUFIhWxQqBzzpbQ63OPRV8v6HRn6DwrkpFZ8f66Xjb KUtQ584p3EfJFrkL0+TpVPny+cbVVbrZSxk/ldVODkk9ZNHuMHKepGBswS9HtUkMzRXllx YLeQvo6LvsFgtyE9WJcw0h74YYIiEDerRJsAIWoC77vATb61IRWjhy2/rGT1eQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=gGvdhIc9; 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 E62AF5BCA2 for ; Wed, 13 Mar 2024 13:55:31 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rkO89-0002kP-Vj; Wed, 13 Mar 2024 08:54:50 -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 1rkO87-0002jc-ID for emacs-orgmode@gnu.org; Wed, 13 Mar 2024 08:54:47 -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 1rkO85-00034y-3F for emacs-orgmode@gnu.org; Wed, 13 Mar 2024 08:54:46 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 1FD53240103 for ; Wed, 13 Mar 2024 13:54:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1710334482; bh=t9UGHhLJ1nBVjfzi9TEAHMc9Fv1xyKLvld3bjUtQkys=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=gGvdhIc9pWMHL/EdGgdffRgEBLuw2i5eEahCxl2SgKv3nurYO4k9zFuzMJHP2Ulxp gyy8FKUkcrSNcrO12A9ce4RWPcMwcM3Zsao04etyjggYRj9NWiZZqar0YN+E5r3nkE D97xPJyyF9g/SLKspbis498HWjAMqNowCILM9YkupXgOPfgFIf34dxtG6/qZ1J3rFq XrD3rMZ+J5Zx8Q6awBRpa1IcQdRlJ0PgF4FcM2Llqi+Ew1ZjyX7V78tFHs5I9ZIg82 YBbn+3NjV1AQ59FudmZgmublWMp8igmzuO8JB06+ihM/b2UDq9wGx1QVneY3dSm7/D qO53/xmanicVQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Tvr7j0HN3z6tvm; Wed, 13 Mar 2024 13:54:40 +0100 (CET) From: Ihor Radchenko To: Tony Zorman Cc: emacs-orgmode@gnu.org Subject: Re: The org--math-p advice around texmathp In-Reply-To: <878r2r5h1b.fsf@hyperspace> References: <878r2r5h1b.fsf@hyperspace> Date: Wed, 13 Mar 2024 12:58:53 +0000 Message-ID: <87r0gewanm.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_H4=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-Migadu-Spam-Score: -6.49 X-Spam-Score: -6.49 X-Migadu-Queue-Id: E62AF5BCA2 X-Migadu-Scanner: mx11.migadu.com X-TUID: gK0TZfLKFJyr Tony Zorman writes: > I recently stumbled upon the fact that Org has some around advice for > texmathp: org--math-p. For reasons that aren't entirely clear to me, > this has some special handling for cdlatex-math-symbol, and recognises > display and inline maths environments on its own, only calling out to > texmathp if it could not find anything. In the former cases, it also > populates the texmathp-why variable, although the position is just > filled in with 0. > > I suppose my succinct question is: why? Is there any advantage in > handling inline and display maths in this way, only deferring to > texmathp as a last resort? I'm asking because I wrote a small package to > switch between environments, and the position information that > texmathp-why provides is very useful in choosing the closest > environment. Because Org mode syntax is not LaTeX and `texmathp' assumes that we are inside LaTeX buffer. So, we first check using Org syntax whether the point is inside latex fragment in Org sense. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at