diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-05-18 20:46:23 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-05-18 20:46:23 -0700 |
commit | a2d98ba063616fc56c6888641c77b55b562fc9ab (patch) | |
tree | 6cf3e0c8a338be5d222ba48b7ffd4ab6165e2960 /txr.1 | |
parent | dc791857cfd41fec131d2645409bf6451eb4635b (diff) | |
download | txr-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.1 | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -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 |