4
$\begingroup$

Bug introduced in 8 or earlier and persisting through 11.3


The following behavior is stably reproduced with versions 8.0.4, 10.4.1, 11.0.1 and 11.1.1 on Windows 7 x64.

Set the NotebookDynamicExpression:

SetOptions[EvaluationNotebook[], 
 NotebookDynamicExpression :> Refresh[nb = EvaluationNotebook[], UpdateInterval -> .1]]

Evaluate Dynamic[nb]:

Dynamic[nb]

screenshot

Everything is as expected so far. Now just select the code Dynamic[nb] and copy it via Ctrl+C. Here is what becomes:

screenshot

By evaluating nb you occasionally can get the hidden NotebookObject:

nb

screenshot

This object isn't listed in Notebooks[]:

Notebooks[]    

screenshot

What happens here? From where comes the hidden NotebookObject? Why nb periodically switches between the two NotebookObjects? Is it a bug?

$\endgroup$
8
  • $\begingroup$ It seems to be a clipboard notebook, not sure why it inherits NotebookDynamicExpression. $\endgroup$
    – Kuba
    May 10, 2017 at 18:29
  • $\begingroup$ @Kuba Yes, NotebookGet@ClipboardNotebook[] returns a Notebook with the NotebookDynamicExpression. Then it is certainly a bug, right? $\endgroup$ May 10, 2017 at 18:51
  • $\begingroup$ I'd agree, definitely worth reporting $\endgroup$
    – Kuba
    May 10, 2017 at 18:55
  • $\begingroup$ Similar pb with OSX and MMA 11.1.1 : i don't get the "blinking/switching" dynamic object, but the nb command returns NotebookObject[16]. I have recently played with NotebookDynamicExpression and Refresh and observed some strange similar switching effects in Dynamic but not very reproducible, i gave up. $\endgroup$
    – SquareOne
    May 10, 2017 at 23:27
  • $\begingroup$ @SquareOne Does NotebookGet@ClipboardNotebook[] return a Notebook expression containing the NotebookDynamicExpression? $\endgroup$ May 11, 2017 at 0:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.