ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Max Chernoff via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: Max Chernoff <mseven@telus.net>
Subject: No error when loading a non-existent module
Date: Wed, 24 Aug 2022 18:19:20 -0600	[thread overview]
Message-ID: <f9754292710b11317106371e9778e6f9eae40b5f.camel@telus.net> (raw)

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
___________________________________________________________________________________

             reply	other threads:[~2022-08-25  0:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25  0:19 Max Chernoff via ntg-context [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f9754292710b11317106371e9778e6f9eae40b5f.camel@telus.net \
    --to=ntg-context@ntg.nl \
    --cc=mseven@telus.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).