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

In emacs_version(): NAs introduced by coercion #689

Closed
charmoniumQ opened this issue Apr 24, 2024 · 1 comment · Fixed by #720
Closed

In emacs_version(): NAs introduced by coercion #689

charmoniumQ opened this issue Apr 24, 2024 · 1 comment · Fixed by #720
Labels
bug an unexpected problem or unintended behavior tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day

Comments

@charmoniumQ
Copy link

> cli::num_ansi_colors()
[1] 256
Warning message:
In emacs_version() : NAs introduced by coercion
>

I've determined this is because emacs_version expects INSIDE_EMACS to be some kind of version string, but Emacs vterm sets INSIDE_EMACS to vterm.

Should we special case vterm in emacs_version?

@gaborcsardi
Copy link
Member

Well, that is a pretty nasty thing to do, I would say. They really should not do that. Now how are we supposed to determine the Emacs version?

Emacs sets the environment variable INSIDE_EMACS in the subshell to
‘version,comint’, where version is the Emacs version (e.g., ‘28.1’). Programs
can check this variable to determine whether they are running inside an Emacs
subshell.

https://www.gnu.org/software/emacs/manual/html_node/emacs/Interactive-Shell.html

In any case, I don't think we need to special case it, we can just return NA_integer_ if it is not a version number, and get rid of the warning. Would you like to submit a PR? (No pressure, really.)

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Jun 20, 2024
@gaborcsardi gaborcsardi added the tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day label Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants