home *** CD-ROM | disk | FTP | other *** search
/ Internet File Formats / InternetFileFormatsCD.bin / text / latex / mac / alpha60.hqx / Tcl / SystemCode / AlphaBits.tcl next >
Encoding:
Text File  |  1995-07-10  |  2.9 KB  |  115 lines

  1.  
  2. # if {[string match {*b[0-9]*} [version]] && ![file exists "Powerpete:C"]} {
  3. #     alertnote "This is a BETA version of Alpha. Do NOT redistribute!"
  4. # }
  5.  
  6.  
  7. #if {[regexp {[]\(\)\"\{\}\[]} $HOME]} {alertnote "Alpha may not work properly if it's pathname includes parenthesis, square brackets, double quotes, or curly braces."}
  8. # Get name Alpha's current name.
  9. foreach p [processes] {
  10.     if {[lindex $p 1] == "ALFA"} {
  11.         set ALPHA [lindex $p 0]
  12.         break
  13.     }
  14. }
  15.  
  16.  
  17. # Icon menu names. The number refers to the resource id of the #ics family.
  18. #set fsetMenuName     "SetFiles"
  19. set fsetMenuName     "Ñ131"
  20. set helpMenu        "Ñ130"
  21. set cwarriorMenu    "Ñ268"
  22. set cwdebugMenu        "Ñ274"
  23. set latexMenu        "Ñ270"
  24. set perlMenu         "Ñ132"
  25. set tclMenu            "Ñ269"
  26. set terrMenu        "Ñ271"
  27. set thinkMenu         "Ñ300"
  28. set thinkRefMenu    "Ñ265"
  29. set toolboxRefMenu    "Ñ400"
  30. set toolserverMenu    "Ñ133"
  31. set htmlMenu        "Ñ135"
  32. set winMenu         "Ñ263"
  33.  
  34. # A few definitions I'll need later.
  35. proc quoteExpr str {
  36.     regsub -all {\\} $str {\\\\} str
  37.     regsub -all {\|} $str {\|} str
  38.     regsub -all {\*} $str {\\*} str
  39.     regsub -all {\+} $str {\\+} str
  40.     regsub -all {\(} $str {\\(} str
  41.     regsub -all {\)} $str {\\)} str
  42.     regsub -all {\[} $str {\\[} str
  43.     regsub -all {\]} $str {\\]} str
  44.     return $str
  45. }
  46.  
  47. proc quoteExpr2 str {
  48.     regsub -all {\\} $str {\\\\} str
  49.     regsub -all {\|} $str {\|} str
  50.     regsub -all {\*} $str {\\*} str
  51.     regsub -all {\+} $str {\\+} str
  52.     regsub -all {\(} $str {\\(} str
  53.     regsub -all {\)} $str {\\)} str
  54.     regsub -all {\{} $str "\\\{" str
  55.     regsub -all {\}} $str "\\\}" str
  56.     regsub -all {\[} $str {\\[} str
  57.     regsub -all {\]} $str {\\]} str
  58.     return $str
  59. }
  60.  
  61. set auto_path [list $HOME:Tcl:SystemCode $HOME:Tcl:UserCode]
  62. source "$HOME:Tcl:SystemCode:library.tcl"
  63.  
  64. source "$HOME:Tcl:SystemCode:menus.tcl"
  65. source "$HOME:Tcl:SystemCode:keyBindings.tcl"
  66. source "$HOME:Tcl:SystemCode:definitions.tcl"
  67. source "$HOME:Tcl:SystemCode:procs.tcl"
  68. source "$HOME:Tcl:SystemCode:flags.tcl"
  69. source "$HOME:Tcl:SystemCode:modes.tcl"
  70. source "$HOME:Tcl:SystemCode:filesets.tcl"
  71. source "$HOME:Tcl:SystemCode:copyRing.tcl"
  72.  
  73. catch {source "$HOME:Tcl:SystemCode:latexMode.tcl"}
  74. catch {source "$HOME:Tcl:SystemCode:bibtexMode.tcl"}
  75. catch {source "$HOME:Tcl:SystemCode:MacPerlmode.tcl"}
  76. catch {source "$HOME:Tcl:SystemCode:htmlMode.tcl"}
  77.  
  78. # Bogus, but needs to be before userStartup read.
  79. set cwSig MMCC
  80. set cwdSig MWDB
  81.  
  82. set useEmacs 1
  83.  
  84. # Read both scalar and array definitions from preferences folder.
  85. catch {readUserDefs}
  86.  
  87. # After userprefs read.
  88. source "$HOME:Tcl:SystemCode:emacs.tcl"
  89.  
  90. # Should be last so all filesets make it in.
  91. message "Building filesets..."
  92.  
  93. rebuildFilesetMenu
  94.  
  95. buildRecentFiles
  96.  
  97. set modes [lsort $modes]
  98. buildFlagsVars
  99.  
  100. if {![info exists readReadme] || ($readReadme < [string trim [lindex [version] 2] {,}])} {
  101.     addDef readReadme [string trim [lindex [version] 2] {,}]
  102.     edit -r "$HOME:Help:Readme"
  103. } else {unset readReadme}
  104.  
  105.  
  106. source "$HOME:Tcl:SystemCode:paths.tcl"
  107.  
  108. setupPrintMenu
  109.  
  110. # "Switch To" submenu...
  111. buildSwitches
  112.  
  113. message "Initialization Complete"
  114.  
  115.