From: Nicolas Goaziou Date: Tue, 4 Dec 2012 22:50:26 +0000 (+0100) Subject: Fix radio targets detection X-Git-Tag: release_8.0-pre~762 X-Git-Url: https://repo.or.cz/w/org-mode.git/commitdiff_plain/31052f1c912e866b2e651721bc3145686512cc69 Fix radio targets detection * lisp/org.el (org-all-targets): Fix radio targets detection when object is directly followed by a non-whitespace character. * testing/lisp/test-org.el: Add test. --- diff --git a/lisp/org.el b/lisp/org.el index e3050b90c..c4a006ba3 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5793,6 +5793,8 @@ targets." (save-excursion (goto-char (point-min)) (while (re-search-forward re nil t) + ;; Make sure point is really within the object. + (backward-char) (let ((obj (org-element-context))) (when (memq (org-element-type obj) '(radio-target target)) (add-to-list 'rtn (downcase (org-element-property :value obj)))))) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index 05ba88974..443a253ad 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -878,6 +878,9 @@ Text. (equal '("radio-target" "target") (org-test-with-temp-text "<> <<>>\n: <>" (org-all-targets)))) + (should + (equal '("radio-target") + (org-test-with-temp-text "<<>>!" (org-all-targets)))) ;; With argument. (should (equal '("radio-target")