ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* No error when loading a non-existent module
@ 2022-08-25  0:19 Max Chernoff via ntg-context
  2022-08-25  6:57 ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 6+ messages in thread
From: Max Chernoff via ntg-context @ 2022-08-25  0:19 UTC (permalink / raw)
  To: ntg-context; +Cc: Max Chernoff

Hi all,

If you load a non-existent module, ConTeXt issues a minor warning, but
otherwise proceeds as normal:

MWE:

   \usemodule[doesnt-exist]
   
   \starttext
   Hello world!
   \stoptext
   
I think that this behaviour should be changed so that a fatal error is
issued when a loaded module cannot be found. Plain TeX, LaTeX, and OpTeX
all throw an error whenever their versions of modules cannot be found, so
ConTeXt is the odd one out here.

There are 3 scenarios that I can think of for when you attempt to load a
module, but it cannot be found:

1. A module provides some new command "\somecommand"

   In this case, loading the module will quietly fail, but an undefined
   control sequence error will be issued whenever you use
   "\somecommand". This disguises the root problem, which is that the
   module was never loaded, potentially confusing users.
   
2. A module changes the layout of a document

   In this case, the layout of the document would be unchanged by the
   module. If you're looking at every document, then this would be
   obvious; however, if you're using some batch processing system, you
   could unknowingly send out incorrectly-styled documents quite easily.
   
3. You load a module that provides some command, then never use it

   This is the only case where the new error would break any documents.
   However, this case should hopefully be pretty rare since it's
   pointless to load a module then never use any of its features.
   
Making this change could potentially break some documents that currently
work, but I think that this change is worth it, since I'd rather have
something break loudly (throwing an error) rather than silently (producing
a semi-corrupt document).

Thanks,
-- Max
   
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-26  7:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-25  0:19 No error when loading a non-existent module Max Chernoff via ntg-context
2022-08-25  6:57 ` Hans Hagen via ntg-context
2022-08-26  1:00   ` Max Chernoff via ntg-context
2022-08-26  5:40     ` Hans Hagen via ntg-context
2022-08-26  6:45       ` Max Chernoff via ntg-context
2022-08-26  7:49     ` Hans Hagen via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).