Re: InputAutoReplacements With "-marks
- To: mathgroup at smc.vnet.net
- Subject: [mg46137] Re: InputAutoReplacements With "-marks
- From: drbob at bigfoot.com (Bobby R. Treat)
- Date: Sat, 7 Feb 2004 04:02:42 -0500 (EST)
- References: <bvvnge$j5b$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Huh. I didn't do anything like that. I found InputAutoReplacements in Options (with Global selected), and manually added an entry to the List. That is, I positioned the cursor at the end of the list but inside the brackets and typed (exactly): "cg"->"Clear[\"Global`*\"]" Then I clicked Apply, and that was it. It's exactly what we'd naturally think the rule would be except for two things. (1) Both arguments of the rule are strings, and (2) to get quotes inside the target string, you need \", not just ". Bobby "David Park" <djmp at earthlink.net> wrote in message news:<bvvnge$j5b$1 at smc.vnet.net>... > Harold, > > 1) Type Clear["Global`*"] in a cell. > 2) Use Shift-Ctrl-E to get the underlying expression. > 3) Copy out the underlying expression, namely: > > RowBox[{ > "Clear", "[", "\"\<Global`*\>\"", "]"}]] > > 4) Go to Option Inspector and set for Notebook or Global. > 5) Go to Editing Options, Input Aliases and click the little box on the > right. > 6) Select Add > 7) Type cg on the left and paste in the expression you copied in step 3. (If > you forgot to copy it you will have to back out of Add and copy.) Click OK > twice and you should have it. > > The trick is to get the proper underlying expression, and the easiest way to > do that is to copy it out of the expression form of the cell. > > David Park > djmp at earthlink.net > http://home.earthlink.net/~djmp/ > > From: Harold Noffke [mailto:Harold.Noffke at wpafb.af.mil] To: mathgroup at smc.vnet.net > > > MathGroup: > > In running different learning examples for Mathematica 5.0, I > repetitively use Clear["Global`*"] to reset all my variables. I tried > to make "cg" into an InputAutoReplacements alias with the Option > Inspector by defining ... > > cg -> Clear[\"Global`*\"] > > After clicking OK twice and re-inspecting this entry, I found that > Mathematica had processed it into ... > > Clear[ Times[ "Global`, "]] > > which is not what I expected. So, I redefined ... > > cg -> Clear[\"Global`\*\"] > > because the Mathematica Book says ... > > \* in effect acts like an escape: it allows you to enter ordinary > Mathematica syntax even within a \( ... \) sequence. Note that the > input you give after a \* can itself in turn contain \( ... \) > sequences. > > Mathematica processes the new cg definition into ... > > Clear[ "Global`\*"] > > which is not what I expected, either. > > Tests of both definitions for cg yield failures with error messages. > > Are such InputAutoReplacements beyond the scope of Mathematica 5.0? > > Thanks. > Harold