3

Here's an example:

CurrentValue[
    $FrontEndSession, {TaggingRules, "a", "a1"}
] = 22;

CurrentValue[
    EvaluationNotebook[], TaggingRules
] = {"a" -> {"a1" -> 1, "a2" -> 2}, "b" -> 5}


CurrentValue[EvaluationNotebook[], {TaggingRules, "a", "a1"}]
   (* 1  - ok*)

CurrentValue[
   EvaluationNotebook[], {TaggingRules, "a", "a1"}
] = Inherited

CurrentValue[EvaluationNotebook[], TaggingRules]
{"b" -> 5}

So whole "a" TaggingRules were dropped.

One could say that maybe it doesn't work with nested rules but will work on the first level of TaggingRules. Well, it does not, "a" -> 1 set to Inherited will be dropped despite $FrontEndSession tagging rules:

CurrentValue[EvaluationNotebook[], TaggingRules] = {"a" -> 1, "b" -> 5};
CurrentValue[EvaluationNotebook[], TaggingRules]
    (*{"a" -> 1, "b" -> 5}*)
CurrentValue[$FrontEndSession, {TaggingRules, "a"}] = 22;
CurrentValue[EvaluationNotebook[], {TaggingRules, "a"}] = Inherited;
CurrentValue[EvaluationNotebook[], TaggingRules]
    (*{"b" -> 5}*)

Am I missing something? How to make it work?

Maybe related: Notebook's TaggingRules inherit too much

CASE:3893084

Kuba
  • 136,707
  • 13
  • 279
  • 740

0 Answers0