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 eBzaBP4i82XE7AAAqHPOHw:P1 (envelope-from ) for ; Thu, 14 Mar 2024 17:17:02 +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 eBzaBP4i82XE7AAAqHPOHw (envelope-from ) for ; Thu, 14 Mar 2024 17:17:02 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tu-dresden.de header.s=dkim2022 header.b="C2w/ej1P"; 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=fail reason="SPF not aligned (relaxed)" header.from=tu-dresden.de (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1710433021; 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=C1Uut0bstPW0EJVv6uUyVNyDrplhczlD6cqADvrBpIc=; b=YEpwvqfjSfPUsqLUkjeoIbzJ3sMzfhLAx6Vgl60gL0o62Gxtj6UEdo/WwJXo0bTt6t6hPw b8G80CqDlCbywf7nfusVY/nwI1PkKBvTu99/MWazdmlbIWnT8NR7QyHwc22gZ3XlqZzcOg Dq2KcuGkep6HFcM1upNgHhC6/7z2YXcJQHWFNQb84ukhrmpUV6S508Qx4ApZntDymg7x2g Wqe6Ws5i83rR2rip7+bFV+a20dZrfvCKwlESzDQYxZQuhBkegAlFSUlCptLkC0WwI5HFyZ iBeuf37OhLthXMqUr+ZJHByfIF6kzPR3oLdgS6Es3nO5SCoxMMe3ORLE+E4Cow== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1710433021; a=rsa-sha256; cv=none; b=JqV45tAjsWmdrXymNluEt8/Cgx1WL7Dw1mTPlBxuiX6UFcdI3ArLzB4TWXzlnqG4/ARo90 UYlj1FzHVQecEBXqJCU0C6MDA/11BJco5pNaCwPPl6J2xgIMQRWq+PumnXXGdQpepWTjbV 2sogPf/8msLgJlduclg2aXFYR3hoBHy6qv0yYklx6xFGsn4ev2j+b4MmE9UqhoSS1c6BSY I/F3OUWwOhNaUGy7EBcdSJSpFK4mYLs1ZjOPt8SJgJgvWp9Oj3r0H/nctpKmY+mm/yRlv0 qsAxqqe/AS1/Qff9PwT5te7kJ/9pcIAk8FI2/U2guHz0Pd2mWZ9R+Us5MeeR8g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tu-dresden.de header.s=dkim2022 header.b="C2w/ej1P"; 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=fail reason="SPF not aligned (relaxed)" header.from=tu-dresden.de (policy=none) 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 AA22E730E1 for ; Thu, 14 Mar 2024 17:17:01 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rknkJ-0003pT-Dr; Thu, 14 Mar 2024 12:15:55 -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 1rknkH-0003oH-5T for emacs-orgmode@gnu.org; Thu, 14 Mar 2024 12:15:53 -0400 Received: from mailout3.zih.tu-dresden.de ([141.30.67.74]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rknkE-0004lf-Qe for emacs-orgmode@gnu.org; Thu, 14 Mar 2024 12:15:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tu-dresden.de; s=dkim2022; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=C1Uut0bstPW0EJVv6uUyVNyDrplhczlD6cqADvrBpIc=; b=C2w/ej1Pl72k7052gsTdI7/ooH Ikte1qSSDqRl8ffX5JO63lc78QTOuUTrCyfdpXpaeOSe92ADMgbH2NPaVfxP+0Icrf2Q1HaFqjWRr 8u86eiPM+6QQbVt9HgL5kwr0OJB6jgpigwk2mzSEertLxPNbEoMRUngheoHQ5ZZOkDCCaOR29EVXe J85xnt1levLLZQq7YT1Z6WWpJa1tRsslVzBAealAD4VnVLCtdLCkh9TERkYy+BN9B+d2lBEPQVaNa jW1TTw7A7VzSvD4G/rWDphjzfrmUClTB8cJgzuq6J+WeQnIy7Wwrss9Jl7DpnrIi5yU5mke7DDLB/ Z0pS90lg==; Received: from [172.26.34.120] (helo=msx.tu-dresden.de) by mailout3.zih.tu-dresden.de with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rknkC-00Fu5O-OT; Thu, 14 Mar 2024 17:15:49 +0100 Received: from comonad (77.23.150.207) by msx-l320.msx.ad.zih.tu-dresden.de (172.26.34.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 14 Mar 2024 17:15:34 +0100 From: Tony Zorman To: Ihor Radchenko CC: Subject: Re: The org--math-p advice around texmathp In-Reply-To: <87r0gewanm.fsf@localhost> References: <878r2r5h1b.fsf@hyperspace> <87r0gewanm.fsf@localhost> User-Agent: Notmuch/0.38.3, Emacs 30.0.50 Date: Thu, 14 Mar 2024 17:15:32 +0100 Message-ID: <8734ssu6vv.fsf@hyperspace> MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: MSX-L315.msx.ad.zih.tu-dresden.de (172.26.34.115) To msx-l320.msx.ad.zih.tu-dresden.de (172.26.34.120) X-TUD-Virus-Scanned: mailout3.zih.tu-dresden.de Received-SPF: pass client-ip=141.30.67.74; envelope-from=tony.zorman@tu-dresden.de; helo=mailout3.zih.tu-dresden.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, 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: 0.10 X-Spam-Score: 0.10 X-Migadu-Queue-Id: AA22E730E1 X-Migadu-Scanner: mx11.migadu.com X-TUID: a3XqNUtIhxuO On Wed, Mar 13 2024 12:58, Ihor Radchenko wrote: > 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. But isn't what Org calls LaTeX math pretty equivalent to what would count as the same in a LaTeX buffer? From a quick scan of texmathp.el, I couldn't actually see a hard-dependency on a TeX-derived mode at all. I wouldn't really care about this so much, but the fact that the Org variant just misreports the position is a bit unfortunate, in my opinion. Tony -- Tony Zorman | https://tony-zorman.com/