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

man node produces warnings on macOS #18434

Closed
silverwind opened this issue Jan 29, 2018 · 9 comments
Closed

man node produces warnings on macOS #18434

silverwind opened this issue Jan 29, 2018 · 9 comments
Labels
doc Issues and PRs related to the documentations.

Comments

@silverwind
Copy link
Contributor

silverwind commented Jan 29, 2018

On macOS 10.13.3 with node 9.4.0, I get these warnings printed after opening and closing node's manpage via man node and q:

`R' is a string (producing the registered sign), not a macro.
`R' is a string (producing the registered sign), not a macro.

Versions of tools involved in man processing:

# groff --version
GNU troff (groff) version 1.19.2
GNU grops (groff) version 1.19.2
@silverwind
Copy link
Contributor Author

silverwind commented Jan 29, 2018

I think this is because of the two .Rs introduced here, but not sure what do do about them.

@silverwind silverwind changed the title man node produces warnings man node produces warnings on macOS Jan 29, 2018
@silverwind silverwind added the doc Issues and PRs related to the documentations. label Jan 29, 2018
@addaleax
Copy link
Member

/cc @ebraminio @Fishrock123

@ebraminio
Copy link
Contributor

:( no idea about the archaic markup honestly but will have a look. Thanks for raising the issue and CCing me.

@silverwind
Copy link
Contributor Author

silverwind commented Jan 29, 2018

👍 if it helps, troff 1.22.3 on Linux seems unaffected by this. Also the specific section with the .R renders fine on both macOS and Linux for me.

@bnoordhuis
Copy link
Member

It's the .R tags that commit introduces. Whether or not it generates warnings depends on whether the system's mandoc macro package defines it.

diff --git a/doc/node.1 b/doc/node.1
index a4395c099b..836b901bea 100644
--- a/doc/node.1
+++ b/doc/node.1
@@ -37,9 +37,9 @@ node \- Server-side JavaScript runtime
 .RI [ script.js \ |
 .B -e
 .RI \&" script \&"
-.R |
+.RI |
 .B -
-.R ]
+.RI ]
 .B [--]
 .RI [ arguments ]
 .br

@silverwind
Copy link
Contributor Author

Thanks ben, that patch supresses the warnings for me.

@silverwind
Copy link
Contributor Author

#18440

@Alhadis
Copy link
Contributor

Alhadis commented Feb 3, 2018

In Roff, a string register can be expanded using the same syntax for invoking a macro or function call:

.ds JS "JavaScript"  \" Define string `JS`
.as JS " kicks ass!" \" Append to string `JS`
.
.JS \" Outputs "JavaScript kicks ass!"

Macros/functions operate in a similar fashion:

.\" Define macro named `JS`
.de JS
JavaScript \\$1 \\$2
..
.
.JS kicks ass!

The former usage is rare; in almost all cases, Roff authors will use the following syntax for expanding a string:

\*X     \" Expands string with 1-letter name X
\*(XY   \" Expands string with 2-letter name XY
\*[XYZ] \" Expands string with variable-length name (GNU extension)

Now, it's pretty silly to have a macro that applies the default font, which is why .R warns the user when it detects it's been called as a macro. Here's the macro's actual definition in an.tmac:

.de1 R
\c
.  ie \\n[.$] \{\                                                                                                                                                                                                  
.    tm `R' is a string (producing the registered sign), not a macro.
.    nop \\$*
.  \}
.  el \{\                                                                                                                                                                                                          
.    ie c\[rg] \                                                                                                                                                                                                   
.      nop \[rg]\c
.    el \                                                                                                                                                                                                          
.      nop (Reg.)\c
.  \}
..

And here's the macro's rough approximation in JavaScript:

function R (...args) {
	if (arguments.length) {
		console.warn("`R' is a string (producing the registered sign), not a macro.");
		process.stdout.write(...args);
	}
	else {
		if(characters.has("RG"))
			process.stdout.write(characters.get("RG"));
		else
			process.stdout.write("(Reg.)");
	}
}

@silverwind
Copy link
Contributor Author

It might be a good idea run man ./doc/node.1 > /dev/null during our linter tests and verify that it doesn't print any warnings on stderr (exit code is 0, even with warnings present).

MylesBorins pushed a commit that referenced this issue Feb 20, 2018
Fixes: #18434
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 21, 2018
Fixes: #18434
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 21, 2018
Fixes: #18434
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
MylesBorins pushed a commit that referenced this issue Mar 20, 2018
Fixes: #18434
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
MylesBorins pushed a commit that referenced this issue Mar 28, 2018
Fixes: #18434
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
MylesBorins pushed a commit that referenced this issue Mar 30, 2018
Fixes: #18434
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
MayaLekova pushed a commit to MayaLekova/node that referenced this issue May 8, 2018
Fixes: nodejs#18434
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants