From bf1d45f9bad194fb9a45eb1d6573fe15622f8315 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sun, 17 Dec 2023 12:12:52 +0100 Subject: [PATCH] org-lint: Remove checker for #+name with colon * lisp/org-lint.el (org-lint-colon-in-name): (colon-in-name): Remove the checker. It is no longer a problem after b5cfc311d that allows referring to named elements with name containing colon. * testing/lisp/test-org-lint.el (test-org-lint/colon-in-name): Remove test. --- lisp/org-lint.el | 20 -------------------- testing/lisp/test-org-lint.el | 9 --------- 2 files changed, 29 deletions(-) diff --git a/lisp/org-lint.el b/lisp/org-lint.el index 37a3dae2e..f68aeab01 100644 --- a/lisp/org-lint.el +++ b/lisp/org-lint.el @@ -958,21 +958,6 @@ Use \"export %s\" instead" (format "No reference for footnote definition [%s]" label)))))))) -(defun org-lint-colon-in-name (ast) - (org-element-map ast org-element-all-elements - (lambda (e) - (let ((name (org-element-property :name e))) - (and name - (string-match-p ":" name) - (list (progn - (goto-char (org-element-begin e)) - (re-search-forward - (format "^[ \t]*#\\+\\w+: +%s *$" (regexp-quote name))) - (match-beginning 0)) - (format - "Name \"%s\" contains a colon; Babel cannot use it as input" - name))))))) - (defun org-lint-mismatched-planning-repeaters (ast) (org-element-map ast 'planning (lambda (e) @@ -1528,11 +1513,6 @@ AST is the buffer parse tree." #'org-lint-invalid-babel-call-block :categories '(babel)) -(org-lint-add-checker 'colon-in-name - "Report NAME values with a colon" - #'org-lint-colon-in-name - :categories '(babel)) - (org-lint-add-checker 'wrong-header-argument "Report wrong babel headers" #'org-lint-wrong-header-argument diff --git a/testing/lisp/test-org-lint.el b/testing/lisp/test-org-lint.el index f61b8647c..dd22fa682 100644 --- a/testing/lisp/test-org-lint.el +++ b/testing/lisp/test-org-lint.el @@ -397,15 +397,6 @@ This is not a node property (org-test-with-temp-text "Text[fn:1]\n[fn:1] Definition" (org-lint '(unreferenced-footnote-definition))))) -(ert-deftest test-org-lint/colon-in-name () - "Test `org-lint-colon-in-name' checker." - (should - (org-test-with-temp-text "#+name: tab:name\n| a |" - (org-lint '(colon-in-name)))) - (should-not - (org-test-with-temp-text "#+name: name\n| a |" - (org-lint '(colon-in-name))))) - (ert-deftest test-org-lint/mismatched-planning-repeaters () "Test `org-lint-mismatched-planning-repeaters' checker." (should