summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-08-06 10:31:06 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-08-06 10:31:06 +0200
commita7e11643a93ee04acbae174d49edb75c5cd8f402 (patch)
treeb50af687ae82923f6a45ef194f46b34e969a2f87
parentb4032ed5974439e8b196967b022caf9ba8a388b5 (diff)
parent9974ed39b2b69abdf87b37af9ea1ce46f0e508fe (diff)
downloadorg-mode-a7e11643a93ee04acbae174d49edb75c5cd8f402.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org-src.el3
-rw-r--r--lisp/org.el2
-rw-r--r--testing/lisp/test-org-src.el9
3 files changed, 11 insertions, 3 deletions
diff --git a/lisp/org-src.el b/lisp/org-src.el
index 9f8cb25..fe5ea07 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/lisp/org.el b/lisp/org.el
index ce2c108..9c9df70 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9464,7 +9464,7 @@ Optional argument REGEXP selects variables to clone."
(`(,name . ,value) ;ignore unbound variables
(when (and (not (memq name org-unique-local-variables))
(or (null regexp) (string-match-p regexp (symbol-name name))))
- (set (make-local-variable name) value))))))
+ (ignore-errors (set (make-local-variable name) value)))))))
;;;###autoload
(defun org-run-like-in-org-mode (cmd)
diff --git a/testing/lisp/test-org-src.el b/testing/lisp/test-org-src.el
index 9bf6644..1d683ec 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<point>[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<point>[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