{{{  description
; mode-number mode-tag mode-name
;      0
;      2      c-mode   C-Mode
;      3      p-mode   PASCAL-M
;      4      r-mode   ROFF-M
;      5      t-mode   TEX-Mode
;      6      o-mode   OCCAM-M
;      7      m-mode   MIRA-M
}}}
{{{  standard-filter
(deffun standard-filter (
  case
    (counter>0 c-mode (filter-buffer "cb O_RETURN))
    (counter>0 r-mode (fill-paragraph))
    (counter>0 t-mode (fill-paragraph))
  esac
))
}}}
{{{  standard-up
{{{  occam-up
(defmac occam-up (
  O_START_OF_LINE
  O_LEFT
  store-pos start-up-x
  do (
    if test-begin-fold (O_CLOSE_FOLD) fi
    O_UP
    while test-fold-line (
      O_OPEN_FOLD
      mtool-bot
      O_UP
    )
    goto-counter start-up-x
  ) while and(not(test-top),or(test-char " ,not(test-text)))
))
}}}
(deffun standard-up (
  case
    (counter>0 c-mode (O_FIND_REVERSE "{ ))
    (counter>0 r-mode (previous-paragraph))
    (counter>0 t-mode (previous-paragraph))
    (counter>0 p-mode (O_FIND_REVERSE "begin))
    (counter>0 o-mode (occam-up))
  esac
))
}}}
{{{  standard-down
{{{  occam-down
(defmac occam-down (
  O_START_OF_LINE
  store-pos start-up-x
  do (
    if test-end-fold (O_CLOSE_FOLD) fi
    O_DOWN
    while test-fold-line (O_OPEN_FOLD O_DOWN)
    O_START_OF_LINE
    store-pos start-up-y
    inv-counter start-up-y
    sum-counter start-up-y start-up-x
  ) while and(not(test-bottom),or(not(counter>0 start-up-y),not(test-text)))
))
}}}
(deffun standard-down (
  case
    (counter>0 c-mode (O_RIGHT O_FIND "{ ))
    (counter>0 r-mode (next-paragraph))
    (counter>0 t-mode (next-paragraph))
    (counter>0 p-mode (O_RIGHT O_FIND "begin))
    (counter>0 o-mode (occam-down))
  esac
))
}}}
{{{  standard-parameter
(deffun standard-parameter (
  case
    (counter-0 mode-number (define-tab))
    (or(counter>0 t-mode,counter>0 r-mode) (set-fill-column))
  esac
))
}}}
{{{  standard-block
(deffun standard-block (
  case
    (counter>0 p-mode (O_END_OF_LINE "  "begin O_RETURN
                       O_RETURN "end O_UP O_LEFT))
    (counter>0 c-mode (O_END_OF_LINE "  "{ O_RETURN
                       O_RETURN "} O_UP O_RIGHT))
  esac
))
}}}
