Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove code needed for old R versions #2759

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

lgibson7
Copy link
Contributor

Closes #2706 .

@hadley hadley merged commit 0f565db into r-lib:main Aug 19, 2024
16 checks passed
@hadley
Copy link
Member

hadley commented Aug 19, 2024

PRs that delete code are my favourite type of PRs 😄 Thank you!

@lgibson7
Copy link
Contributor Author

No worries. Thanks Hadley.

@lgibson7 lgibson7 deleted the remove-old-R-versions branch August 19, 2024 17:17
@bastistician
Copy link
Contributor

Came here after checking what has changed in the new release. The code removal in rd_file() looks dangerous:

 rd_file <- function(path, pkg_path = NULL) {
-  if (getRversion() >= "3.4.0") {
-    macros <- tools::loadPkgRdMacros(pkg_path)
-    set_classes(tools::parse_Rd(path, macros = macros, encoding = "UTF-8"))
-  } else if (getRversion() >= "3.2.0") {
-    macros <- tools::loadPkgRdMacros(pkg_path, TRUE)
-    set_classes(tools::parse_Rd(path, macros = macros, encoding = "UTF-8"))
-  } else {
-    set_classes(tools::parse_Rd(path, encoding = "UTF-8"))
-  }
+  set_classes(tools::parse_Rd(path, encoding = "UTF-8"))
 }

This means that the package's own Rd macros are no longer loaded. So I just tried and indeed, rebuilding a site for such a package now gives plenty of "unknown macro" warnings ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove code needed for old R versions
3 participants