summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-05-18 20:46:23 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-05-18 20:46:23 -0700
commita2d98ba063616fc56c6888641c77b55b562fc9ab (patch)
tree6cf3e0c8a338be5d222ba48b7ffd4ab6165e2960 /txr.1
parentdc791857cfd41fec131d2645409bf6451eb4635b (diff)
downloadtxr-a2d98ba063616fc56c6888641c77b55b562fc9ab.tar.gz
txr-a2d98ba063616fc56c6888641c77b55b562fc9ab.tar.bz2
txr-a2d98ba063616fc56c6888641c77b55b562fc9ab.zip
New feature: self-load-path symbol macro.
* eval.c (self_load_path_s): New symbol variable. (sys_load): Save, set-up and restore self-load-path around load. (set_get_symacro): New function. (eval_init): Register load function using sys_load_s instead of redundant intern. * eval.h (set_get_symacro): Declared. * match.c (v_load): Save, set-up and restore self-load-path macro. * parser.c (load_rcfile): Likewise. * txr.c (txr_main: Set up self-load-path when opening file. * txr.1: Documented self-load-path.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.135
1 files changed, 35 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index cd071bee..217a2b51 100644
--- a/txr.1
+++ b/txr.1
@@ -41399,6 +41399,41 @@ Parser error messages are directed to the
.code *stderr*
stream.
+.coNP Symbol Macro @ self-load-path
+.desc
+The
+.code self-load-path
+symbol macro expands to a string which holds the name of the file being
+loaded. This is a symbol macro rather than a variable so that it can
+be replaced during the macro-expansion process, thereby permanently embedding
+the file name into the expanded code.
+
+An expansion for
+.code self-load-path
+is established for a \*(TX or \*(TL file which is loaded from the
+command line.
+
+If the
+.code -i
+command line option is used to enter the interactive listener,
+and a file to be loaded is also specified, then the
+.code self-load-path
+macro remains bound to the name of that file.
+
+An expansion for
+.code self-load-path
+is also established by the
+.code load
+function and the
+.code @(load)
+directive, referring to the file being loaded. When loading completes, the
+previous expansion of
+.code self-load-path
+is restored.
+
+During the processing of the profile file (see Interactive Profile File),
+the variable is bound to the name of that file.
+
.SH* INTERACTIVE LISTENER
.SS* Overview