瀏覽代碼

org-export: Make BIND keywords case insensitive

* contrib/lisp/org-export.el (org-export--install-letbind-maybe): Make
  BIND keywords case insensitive.
* testing/lisp/test-org-export.el: Add test.
Nicolas Goaziou 12 年之前
父節點
當前提交
7ce732b294
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 1 1
      contrib/lisp/org-export.el
  2. 7 1
      testing/lisp/test-org-export.el

+ 1 - 1
contrib/lisp/org-export.el

@@ -1546,7 +1546,7 @@ possible security risks."
   "Install the values from #+BIND lines as local variables.
 Variables must be installed before in-buffer options are
 retrieved."
-  (let (letbind pair)
+  (let ((case-fold-search t) letbind pair)
     (org-with-wide-buffer
      (goto-char (point-min))
      (while (re-search-forward "^[ \t]*#\\+BIND:" nil t)

+ 7 - 1
testing/lisp/test-org-export.el

@@ -88,7 +88,13 @@ already filled in `info'."
      (let ((org-export-allow-BIND 'confirm))
        (org-set-local 'org-export--allow-BIND-local nil)
        (org-export--install-letbind-maybe)
-       (boundp 'variable)))))
+       (boundp 'variable))))
+  ;; BIND keywords are case-insensitive.
+  (should
+   (org-test-with-temp-text "#+bind: variable value"
+     (let ((org-export-allow-BIND t))
+       (org-export--install-letbind-maybe)
+       (eq variable 'value)))))
 
 (ert-deftest test-org-export/parse-option-keyword ()
   "Test reading all standard #+OPTIONS: items."