org-lint: Do not warn about URL setup files
* lisp/org-lint.el (org-lint-non-existent-setupfile-parameter): Do not warn when setup file is a URL. * testing/lisp/test-org-lint.el (test-org-lint/non-existent-setupfile-parameter): Add test. Reported-by: Dominik Schrempf <dominik.schrempf@gmail.com> <http://lists.gnu.org/r/emacs-orgmode/2019-03/msg00169.html>
This commit is contained in:
parent
ba99d76a4f
commit
0007df863d
|
@ -574,12 +574,13 @@ Use :header-args: instead"
|
||||||
(lambda (k)
|
(lambda (k)
|
||||||
(when (equal (org-element-property :key k) "SETUPFILE")
|
(when (equal (org-element-property :key k) "SETUPFILE")
|
||||||
(let ((file (org-unbracket-string
|
(let ((file (org-unbracket-string
|
||||||
"\"" "\""
|
"\"" "\""
|
||||||
(org-element-property :value k))))
|
(org-element-property :value k))))
|
||||||
(and (not (file-remote-p file))
|
(and (not (org-file-url-p file))
|
||||||
|
(not (file-remote-p file))
|
||||||
(not (file-exists-p file))
|
(not (file-exists-p file))
|
||||||
(list (org-element-property :begin k)
|
(list (org-element-property :begin k)
|
||||||
(format "Non-existent setup file \"%s\"" file))))))))
|
(format "Non-existent setup file %S" file))))))))
|
||||||
|
|
||||||
(defun org-lint-wrong-include-link-parameter (ast)
|
(defun org-lint-wrong-include-link-parameter (ast)
|
||||||
(org-element-map ast 'keyword
|
(org-element-map ast 'keyword
|
||||||
|
|
|
@ -240,6 +240,9 @@ This is not a node property
|
||||||
"Test `org-lint-non-existent-setupfile-parameter' checker."
|
"Test `org-lint-non-existent-setupfile-parameter' checker."
|
||||||
(should
|
(should
|
||||||
(org-test-with-temp-text "#+setupfile: Idonotexist.org"
|
(org-test-with-temp-text "#+setupfile: Idonotexist.org"
|
||||||
|
(org-lint '(non-existent-setupfile-parameter))))
|
||||||
|
(should-not
|
||||||
|
(org-test-with-temp-text "#+setupfile: https://I.do/not.exist.org"
|
||||||
(org-lint '(non-existent-setupfile-parameter)))))
|
(org-lint '(non-existent-setupfile-parameter)))))
|
||||||
|
|
||||||
(ert-deftest test-org-lint/wrong-include-link-parameter ()
|
(ert-deftest test-org-lint/wrong-include-link-parameter ()
|
||||||
|
|
Loading…
Reference in New Issue