Octave

Some customizations for the GNU Octave programming language and shell.

octaverc

I have a custom octaverc for use in emacs. It looks like this:

source("~/.octaverc")

Configuration

(use-package octave
  :config
  <<do.octave/startup>>
  <<do.octave/settings>>
  <<do.octave/hooks>>)

Startup

(setq
 inferior-octave-startup-file (concat initel-directory "random/emacs-octaverc")
 inferior-octave-startup-args '("-q" "--no-gui"))

Settings

(setq
 octave-blink-matching-block t
 octave-block-offset 4
 octave-continuation-offset 4
 octave-continuation-string "\\"
 octave-send-echo-input t
 octave-send-line-auto-forward t)

Hooks

(defun do.octave/hooks ()
  (turn-on-font-lock)
  (setq-local ml-interactive? t)
  (define-key inferior-octave-mode-map [up]
    'comint-previous-input)
  (define-key inferior-octave-mode-map [down]
    'comint-next-input))
(add-hook 'inferior-octave-mode-hook #'do.octave/hooks)