<span style="font-family: Arial; font-size: 13px;"><div>That's awesome!  Thanks; I'll try the patch out!</div><div><br></div><div>Cheers,</div><div>Alex<br></div><br>On 4/18/2018 at 2:28 AM, "Per Hedeland" <per@hedeland.org> wrote:<blockquote style="border-left:solid 1px #ccc;margin-left:10px;padding-left:10px;">On 2018-04-18 08:05, Per Hedeland wrote:<br>> On 2018-04-18 03:27, Fernando Benavides wrote:<br>>><br>>> Also... Just trying to evaluate _any_ function, loads the module. That's why instead of loading modules manually, when in the shell, I tend to write the module name and :, press tab, if nothing pops <br>>> up, I type x(). and press enter.<br>> <br>> I tend to do the same, even down to the "arbitrary function name", but<br>> it *is* rather quirky, and there is a hint for an obvious and probably<br>> straightforward-to-implement (I haven't looked at the relevant code)<br>> enhancement in your description: why not have the sequence <name>:<TAB><br>> do a code:ensure_loaded(<name>) before it (tries to) look up the<br>> function list?<br><br>OK, so I looked at the code, and the change (see below) is so trivial<br>that there is probably a good reason it doesn't already do that - I<br>don't know what that reason might be though...<br><br>--Per<br><br>diff --git a/lib/stdlib/src/edlin_expand.erl b/lib/stdlib/src/edlin_expand.erl<br>index bdcefda..4b3e0cc 100644<br>--- a/lib/stdlib/src/edlin_expand.erl<br>+++ b/lib/stdlib/src/edlin_expand.erl<br>@@ -49,8 +49,8 @@ expand_module_name(Prefix) -><br>  expand_function_name(ModStr, FuncPrefix) -><br>      case to_atom(ModStr) of<br>    {ok, Mod} -><br>-          case erlang:module_loaded(Mod) of<br>-                true -><br>+       case code:ensure_loaded(Mod) of<br>+          {module, Mod} -><br>               L = Mod:module_info(),<br>                case lists:keyfind(exports, 1, L) of<br>                      {_, Exports} -><br>@@ -58,7 +58,7 @@ expand_function_name(ModStr, FuncPrefix) -><br>                          _ -><br>                           {no, [], []}<br>                  end;<br>-             false -><br>+          {error, _What} -><br>                      {no, [], []}<br>          end;<br>      error -><br>_______________________________________________<br>erlang-questions mailing list<br>erlang-questions@erlang.org<br><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a></blockquote></span>