From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 4O2tC1why17zTQAA0tVLHw (envelope-from ) for ; Mon, 25 May 2020 01:37:32 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id wPuMB1why17UQAAAB5/wlQ (envelope-from ) for ; Mon, 25 May 2020 01:37:32 +0000 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 807D4940C01 for ; Mon, 25 May 2020 01:37:31 +0000 (UTC) Received: from localhost ([::1]:40808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jd23V-0000ae-0r for larch@yhetil.org; Sun, 24 May 2020 21:37:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jd239-0000aR-NK for emacs-orgmode@gnu.org; Sun, 24 May 2020 21:37:07 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:55897) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jd238-0002Eq-PV; Sun, 24 May 2020 21:37:07 -0400 Received: by mail-pj1-x102d.google.com with SMTP id fs4so932824pjb.5; Sun, 24 May 2020 18:37:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:references:user-agent:in-reply-to :message-id:mime-version; bh=eC3jHSURqUQfJ89s8yEVZR6Ii5hvggWz+8OkRylZAZY=; b=P17PjYCLIvqrarNGVtjl+7KkQjrg4w6jolXJa0aPD+8ZUwLH5nizQ6P+sG6UXSoUK3 pUe4NxW4NPrlfRNDVU+D4YghjmeKeREfKtXBldLN8VBc75ZFZHVchAHAOcwzJpy7MnaV 0+p2nMZn7Y3EvdAPWdchLsOZAO0YXbPOKduKWv7JGNzuyMBVBC0JhoClbH6Pl77nqXB/ mzX11/Kukao37PtUQ6DnmFAtNjk9YSqYG0HcAqCPVjomyr80h6sLoSZTp7VO15nUycoT /K44B8a+ZewXGcV+8mdhPhs0Cq3uEJADqUBEHZ7JA3xTZBvlpH1Lkp6qLob0S4PHt52R 6sIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:references:user-agent :in-reply-to:message-id:mime-version; bh=eC3jHSURqUQfJ89s8yEVZR6Ii5hvggWz+8OkRylZAZY=; b=PYEfmVgFAOKV1eJHujNZfWgm+5dRPh81Dsg7wfqT6bqq9fhKumd2X18o2oi+yi7ZVI we5SunXukVgMZYSG6O143XDcdRhRdN3Y6c+Y6VNgdC8OsYA07Hw1SW/yYU+/gIk3sjcO 3isxha9QCTioJ0UwvRzFUdqrGxIw/8pwnFlSD/O4wFwStFyuuH8k0E7JBLnfYzRrBezB sSGfM5o/xFLkfl+6x82ua068Vg2Be/J1W60KJxd8fvvKMVrsRncM0LrZeWVn0sR/7fyM hM4aNPB+mnttSQydRa0BqvzbTxSCJX/66S8zL98CndVvonne1Q3fiWmUGI+fNIRyCfVI kvgw== X-Gm-Message-State: AOAM530XEqhAqq6T4zLwr02A+93Vq7gLCscSIAqvygu6JvUIE9pYY2Is sGbHiFd2prLBc1rNEd7Cz+k3Xss2FIc= X-Google-Smtp-Source: ABdhPJz5S7fFp91+keY6hHwzDtqmgXBeZ+39lhkqi2pcrck4RfxGjHAo+J9Y0p+DCew/1Rybukustw== X-Received: by 2002:a17:902:445:: with SMTP id 63mr9395194ple.206.1590370624411; Sun, 24 May 2020 18:37:04 -0700 (PDT) Received: from localhost (180-150-91-8.b4965b.per.nbn.aussiebb.net. [180.150.91.8]) by smtp.gmail.com with ESMTPSA id gv4sm11492452pjb.6.2020.05.24.18.37.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:37:03 -0700 (PDT) From: TEC To: Nicolas Goaziou Subject: Re: (Feature Request) have org-edit-special work inside non-environment LaTeX blocks, i.e. \( \) and \[ \] Date: Mon, 25 May 2020 09:33:51 +0800 References: <87zh9xxrww.fsf@gmail.com> <4274FCF8-5304-4B55-9586-0C718DA388D3@getmailspring.com> <87r1v9ceml.fsf@nicolasgoaziou.fr> User-agent: mu4e 1.4.6; emacs 26.3 In-reply-to: <87r1v9ceml.fsf@nicolasgoaziou.fr> Message-ID: <87lflgyev8.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=tecosaur@gmail.com; helo=mail-pj1-x102d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bastien , "emacs-orgmode@gnu.org" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=P17PjYCL; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: eptPdrR5LN5x --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable =20 Nicolas Goaziou writes:=20 =20 > Hello,=20 >=20 > Timothy writes:=20 >=20 >> Well that didn't quite work as intended. Here's a take two.=20 >=20 > This doesn't look bad. Thank you.=20 =20 > In the commit message, you need to list functions being=20 > modified. See other commits messages for some examples. I'll patch my patch :P=20 =20 >> + ((eq type 'latex-fragment) + (let ((beg=20 >> (org-element-property :begin datum)) + (end=20 >> (org-element-property :end datum))) + (list beg end=20 >> (buffer-substring-no-properties beg end))))=20 >=20 > These are not correct buffer positions. BEG and END should be=20 > between "\(" and "\)" (or "$" and "$", or=E2=80=A6). See, in the same=20 > function, how inline source blocks are handled. I thought that too initially. The think is you actually want them=20 in the LaTeX buffer so they get treated as mathematics instead of=20 text.=20 =20 >> + (org-src--edit-element + context +=20 >> (org-src--construct-edit-buffer-name (buffer-name) "LaTeX=20 >> fragment") + (org-src-get-lang-mode "latex") + t) +=20 >> t))=20 >=20 > You also need to put read-only property on fragment markers, and=20 > remove any blank line as the final step. See=20 > `org-edit-footnote-reference'.=20 I'll take a look :) =20 >> (pcase (org-element-type context) (`footnote-reference=20 >> (org-edit-footnote-reference)) (`inline-src-block=20 >> (org-edit-inline-src-code))=20 >> + (`latex-fragment (org-edit-latex-fragment))=20 >=20 > This line is perfect ;) I must have had great inspiration for it ;-) Regards, Timothy. --=-=-= Content-Type: multipart/related; boundary="==-=-=" --==-=-= Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Timothy <tecosaur@gmail.com> writes:
>
>> Well that didn’t quite work as intended. Here’s a take= two.
>
> This doesn’t look bad. Thank you.

> In the commit message, you need to list functions being modified. See<= br /> > other commits messages for some examples.

I’ll patch my patch :P

>> + ((eq type ’latex-fragment)
>> + (let ((beg (org-element-property :begin datum))
>> + (end (org-element-property :end datum)))
>> + (list beg end (buffer-substring-no-properties beg end))))
>
> These are not correct buffer positions. BEG and END should be between<= br /> > “\(" and "\)” (or “\(" and "\)”, or=E2=80=A6).= See, in the same function, how
> inline source blocks are handled.

I thought that too initially. The think is you actually want them in the La= TeX
buffer so they get treated as mathematics instead of text.

>> + (org-src–edit-element
>> + context
>> + (org-src–construct-edit-buffer-name (buffer-name) &ld= quo;LaTeX fragment”)
>> + (org-src-get-lang-mode “latex”)
>> + t)
>> + t))
>
> You also need to put read-only property on fragment markers, and remov= e
> any blank line as the final step. See `org-edit-footnote-reference&rsq= uo;.

I’ll take a look :)

>> (pcase (org-element-type context)
>> (`footnote-reference (org-edit-footnote-reference))
>> (`inline-src-block (org-edit-inline-src-code))
>> + (`latex-fragment (org-edit-latex-fragment))
>
> This line is perfect ;)

I must have had great inspiration for it ;-)

Regards,

Timothy.

--==-=-=-- --=-=-=--