user.r bug ?
[1/1] from: peoyli::algonet::se at: 28-Sep-2000 15:49
Here's what I think is a bug.. (or a feature ?):
The problem is, that the user.r file in the REBOL_HOME directory is
not loaded if there's no user.r file in the same directory as the
rebol binary is located (but REBOL doesn't warn about it when started,
since it then checks both the binary and the REBOL_HOME directory).
The following examples illustrates the problem (core 2.3, core 2.4 and
view 0.10.34 all gave the same result)
---------------------------------------------------------------------
REBOL_HOME variable:
8.Work:Programming/REBOL_core_2.4> getenv REBOL_HOME
Work:Programming/REBOL_examples
---
Contents of the user.r file which I had to put in the rebol directory:
REBOL [
Title: "User Preferences loader (core/2.4)"
Date: 28-Oct-2000
]
print {^/User Preferences loader (core/2.4)^/}
do join system/options/home "user.r"
---
Contents of the user.r file in the REBOL_HOME directory:
REBOL [
Title: "User Preferences in REBOL_HOME directory"
Date: 01-Jun-2000/17:13:03-7:00
]
set-net [ none none none none none none ]
if (not none? system/view) [
system/view/screen-face/options: []
system/view/screen-face/size: 1728x1296
start-view?: off
]
demo?: off
foreach script read join system/options/home %user/ [
do join system/options/home ["user/" script]
]
---------------------------------------------------------------------
Test 1: current directory is the one from where I start the rebol
binary, no user.r there, but in the REBOL_HOME directory
8.Work:Programming/REBOL_core_2.4> rename user.r user.r_
8.Work:Programming/REBOL_core_2.4> rebol
REBOL/core (Experimental) 2.4.37.1.1
...
FTP protocol loaded
NNTP protocol loaded
>>
Note: user.r exists in REBOL_HOME, but was not used when no user.r
file was found in the directory where I have the rebol binary.
---------------------------------------------------------------------
Test 2: current directory anywhere else where, no user.r in the
directory where the rebol binary I use is.
8.Work:Programming/REBOL_core_2.4> ram:
8.Ram Disk:> Work:Programming/REBOL_core_2.3/rebol
REBOL/core (Experimental) 2.4.37.1.1
...
FTP protocol loaded
NNTP protocol loaded
Script: "User Preferences in REBOL_HOME directory" (1-Jun-2000/17:13:03-7:00)
Script: "Extended Help" (9-Oct-2000)
Script: "Subs" (28-Oct-2000)
>>
Note: user.r in REBOL_HOME (which runs a couple of other scripts) is used.
---------------------------------------------------------------------
Test 3: current directory is the one from where I start the rebol
binary, which now has the user.r available.
8.Work:Programming/REBOL_core_2.4> rename user.r_ user.r
8.Work:Programming/REBOL_core_2.4> rebol
REBOL/core (Experimental) 2.4.37.1.1
...
FTP protocol loaded
NNTP protocol loaded
Script: "User Preferences loader (core/2.4)" (28-Oct-2000)
User Preferences loader (core/2.4)
Script: "User Preferences in REBOL_HOME directory" (1-Jun-2000/17:13:03-7:00)
Script: "Extended Help" (9-Oct-2000)
Script: "Subs" (28-Oct-2000)
>>
Note: user.r in the rebol binary directory is used. The user.r file in
REBOL_HOME is loaded by this script.