[REBOL] Re: keymap in text style feel/engage
From: dockimbel:free at: 20-Apr-2002 19:42
Hi Brett,
Brett Handley wrote:
> Hi Anton,
>
> > Two words were not defined after I did this:
> > - view* (it's easy, system/view)
> > - keymap (where is it?)
I don't think so, 'view* is defined in ctx-text.
I quickly made a little tool to find where those words are defined, it may help
in such cases :
>> where? view*
...found in 'ctx-text
>> where? keymap
...found in 'user-prefs
...found in 'ctx-text
>> where? timeout
...found in 'system/schemes/default
...found in 'system/schemes/Finger
...found in 'system/schemes/Whois
...found in 'system/schemes/Daytime
...found in 'system/schemes/SMTP
...found in 'system/schemes/POP
...found in 'system/schemes/IMAP
...found in 'system/schemes/HTTP
...found in 'system/schemes/FTP
...found in 'system/schemes/NNTP
...found in 'system/error/access
...found in 'system/standard/port
>> where? feel
...found in 'face
...found in 'blank-face
...found in 'ctx-text/view*/screen-face
...found in 'ctx-text/view*/VID/vid-face
...found in 'ctx-text/view*/VID/choice-face
...found in 'svv/vid-face
...found in 'svv/choice-face
...found in 'system/standard/face
...found in 'system/view/screen-face
...found in 'system/view/VID/vid-face
...found in 'system/view/VID/choice-face
Here is the source :
REBOL [
Title: "Where tool"
Author: "Nenad Rakocevic"
Date: 20/04/2001
File: %where.r
Version: 0.1
Purpose: "Find in which objects words are defined"
]
context [
ctx: fword: cto: val: pos: none
iter: has [w][
w: to-path :ctx
if find first w :fword [
pos: either pos: find/match :ctx 'system/words [:pos][:ctx]
if empty? :pos [pos: either value? fword ["global context"][none]]
if pos [print ["...found in" :pos]]
]
foreach w next first w [
cto: to-path :ctx
set/any 'val get/any in cto :w
if all [
value? 'val
not any-function? :val
object? val
:ctx <> 'system/words
:w <> 'system
:w <> 'REBOL
][
insert tail :ctx :w
iter
]
]
remove back tail ctx
]
set 'where? func ['word][
ctx: to-lit-path 'system
fword: :word
iter
]
]
I didn't upload it in library because it's a quick hack and it may crash
your REBOL if it encounters circular references like in this case (/View) :
>> desktop
>> where? editor
*** crash ***
So, if anyone is interested in improving this script, please do. :)
Cheers,
-DocKimbel.