3 replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/

I experienced a similar issue to what is described in this postpost while editing formatted usage messages (that contained italics) in the declaration section of a package that I'm developing in the notebook front-end.

Question 1: Does anyone know what exactly causes Mma to convert code that contains formatted text to raw input form without explicitly being requested to do so by the user? Is this behavior part of a feature that several of us apparently do not fully understand ... or does it represent a bug in the parser that Wolfram acknowledges?

The solution described in the post linked above did not quite solve my problem because I need to evaluate the sequence of usage messages as part of setting up the package. I eventually found that

FrontEndExecute@FrontEndCellPrint["myFunction::usage=\"myFunction does ...\";"]


recovered the cell with usage messages displayed in standard input form exactly as I originally entered them (i.e. no explicit Styleboxes and escaping of quotes etc.).

In the process I reviewed the documentation on CellPrint and its FrontEnd-equivalent version. The main difference from what I could gather is that the former is handled by the kernel while the latter is processed solely in the FrontEnd. While experimenting with the two versions of CellPrint, I noticed the following:

CellPrint[Cell["a", "Input"]]


produces the cell expression

Cell["a", "Input"]


whereas

FrontEndExecute@FrontEndCellPrint["a"]


produces a BoxData-wrapped version of the above

Cell[BoxData["a"], "Input"].


One obvious consequence of this discrepancy is that the syntax highlighter colors the latter in blue but not the former.

Question 2: Why does the version of CellPrint evaluated in the kernel not wrap the input text in a BoxData structure too?

While my issue with the auto-conversion of usage messages to raw input form is now resolved I feel that my understanding from reading the documentation of how Mma parses and produces different formatting structures is still far from complete. Perhaps an answer here will shed additional light on this topic.

I experienced a similar issue to what is described in this post while editing formatted usage messages (that contained italics) in the declaration section of a package that I'm developing in the notebook front-end.

Question 1: Does anyone know what exactly causes Mma to convert code that contains formatted text to raw input form without explicitly being requested to do so by the user? Is this behavior part of a feature that several of us apparently do not fully understand ... or does it represent a bug in the parser that Wolfram acknowledges?

The solution described in the post linked above did not quite solve my problem because I need to evaluate the sequence of usage messages as part of setting up the package. I eventually found that

FrontEndExecute@FrontEndCellPrint["myFunction::usage=\"myFunction does ...\";"]


recovered the cell with usage messages displayed in standard input form exactly as I originally entered them (i.e. no explicit Styleboxes and escaping of quotes etc.).

In the process I reviewed the documentation on CellPrint and its FrontEnd-equivalent version. The main difference from what I could gather is that the former is handled by the kernel while the latter is processed solely in the FrontEnd. While experimenting with the two versions of CellPrint, I noticed the following:

CellPrint[Cell["a", "Input"]]


produces the cell expression

Cell["a", "Input"]


whereas

FrontEndExecute@FrontEndCellPrint["a"]


produces a BoxData-wrapped version of the above

Cell[BoxData["a"], "Input"].


One obvious consequence of this discrepancy is that the syntax highlighter colors the latter in blue but not the former.

Question 2: Why does the version of CellPrint evaluated in the kernel not wrap the input text in a BoxData structure too?

While my issue with the auto-conversion of usage messages to raw input form is now resolved I feel that my understanding from reading the documentation of how Mma parses and produces different formatting structures is still far from complete. Perhaps an answer here will shed additional light on this topic.

I experienced a similar issue to what is described in this post while editing formatted usage messages (that contained italics) in the declaration section of a package that I'm developing in the notebook front-end.

Question 1: Does anyone know what exactly causes Mma to convert code that contains formatted text to raw input form without explicitly being requested to do so by the user? Is this behavior part of a feature that several of us apparently do not fully understand ... or does it represent a bug in the parser that Wolfram acknowledges?

The solution described in the post linked above did not quite solve my problem because I need to evaluate the sequence of usage messages as part of setting up the package. I eventually found that

FrontEndExecute@FrontEndCellPrint["myFunction::usage=\"myFunction does ...\";"]


