-(defun octave-reindent-then-newline-and-indent ()
- "Reindent current Octave line, insert newline, and indent the new line.
-If Abbrev mode is on, expand abbrevs first."
- ;; FIXME: None of this is Octave-specific.
- (interactive)
- (reindent-then-newline-and-indent))
-
-(defun octave-electric-semi ()
- "Insert a semicolon in Octave mode.
-Maybe expand abbrevs and blink matching block open keywords.
-Reindent the line if `octave-auto-indent' is non-nil.
-Insert a newline if `octave-auto-newline' is non-nil."
- (interactive)
- (setq last-command-event ?\;)
- (if (not (octave-not-in-string-or-comment-p))
- (self-insert-command 1)
- (if octave-auto-indent
- (indent-according-to-mode))
- (self-insert-command 1)
- (if octave-auto-newline
- (newline-and-indent))))
-
-(defun octave-electric-space ()
- "Insert a space in Octave mode.
-Maybe expand abbrevs and blink matching block open keywords.
-Reindent the line if `octave-auto-indent' is non-nil."
- (interactive)
- (setq last-command-event ? )
- (if (and octave-auto-indent
- (not (octave-not-in-string-or-comment-p)))
- (progn
- (indent-according-to-mode)
- (self-insert-command 1))
- (if (and octave-auto-indent
- (save-excursion
- (skip-syntax-backward " ")
- (not (bolp))))
- (indent-according-to-mode))
- (self-insert-command 1)))