diff --git a/Makefile b/Makefile index e1914fea..7e3d3b2f 100644 --- a/Makefile +++ b/Makefile @@ -1068,7 +1068,7 @@ tcl/syntaxdb.tcl: modulecmd.tcl $(NAGELFAR) set tcl_interactive 1;\ source $(NAGELFAR_RELEASE)/syntaxbuild.tcl;\ set ::syntax(appendNoDupToList) {n x*};\ - set ::syntax(execute-modulefile) {x x n x x? x? x?};\ + set ::syntax(execute-modulefile) {x x n x x x? x? x?};\ set ::syntax(filterExtraMatchSearch) {x x n n};\ set ::syntax(findModulesFromDirsAndFiles) {x x x x n n? n? n? n?};\ set ::syntax(getArrayKey) {n x x};\ diff --git a/tcl/interp.tcl.in b/tcl/interp.tcl.in index f4cc15f9..b6b055a6 100644 --- a/tcl/interp.tcl.in +++ b/tcl/interp.tcl.in @@ -228,8 +228,8 @@ proc skipUnloadIfSticky {mode modname modfile} { return 0 } -proc execute-modulefile {modfile modname modnamevrvar modspec {up_namevr 1}\ - {fetch_tags 1} {modpath {}}} { +proc execute-modulefile {modfile modname modnamevrvar modspec requested\ + {up_namevr 1} {fetch_tags 1} {modpath {}}} { # link to modnamevr variable name from calling ctx if content update asked if {$up_namevr} { upvar $modnamevrvar modnamevr diff --git a/tcl/modscan.tcl b/tcl/modscan.tcl index 3babe942..bd4f3fba 100644 --- a/tcl/modscan.tcl +++ b/tcl/modscan.tcl @@ -378,7 +378,7 @@ proc filterExtraMatchSearch {modpath mod res_arrname versmod_arrname} { $found_list($elt) 2]]} { ##nagelfar ignore Suspicious variable name execute-modulefile [lindex $found_list($elt) 2] $elt $elt\ - $elt 0 0 $modpath + $elt 0 0 0 $modpath } } } diff --git a/tcl/subcmd.tcl.in b/tcl/subcmd.tcl.in index 6b23ed9e..11285914 100644 --- a/tcl/subcmd.tcl.in +++ b/tcl/subcmd.tcl.in @@ -149,7 +149,7 @@ proc cmdModuleDisplay {args} { set first_report 0 } report [sgr hi $modfile]:\n - execute-modulefile $modfile $modname modnamevr $mod + execute-modulefile $modfile $modname modnamevr $mod 1 displaySeparatorLine } } @@ -392,7 +392,7 @@ proc cmdModuleSearch {{mod {}} {search {}}} { foreach elt [lsort -dictionary [array names interp_list]] { set ::g_whatis {} ##nagelfar ignore Suspicious variable name - execute-modulefile $interp_list($elt) $elt $elt $elt 0 + execute-modulefile $interp_list($elt) $elt $elt $elt 0 0 # treat whatis as a multi-line text if {$search eq {} || [regexp -nocase $search $::g_whatis]} { @@ -1007,7 +1007,7 @@ proc cmdModuleSource {mode args} { lappendState mode $mode # sourced file must also have a magic cookie set at their start ##nagelfar ignore Suspicious variable name - execute-modulefile $modfile $modname $modnamevr $mod 0 0 + execute-modulefile $modfile $modname $modnamevr $mod 1 0 0 ##nagelfar ignore Found constant lpopState mode } @@ -1277,7 +1277,7 @@ proc cmdModuleLoad {context uasked tryload loadany tag_list modulepath_list\ } } - if {[execute-modulefile $modfile $modname modnamevr $mod]} { + if {[execute-modulefile $modfile $modname modnamevr $mod $uasked]} { break } @@ -1639,19 +1639,20 @@ proc cmdModuleUnload {context match auto force onlyureq onlyndep args} { # unload evaluation to report correct order with other evaluations) registerModuleEval $context $msgrecid + # module was asked by user if tagged loaded instead of auto-loaded + set uasked [isModuleTagged $modname loaded 1] + # no need to update modnamevr and tags after evaluation as these # information were already complete in persistent environment ##nagelfar ignore Suspicious variable name - if {[execute-modulefile $modfile $modname $modnamevr $mod 0 0]} { + if {[execute-modulefile $modfile $modname $modnamevr $mod $uasked 0\ + 0]} { break } # unloading visibility depends on hidden-loaded tag set hidden [isModuleTagged $modname hidden-loaded 1] - # module was asked by user if tagged loaded instead of auto-loaded - set uasked [isModuleTagged $modname loaded 1] - # unset module from list of loaded modules qualified for refresh eval if {[isModuleRefreshQualified $modname]} { remove-path __MODULES_LMREFRESH $modname @@ -2362,7 +2363,7 @@ proc cmdModuleTest {args} { set first_report 0 } report "Module Specific Test for [sgr hi $modfile]:\n" - execute-modulefile $modfile $modname modnamevr $mod + execute-modulefile $modfile $modname modnamevr $mod 1 displaySeparatorLine } } @@ -2686,7 +2687,7 @@ proc cmdModuleRefresh {} { # continue to evaluate the remaining loaded modules pushSettings if {[set errCode [catch { - if {[execute-modulefile $lmfile $lm lmvr $lm]} { + if {[execute-modulefile $lmfile $lm lmvr $lm 0]} { break } @@ -2724,7 +2725,7 @@ proc cmdModuleHelp {args} { set first_report 0 } report "Module Specific Help for [sgr hi $modfile]:\n" - execute-modulefile $modfile $modname modnamevr $arg + execute-modulefile $modfile $modname modnamevr $arg 1 displaySeparatorLine } }