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
> 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
> “\(" and "\)” (or “\(" and "\)”, or…). 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 LaTeX
buffer so they get treated as mathematics instead of text.

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

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.