Copyright ã1996 by NeXT Software, Inc.  All Rights Reserved.

;NavigatingBetweenFiles.rtfd;;¬  Next Section	;IndentingCode.rtfd;;¬  Previous Section

Navigating within code files

¬	Go directly to methods and functions by selecting their names in the project browser.

¬	Enter a line number in the Line Range panel to go that line.

You can, of course, go from one place in a source-code file to another place in the same file by scrolling the code editor. Although this mode of navigation is sometimes inescapable, you have other navigation techniques at your disposal.

¬

Methods, functions, and types appear in the project browser only if the project has been indexed. In the Indexing preferences, you can specify how items in the browser should be sorted: by position in the file, by symbol name (that is, alphabetically), or by symbol name within type.

As its name suggests, you can use the Line Range panel not only to navigate to specific line numbers, but to select ranges of text by specifying colon-separated line numbers. The panel is also a useful tool for learning the current line number. One place where this might be useful is gdb (run from the command line) where you can set breakpoints within methods by file:line number.

Tip: You can ªvisitº a line of code and return directly to your original location with a couple of Emacs commands. First set a mark by pressing Escape, then the spacebar. Naviagate to the other line, view it (or copy it, or whatever), and press Control-x Control-x to return the marked line.

You can use Emacs key bindings to move around in code without ever touching the mouse. See ªEmacs Key Bindingsº  for a list of enabled Emacs commands.  ;EditingCodeConcepts.rtfd;EmacsKeyBindings;¬

The incremental-search feature (Emacs binding Control-s) is a powerful code-navigation tool for locating text strings within a file. You can also use the Find panel and especially the Project Find panel to find (and replace) specific definitions, reference, and text strings. See the chapter ªFinding Informationº for details on all of these search features.  ;../08_FindingInformation/FindingInformation.rtfd;;¬