recovered the cell with usage messages displayed in standard input form exactly as I originally entered them (i.e. no explicit Styleboxes and escaping of quotes etc.).

In the process I reviewed the documentation on CellPrint and its FrontEnd-equivalent version. The main difference from what I could gather is that the former is handled by the kernel while the latter is processed solely in the FrontEnd. While experimenting with the two versions of CellPrint, I noticed the following:

CellPrint[Cell["a", "Input"]]


produces the cell expression

Cell["a", "Input"]


whereas

FrontEndExecute@FrontEndCellPrint["a"]


produces a BoxData-wrapped version of the above

Cell[BoxData["a"], "Input"].


One obvious consequence of this discrepancy is that the syntax highlighter colors the latter in blue but not the former.

Question 2: Why does the version of CellPrint evaluated in the kernel not wrap the input text in a BoxData structure too?

While my issue with the auto-conversion of usage messages to raw input form is now resolved I feel that my understanding from reading the documentation of how Mma parses and produces different formatting structures is still far from complete. Perhaps an answer here will shed additional light on this topic.

2 deleted 2 characters in body; edited title

# CellPrint vs. FrontEndCellPrint On Reverting Code that Mma Switches to Raw Input Form Back to Standard Form

I experienced a similar issue to what is described in this post while editing formatted usage messages (that contained italics) in the declaration section of a package that I'm developing in the notebook front-end.

Question 1: Does anyone know what exactly causes Mma to convert code that contains formatted text to raw input form without explicitly being requested to do so by the user? Is this behavior part of a feature that several of us apparently do not fully understand ... or does it represent a bug in the parser that Wolfram acknowledges?

The solution described in the post linked above did not quite solve my problem because I need to evaluate the sequence of usage messages as part of setting up the package. I eventually found that

FrontEndExecute@FrontEndCellPrint["myFunction::usage=\"myFunction does ...\";"]


recovered the cell with usage messages displayed in standard input form exactly as I originally entered them (i.e. no explicit Styleboxes and escaping of quotes etc.).

In the process I reviewed the documentation on CellPrint and its FrontEnd-equivalent version. The main difference from what I could gather is that the former is handled by the kernel while the latter is processed solely in the FrontEnd. While experimenting with the two versions of CellPrint, I noticed the following:

CellPrint[Cell["a", "Input"]]


produces the cell expression

Cell["a", "Input"]


whereas

FrontEndExecute@FrontEndCellPrint["a"]


produces a BoxData-wrapped version of the above

Cell[BoxData["a"], "Input"].


One obvious consequence of this discrepancy is that the syntax highlighter colors the latter in blue but not the former.

Question 2: Why does the version of CellPrint evaluated in the kernel not wrap the input text in a BoxData structure too?

While my issue with the auto-conversion of usage messages to raw input form is now resolved I feel that my understanding from reading the documentation of how Mma parses and produces different formatting structures is still far from complete. Perhaps an answer here will shed additional light on this topic.

# CellPrint vs. FrontEndCellPrint

I experienced a similar issue to what is described in this post while editing formatted usage messages (that contained italics) in the declaration section of a package that I'm developing in the notebook front-end.

Question 1: Does anyone know what exactly causes Mma to convert code that contains formatted text to raw input form without explicitly being requested to do so by the user? Is this behavior part of a feature that several of us apparently do not fully understand ... or does it represent a bug in the parser that Wolfram acknowledges?

The solution described in the post linked above did not quite solve my problem because I need to evaluate the sequence of usage messages as part of setting up the package. I eventually found that

FrontEndExecute@FrontEndCellPrint["myFunction::usage=\"myFunction does ...\";"]


recovered the cell with usage messages displayed in standard input form exactly as I originally entered them (i.e. no explicit Styleboxes and escaping of quotes etc.).

In the process I reviewed the documentation on CellPrint and its FrontEnd-equivalent version. The main difference from what I could gather is that the former is handled by the kernel while the latter is processed solely in the FrontEnd. While experimenting with the two versions of CellPrint, I noticed the following:

CellPrint[Cell["a", "Input"]]


produces the cell expression

Cell["a", "Input"]


whereas

