瀏覽代碼

Merge branch 'maint'

Nicolas Goaziou 7 年之前
父節點
當前提交
a7e11643a9
共有 3 個文件被更改,包括 11 次插入3 次删除
  1. 2 1
      lisp/org-src.el
  2. 1 1
      lisp/org.el
  3. 8 1
      testing/lisp/test-org-src.el

+ 2 - 1
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))
 

+ 1 - 1
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)

+ 8 - 1
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