From 9974ed39b2b69abdf87b37af9ea1ce46f0e508fe Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 6 Aug 2017 10:27:52 +0200 Subject: [PATCH] org-src: Fix remote footnote edition * lisp/org-src.el (org-edit-footnote-reference): Clone local variables in remote editing buffer. * testing/lisp/test-org-src.el (test-org-src/footnote-references): Add test. --- lisp/org-src.el | 3 ++- testing/lisp/test-org-src.el | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/org-src.el b/lisp/org-src.el index 0e04d4b5a..6b5b5ff0c 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -850,7 +850,8 @@ A coderef format regexp can only match at the end of a line." (when (org-element-lineage definition '(table-cell)) (while (search-forward "\n" nil t) (replace-match ""))))) contents - 'remote)) + 'remote) + (org-clone-local-variables (org-src--source-buffer))) ;; Report success. t)) diff --git a/testing/lisp/test-org-src.el b/testing/lisp/test-org-src.el index 9bf6644ad..1d683ec9c 100644 --- a/testing/lisp/test-org-src.el +++ b/testing/lisp/test-org-src.el @@ -434,7 +434,14 @@ This is a tab:\t. (org-test-with-temp-text "An inline[fn:1] footnote[fn:1:definition] and some text" (org-edit-special) - (prog1 (buffer-string) (org-edit-src-exit)))))) + (prog1 (buffer-string) (org-edit-src-exit))))) + ;; Preserve local variables when editing a footnote definition. + (should + (eq 'bar + (org-test-with-temp-text "A footnote[fn:1]\n[fn:1] Definition" + (setq-local foo 'bar) + (org-edit-special) + (prog1 foo (org-edit-src-exit)))))) (provide 'test-org-src) ;;; test-org-src.el ends here