Hello, Timothy <tecos...@gmail.com> writes:
> Well that didn't quite work as intended. Here's a take two. This doesn't look bad. Thank you. > From 379e23545d7e55766e48b50514bd797bdf691a40 Mon Sep 17 00:00:00 2001 > From: TEC <t...@tecosaur.com> > Date: Sun, 24 May 2020 23:35:33 +0800 > Subject: [PATCH] Extend org-edit-special to editing LaTeX-fragments In the commit message, you need to list functions being modified. See other commits messages for some examples. > + ((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. > + (pp (org-element-property :contents-begin context)) It is a left-over. > + (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'. > (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 ;) Regards, -- Nicolas Goaziou