In MECCA 2000, the Tcl script file, /usr/bin/amgraf/tkscripts/defaults.tcl, implements how default values for various aspects of the MECCA processing can be set. That file is organized into "procedures" (Tcl term "proc", subroutines): set_m2k_defaults set_gfx_defaults ;# for general graphic defaults. set_box_defaults ;# for things about box only. set_txt_defaults ;# for things about text. set_mictxt_defaults ;# for things about micro-text. set_print_defaults ;# and only for printing. The first, set_m2k_defaults, is called on start-up, as well as each "New Graphic" command. It in turn calls the others, in order. These other procedures mainly consist of a number of Tcl "set var value" statements, which set the "default values". set_m2k_defaults then reads in ~/.m2k.tcl (file ".m2k.tcl" in user's home directory) if that file exists, thereby providing a way for each user to overwrite the defaults. Over time, problems developed: 1. While "~/.m2k.tcl" does have its place (see /usr/mecca/misc/m2k.tcl, for a up-to-date view of what ~/.m2k.tcl should really contain), it was quickly taken to be THE file which each user can put all of the "set ..." statements from defaults.tcl, modify the values, and effect complete per-user customization. ~/.m2.tcl was never meant to function that way, and when it became a file "containing all", it caused problem number 2: 2. set_gfx_defaults, set_box_defaults, set_txt_defaults and set_mictxt_defaults, is each also called directly, whenever the user clicks the "Reset to Start-up Defaults" button in respective Set-Attributes dialog. None of these procedures reads ~/.m2k.tcl. And this causes some users to report: "Reset to Start-up Defaults does not really reset to START-UP defaults!" (whereas START-UP step reads ~/.m2k.tcl, reset box defaults does not). But ~/.m2k.tcl contains other things, so resetting box defaults, for instance, should not reset any other defaults; hence these procedures cannot read ~/.m2k.tcl. 3. It is not always desirable to let each user completely overwrite the values set in defaults.tcl. Site managers should be able to edit defaults.tcl, and rely on it to serve as site-wide defaults, providing familiar, common defaults no matter who is logged in running MECCA 2000 on which machine. To address these problems, beginning with v3.07, the following solution is put in place: Each of the set_gfx_defaults, set_box_defaults, set_txt_defaults and set_mictxt_defaults procedures now contains a statement to pull in per- user defaults file. Instead of the "one-and-all" ~/.m2k.tcl, it should be split into additional files, they correspond like so: set_gfx_defaults ~/.m2kgfx.tcl set_box_defaults ~/.m2kbox.tcl set_txt_defaults ~/.m2ktxt.tcl set_mictxt_defaults ~/.m2kmictxt.tcl while "set_m2k_defaults" still reads ~/.m2k.tcl. Each of the per-user files should now contain only the "set ..." statements as provided by its corresponding "set_xxx_defaults" procedure. For example, ~/.m2kbox.tcl can contain only the "set boxData(...) ..." statements and nothing more. As distributed, each of these procedures, after the normal group of "set var value" statements, contains a "#catch {source ....}" line, which if uncommented (removing the leading # mark), will pull in the per-user defaults file. We distribute them in commented-out form, as we believe it is the site manager's decision to permit per-user overwrite. Also of note to site managers: The "set var value" lines in each of these procedures, can be re-arranged, and the "catch {source ...}" line placement affects what can or cannot be overwritten by each user. Take an example for set_box_defaults: #catch {source ~/.m2kbox.tcl} ;# commented-out, no customize; ;# so where this line is placed ;# in the procedure is irrelevant. ... ;# all of "set boxData(...)" set boxData(super_screen_overwrite) 0 catch {source ~/.m2kbox.tcl} ;# after all of "set ..." lines, ;# thusly each user can overwrite ;# all of box default attributes. ... ;# many "set boxData(...)" lines set boxData(bar_units) i catch {source ~/.m2kbox.tcl} ;# everything up to bar_units can set boxData(panto_name) None ;# be overwritten by each user, but ;# things from panto on, cannot. Most of these "set_xxx_defaults" procedures, aside from having "set ..." statements, also contain "m2k_..." statements toward the end. It is most important that these "m2k_..." statements be the very last things such a set-defaults procedure does. That is, all "set ..." and "catch {source ...}" lines must come before any "m2k_..." statements. Lastly, set_print_defaults currently provides no corresponding per-user customization hook. It didn't have this before, and as of v3.07 there has been no requirement to provide per-user customization for it.