Overview

Code highlighting is a standard feature of many development platforms. Highlighting implements context sensitive highlighting, and extended variable highlighting.

Options

Context Sensitive Highlighting

With Emacs Speaks NONMEM, code highlighting may be implemented with context sensitivity or context insensitivity.

Example

For the $SUBROUTINES record there is built in option "ADVAN=".

For context-insensitive highlighting the "ADVAN=" will be highlighted in the $INPUT record as well as the $SUBROUTINES record:

Insensitive Highlighting
Insensitive Highlighting

However, with context-sensitive highlighting, the "ADVAN=" is only highlighted where it is a valid option:

Context sensitive highlighting
Context sensitive highlighting

The advantage of context-sensitive highlighting is obvious, however it takes more computational power to highlight appropriately.

This option may be enabled or disabled through the menu by:

  • NONMEM
    • Display Options
      • Context-sensitive highlighting

Context-sensitive highlighting is turned on by default.

Parameter Name Highlighting

Extended control stream parameter names may be optionally highlighted using Emacs for NONMEM. When this option is active, Emacs Speaks NONMEM only highlights the appropriate variables, for example:

Parameter Names Higlighted
Parameter Names Higlighted

Note that the second instance of CL is not highlighted since it was already assigned to a NONMEM variable. When this option is disabled, no highlighting of the parameter name occurs

Parameter Names Not Higlighted
Parameter Names Not Higlighted

The highlighting may be changed in one of two ways:

  • NONMEM
    • Extended Control Stream Options
      • Highlight extended control stream Parameter Names

or

  • NONMEM
    • Display Options
      • Highlight extended control stream Parameter Names

Note: Changing this option will not take immediate effect, you have to either close out of Emacs or close the file and reopen the file to have the highlighting changed.