6.27.2 Locating uses of a word

where ( "name" –  ) gforth-1.0 “where”

Show all places where name is used (text-interpreted). You can then use ww, nw or bw to inspect specific occurences more closely. Gforth’s where does not show the definition of name; use locate for that.

ww ( u –  ) gforth-1.0 “ww”

The next l or g shows the where result with index u

nw ( ) gforth-1.0 “nw”

The next l or g shows the next where result; if the current one is the last one, after nw there is no current one. If there is no current one, after nw the first one is the current one.

bw ( ) gforth-1.0 “bw”

The next l or g shows the previous where result; if the current one is the first one, after bw there is no current one. If there is no current one, after bw the last one is the current one.

gg ( ) gforth-1.0 “gg”

The next ww, nw, bw, bb, nb, lb (but not locate, edit, l or g) puts it result in the editor (like g). Use gg gg to make this permanent rather than one-shot.

ll ( ) gforth-1.0 “ll”

The next ww, nw, bw, bb, nb, lb (but not locate, edit, l or g) displays in the Forth system (like l). Use ll ll to make this permanent rather than one-shot.

whereg ( "name" –  ) gforth-1.0 “whereg”

Like where, but puts the output in the editor. In Emacs, you can then use the compilation-mode commands (see Compilation Mode in GNU Emacs Manual) to inspect specific occurences more closely.

short-where ( ) gforth-1.0 “short-where”

Set up where to use a short file format (default).

expand-where ( ) gforth-1.0 “expand-where”

Set up where to use a fully expanded file format (to pass to e.g. editors).

prepend-where ( ) gforth-1.0 “prepend-where”

Set up where to show the file on a separate line, followed by where lines without file names (like SwiftForth).

The data we have on word usage also allows us to show which words have no uses:

unused-words ( ) gforth-1.0 “unused-words”

list all words without usage