FrontEndExecute@FrontEndCellPrint["a"]


produces a BoxData-wrapped version of the above

Cell[BoxData["a"], "Input"].


One obvious consequence of this discrepancy is that the syntax highlighter colors the latter in blue but not the former.

Question 2: Why does the version of CellPrint evaluated in the kernel not wrap the input text in a BoxData structure too?

While my issue with the auto-conversion of usage messages to raw input form is now resolved I feel that my understanding from reading the documentation of how Mma parses and produces different formatting structures is still far from complete. Perhaps an answer here will shed additional light on this topic.

# On Reverting Code that Mma Switches to Raw Input Form Back to Standard Form

I experienced a similar issue to what is described in this post while editing formatted usage messages (that contained italics) in the declaration section of a package that I'm developing in the notebook front-end.

Question 1: Does anyone know what exactly causes Mma to convert code that contains formatted text to raw input form without explicitly being requested to do so by the user? Is this behavior part of a feature that several of us apparently do not fully understand ... or does it represent a bug in the parser that Wolfram acknowledges?

The solution described in the post linked above did not quite solve my problem because I need to evaluate the sequence of usage messages as part of setting up the package. I eventually found that

FrontEndExecute@FrontEndCellPrint["myFunction::usage=\"myFunction does ...\";"]


recovered the cell with usage messages displayed in standard input form exactly as I originally entered them (i.e. no explicit Styleboxes and escaping of quotes etc.).

In the process I reviewed the documentation on CellPrint and its FrontEnd-equivalent version. The main difference from what I could gather is that the former is handled by the kernel while the latter is processed solely in the FrontEnd. While experimenting with the two versions of CellPrint, I noticed the following:

CellPrint[Cell["a", "Input"]]


produces the cell expression

Cell["a", "Input"]


whereas

FrontEndExecute@FrontEndCellPrint["a"]


produces a BoxData-wrapped version of the above

Cell[BoxData["a"], "Input"].


One obvious consequence of this discrepancy is that the syntax highlighter colors the latter in blue but not the former.

Question 2: Why does the version of CellPrint evaluated in the kernel not wrap the input text in a BoxData structure too?

While my issue with the auto-conversion of usage messages to raw input form is now resolved I feel that my understanding from reading the documentation of how Mma parses and produces different formatting structures is still far from complete. Perhaps an answer here will shed additional light on this topic.

1

# CellPrint vs. FrontEndCellPrint

I experienced a similar issue to what is described in this post while editing formatted usage messages (that contained italics) in the declaration section of a package that I'm developing in the notebook front-end.

Question 1: Does anyone know what exactly causes Mma to convert code that contains formatted text to raw input form without explicitly being requested to do so by the user? Is this behavior part of a feature that several of us apparently do not fully understand ... or does it represent a bug in the parser that Wolfram acknowledges?

The solution described in the post linked above did not quite solve my problem because I need to evaluate the sequence of usage messages as part of setting up the package. I eventually found that

FrontEndExecute@FrontEndCellPrint["myFunction::usage=\"myFunction does ...\";"]


recovered the cell with usage messages displayed in standard input form exactly as I originally entered them (i.e. no explicit Styleboxes and escaping of quotes etc.).

In the process I reviewed the documentation on CellPrint and its FrontEnd-equivalent version. The main difference from what I could gather is that the former is handled by the kernel while the latter is processed solely in the FrontEnd. While experimenting with the two versions of CellPrint, I noticed the following:

CellPrint[Cell["a", "Input"]]


produces the cell expression

Cell["a", "Input"]


whereas

FrontEndExecute@FrontEndCellPrint["a"]


produces a BoxData-wrapped version of the above

Cell[BoxData["a"], "Input"].
`

One obvious consequence of this discrepancy is that the syntax highlighter colors the latter in blue but not the former.

Question 2: Why does the version of CellPrint evaluated in the kernel not wrap the input text in a BoxData structure too?

While my issue with the auto-conversion of usage messages to raw input form is now resolved I feel that my understanding from reading the documentation of how Mma parses and produces different formatting structures is still far from complete. Perhaps an answer here will shed additional light on this topic.