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

Use \term and \defnx more correctly and consistently #980

Closed
wants to merge 4 commits into from

Conversation

Eelis
Copy link
Contributor

@Eelis Eelis commented Nov 11, 2016

No visual difference in the PDF.

@Eelis
Copy link
Contributor Author

Eelis commented Nov 11, 2016

Please hold, spotted a few more

@Eelis Eelis force-pushed the defterm branch 2 times, most recently from 7bc1bd1 to d05fde0 Compare November 11, 2016 16:53
@Eelis
Copy link
Contributor Author

Eelis commented Nov 11, 2016

Added a commit that also fixes abuse of \term for things that are not terms at all.

Only visual difference now is erasure of some inappropriate trailing whitespace resulting from the fact that in addition to making text italic, \term also includes a trailing \xspace.

@zygoloid
Copy link
Member

Looks good other than that we would prefer the more semantic \placeholder be used rather than \textit in the incorrect uses of \term for placeholders.

@Eelis
Copy link
Contributor Author

Eelis commented Nov 12, 2016

Ah, thanks for the review, will fix (and rebase).

@Eelis
Copy link
Contributor Author

Eelis commented Nov 12, 2016

Fixed and rebased. (Still no visual difference apart from the trailing whitespace.)

@Eelis
Copy link
Contributor Author

Eelis commented Nov 12, 2016

Bleh, missed a few, so not completely fixed yet

@Eelis Eelis changed the title Replace \indextext + \term pairs with \defnx (or \defn). Use \defnx, \placeholder, \term, and \cv where appropriate. Nov 12, 2016
@Eelis
Copy link
Contributor Author

Eelis commented Nov 12, 2016

Added fixes for a whole bunch more occurrences

always be extended to an order that does include lock and unlock operations, since the
ordering between those is already included in the ``happens before'' ordering. \end{note}

\pnum
For an atomic operation \textit{B} that reads the value of an atomic object \textit{M},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry to be a complete pain, but in view of Issue #1060, could we please hold off on ripping out \textit everywhere for now? I'd prefer if one commit could focus on one change, namely getting rid of \term. If that happens to introduce a few \placeholders, that's fine, but let's not introduce them for unrelated reasons.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah no worries, I'm glad to hear there's coherent plans being formed for the use of all these things going forward. :) I'll split out the \term stuff tonight, cheers!

@jensmaurer
Copy link
Member

Sorry, hadn't noticed this before. #1061 and #1062 as well as #1060 might conflict.

@Eelis Eelis changed the title Use \defnx, \placeholder, \term, and \cv where appropriate. Use \term more correctly and consistently Nov 17, 2016
@Eelis Eelis changed the title Use \term more correctly and consistently Use \term/\defnx more correctly and consistently Nov 17, 2016
@Eelis Eelis changed the title Use \term/\defnx more correctly and consistently Use \term and \defnx more correctly and consistently Nov 17, 2016
@Eelis
Copy link
Contributor Author

Eelis commented Nov 17, 2016

All right, I've split it up more, and now it only uses \placeholder to replace bad uses of \term, leaving other \textit occurrences alone (apart from those that should be \terms).

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 17, 2016

@jensmaurer: As the standing expert on all things \term, could you please review this PR?

the \term{literal} \term{L} is treated as a call of the form
Otherwise, \placeholder{S} shall contain a raw literal operator or a literal operator
template~(\ref{over.literal}) but not both. If \placeholder{S} contains a raw literal operator,
the \placeholder{literal} \placeholder{L} is treated as a call of the form

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\term{literal} should be \grammarterm{literal}, not \placeholder

static const @\placeholder{enumerated C0}@ (@\placeholder{V0}@);
static const @\placeholder{enumerated C1}@ (@\placeholder{V1}@);
static const @\placeholder{enumerated C2}@ (@\placeholder{V2}@);
static const @\placeholder{enumerated C3}@ (@\placeholder{V3}@);
.....
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are two distinct placeholders. Please try separating them (i.e. have two \placeholder's next to each other). Does that impair the spacing?

constexpr @\placeholder{bitmask C0}@(@\placeholder{V0}{}@);
constexpr @\placeholder{bitmask C1}@(@\placeholder{V1}{}@);
constexpr @\placeholder{bitmask C2}@(@\placeholder{V2}{}@);
constexpr @\placeholder{bitmask C3}@(@\placeholder{V3}{}@);
.....
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here: two \placeholders, once for each meta-variable.

@@ -3916,7 +3916,7 @@
sequence \end{note}

\pnum
The \textit{current match} is \tcode{(*position).prefix()} if \tcode{subs[N] == -1}, or
The \term{current match} is \tcode{(*position).prefix()} if \tcode{subs[N] == -1}, or
\tcode{(*position)[subs[N]]} for any other value of \tcode{subs[N]}.

\rSec3[re.tokiter.cnstr]{\tcode{regex_token_iterator} constructors}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch adds \term, which this issue tries to eradicate (admittedly morphed from even worse \textit). Please drop this patch from here for now; I expect those \textit to mostly become \defn or \defnx.

Copy link
Contributor Author

@Eelis Eelis Nov 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, I didn't know there was a plan to eradicate \term. (Not sure what "this issue" refers to.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, if we replace all of \term with more semantic macros such as \placeholder or \defn/x or ..., then nothing remains, right?

class, and has no non-static data members of type non-POD struct, non-POD
union (or array of such types). A \term{POD class} is a
union (or array of such types). A \defn{POD class} is a
class that is either a POD struct or a POD union.

\begin{example}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any rules when to use "POD~struct" vs. "POD struct" in the index? We seem to prefer the variant with the tilde = non-breaking space. If true, the stuff above needs to become \defnx.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change it to use tilde, so that we're covered if one day we want to render the index so narrowly that an entry consisting of 2 words side by side would get broken.

Copy link
Contributor Author

@Eelis Eelis Nov 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If being prepared for that is an actual goal, though, there are hundreds more occurrences that need to be replaced.

integer literal (base ten) begins with a digit other than \tcode{0} and
consists of a sequence of decimal digits.
A \term{hexadecimal} integer literal (base sixteen) begins with
A \defnx{hexadecimal}{literal!hexadecimal} integer literal (base sixteen) begins with
\tcode{0x} or \tcode{0X} and consists of a sequence of hexadecimal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put all of "XXX integer literal" into the first argument of \defnx; we're not actually defining the term "decimal" here, but the phrase "decimal integer literal".

@@ -12224,30 +12224,24 @@
The following definitions apply to this Clause:

\pnum
\indexdefn{call signature}%
A \term{call signature} is the name of a return type followed by a
A \defn{call signature} is the name of a return type followed by a
parenthesized comma-separated list of zero or more argument types.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this (and those that follow), the index entries should probably use tilde instead of space.

@jensmaurer
Copy link
Member

Review complete; see comments above. Going to bed now.

@Eelis
Copy link
Contributor Author

Eelis commented Nov 17, 2016

Hm, this pull request has really lost focus. I originally just wanted to use \defn* for \terms that already had index entries, a change which I could make without affecting those index entries or the formatting of the text, but I don't feel qualified to make the kind of changes to the index entries themselves (by changing their use of tildes) or to the formatting of the text (by changing which parts of the text are italicized) that Jens is requesting, so probably better to just go with his patches. :)

@Eelis Eelis closed this Nov 17, 2016
@Eelis Eelis deleted the defterm branch November 17, 2016 22:58
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.

None yet

4 participants