Skip to content

Commit 02ddfa1

Browse files
committed
No Tagging msg block if hidden and nuasked
Do not output Tagging message block if module is set hidden-loaded and evaluation has not been directly asked by user. Add uasked argument to cmdModuleTag procedure to know if the evaluation of module has been asked or not by user.
1 parent bb5ec41 commit 02ddfa1

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

doc/source/design/hide-or-forbid-modulefile.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Specification
177177

178178
- Unless ``--all`` option is set on ``list`` sub-command
179179

180-
- Hidden once loaded modules load or unload is not reported
180+
- Hidden once loaded modules load, unload or tag is not reported
181181

182182
- If this evaluation has been triggered automatically
183183

tcl/main.tcl.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ proc module {command args} {
530530
}
531531
# update tags on already loaded modules
532532
if {[info exists loadedmodlist]} {
533-
cmdModuleTag 0 $tag_list {*}$loadedmodlist
533+
cmdModuleTag 0 0 $tag_list {*}$loadedmodlist
534534
}
535535
}
536536
}

tcl/mfinterp.tcl.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ proc prereq {args} {
17731773
}
17741774
} elseif {![getConf auto_handling]} {
17751775
# apply missing tag to first loaded module found
1776-
cmdModuleTag 0 $tag_list $loadedmod
1776+
cmdModuleTag 0 0 $tag_list $loadedmod
17771777
}
17781778

17791779
return {}

tcl/modeval.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ proc loadRequirementModuleList {tag_list args} {
661661
releaseHeldReport {*}$holdidlist
662662
} else {
663663
# apply missing tag to first loaded module found
664-
cmdModuleTag 0 $tag_list $loadedmod
664+
cmdModuleTag 0 0 $tag_list $loadedmod
665665
}
666666
}
667667

tcl/subcmd.tcl.in

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,9 @@ proc cmdModuleRestore {{coll default}} {
662662
} else {
663663
set tag_list {}
664664
}
665-
cmdModuleTag 1 $tag_list $modvr
665+
# indicate if module has been asked by user
666+
cmdModuleTag 1 [expr {![isModuleTagged $modvr auto-loaded 1]}]\
667+
$tag_list $modvr
666668
}
667669

668670
# determine what module to load to restore collection from current
@@ -928,7 +930,7 @@ proc cmdModuleLoad {context uasked tag_list args} {
928930
}
929931

930932
# apply missing tag to loaded module
931-
cmdModuleTag 0 $tag_list $modname
933+
cmdModuleTag 0 $uasked $tag_list $modname
932934

933935
# exit treatment but no need to restore settings
934936
set loadok 1
@@ -2390,8 +2392,9 @@ proc cmdModuleHelp {args} {
23902392
}
23912393
}
23922394

2393-
proc cmdModuleTag {unset_extra tag_list args} {
2394-
reportDebug "tagging $args (unset_extra=$unset_extra, tag_list=$tag_list)"
2395+
proc cmdModuleTag {unset_extra uasked tag_list args} {
2396+
reportDebug "tagging $args (unset_extra=$unset_extra, uasked=$uasked,\
2397+
tag_list=$tag_list)"
23952398

23962399
set ret 0
23972400
foreach mod $args {
@@ -2476,8 +2479,10 @@ proc cmdModuleTag {unset_extra tag_list args} {
24762479
# update module designation now the additional tags are set
24772480
registerModuleDesignation $msgrecid $modname [getVariantList\
24782481
$modname 1] [getExportTagList $modname]
2479-
# report tagging evaluation
2480-
reportMsgRecord "Tagging [getModuleDesignation $msgrecid {} 2]"
2482+
# report tagging evaluation unless hidden and auto-loaded
2483+
set hidden [isModuleTagged $modnamevr hidden-loaded 1]
2484+
reportMsgRecord "Tagging [getModuleDesignation $msgrecid {} 2]"\
2485+
[expr {$hidden && !$uasked}]
24812486
popMsgRecordId
24822487
}
24832488
}

0 commit comments

Comments
 (0)