diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-05-01 21:31:45 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-05-01 21:31:45 -0700 |
commit | 065dde19dfbe50e91e313e5b3ccc033cfbe47f74 (patch) | |
tree | 2ba6874a603e014b4be5e7e273eac2b62bae2ab5 /parser.y | |
parent | 488c1ba59416a0b2ce87a36d7df3026e334d66b9 (diff) | |
download | txr-065dde19dfbe50e91e313e5b3ccc033cfbe47f74.tar.gz txr-065dde19dfbe50e91e313e5b3ccc033cfbe47f74.tar.bz2 txr-065dde19dfbe50e91e313e5b3ccc033cfbe47f74.zip |
loading: try unsuffixed files directly last.
In this patch we change the strategy for resolving unsuffixed
paths in load and @(load). In load, an unsuffixed name is
tried with a .tlo suffix, then .tl and only if those don't
resolve to a file it is tried as-is. The previous order is
as-is, .tlo, .tl. Similarly in @(load), but unsuffixed paths
are tried as .txr, then .tlo, then .tl.
The motivation for this is to avoid probing the filesystem
multiple times the optimized case that we care about: loading
.tlo files from Lisp.
* parser.c (open_txr_file): Rearrange the probing strategy.
Also recognize .txr_profile as a suffix, treating it like .tl.
This is so that we don't probe for .txr_profile.tlo and
.txr_profile.tl before finding the profile.
(load_rcfile): Take advantage of the new path-not-found
exception. We avoid wastefully checking with path-exists-p
to avoid calling open_txr_file. We just let open_txr_file
throw an exception if the file doesn't exist, and then
distinguish the non-existence case in the handler.
* txr.1: Updated @(load) and load documentation.
Diffstat (limited to 'parser.y')
0 files changed, 0 insertions, 0 deletions