octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #65548] Every time a new function is created i


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #65548] Every time a new function is created in a separate m-file, an 'undefined' error message is displayed
Date: Wed, 3 Apr 2024 15:47:43 -0400 (EDT)

Follow-up Comment #6, bug #65548 (group octave):

The following change makes F5 work for a new file for me:

diff -r 91f7c8246a98 libgui/src/main-window.cc
--- a/libgui/src/main-window.cc Sun Mar 31 15:57:02 2024 +0200
+++ b/libgui/src/main-window.cc Wed Apr 03 21:32:56 2024 +0200
@@ -1166,6 +1166,7 @@
            // debug.
 
            load_path& lp = interp.get_load_path ();
+           lp.rehash ();
 
            std::string path = info.absolutePath ().toStdString ();
 


I'm not sure this is the correct place for that though. Rehashing the
load_path on each F5 seems wasteful. Do we know whether the file is new at
that point? Should we maybe trigger a load_path rehash when a new file is
saved, not when F5-ing it?
On the other hand, rehashing the load path immediately after a file is saved
might lead to problems on slow file systems (where the file might only be
available after a short time later).


Anyway, this turns out to be a different issue than the one described in
comment #0.
Regarding that issue, I think we have a BIST for it (i.e., creating .m files
in a script and executing them in the same script):
https://hg.savannah.gnu.org/hgweb/octave/file/0d1f479b7824/test/bug-40117.tst

That BIST contains a `pause (1)` and `rehash ()`. ISTR that the test
occasionally still fails in CI (maybe when disc load is high?).
Does some combination of that work for the OP?



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65548>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]