6.30.3 Locating uses of a word

where ( "name" –  ) gforth-1.0

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

ww ( u –  ) gforth-1.0

Show the source code of the where or browse result with index u (indices are shown at the right edge of each line in where or browse output), set the current location there, and then call fancy-after-l for navigating the displayed source (including switching to the next or previous result).

nw ( ) gforth-1.0

Show the source code of the next where or browse result and set the current location there. The “next result” wraps around to the first result if you reach the end. Then call fancy-after-l for navigating the displayed source (including switching to the next or previous result).

bw ( ) gforth-1.0

Show the source code of the previous where or browse result and set the current location there. The “previous result” wraps around to the last result if you reach the beginning. Then call fancy-after-l for navigating the displayed source (including switching to the next or previous result).

gg ( ) gforth-1.0

The next ww, nw, bw, tt, bt, or nt (but not locate, edit, l or g) puts it result in the editor (like g) and does not call fancy-after-l. Use gg gg to make this permanent rather than one-shot.

ll ( ) gforth-1.0

The next ww, nw, bw, tt, bt, or nt (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

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 occurrences more closely.

short-where ( ) gforth-1.0

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

expand-where ( ) gforth-1.0

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

prepend-where ( ) gforth-1.0

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

list all words without usage