diff --git a/lisp/org.el b/lisp/org.el index be1d1c701..339418314 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -17702,7 +17702,7 @@ a timestamp or a link, call `org-open-at-point'. However, it will not happen if point is in a table or on a \"dead\" object (e.g., within a comment). In these case, you need to use `org-open-at-point' directly." - (interactive "*i\nP\np") + (interactive "i\nP\np") (let ((context (if org-return-follows-link (org-element-context) (org-element-at-point)))) (cond diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index a0f505cbc..98d7abf4a 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -1216,6 +1216,15 @@ (org-link-search-must-match-exact-headline nil)) (org-return)) (looking-at-p "<>"))) + ;; Non-nil `org-return-follows-link' ignores read-only state of + ;; a buffer. + (should + (org-test-with-temp-text "Link [[target]] <>" + (let ((org-return-follows-link t) + (org-link-search-must-match-exact-headline nil)) + (setq buffer-read-only t) + (org-return)) + (looking-at-p "<>"))) ;; `org-return-follows-link' handle multi-line lines. (should (org-test-with-temp-text