Function: simula-indent-command
simula-indent-command is an interactive and byte-compiled function
defined in simula.el.gz.
This command is obsolete since 28.1; use indent-for-tab-command
instead.
Signature
(simula-indent-command &optional WHOLE-EXP)
Documentation
Indent current line as SIMULA code, or insert TAB character.
If simula-tab-always-indent is non-nil, always indent current line.
Otherwise, indent only if point is before any non-whitespace
character on the line.
A numeric argument, regardless of its value, means indent rigidly all the lines of the SIMULA statement after point so that this line becomes properly indented. The relative indentation among the lines of the statement are preserved.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/simula.el.gz
(defun simula-indent-command (&optional whole-exp)
"Indent current line as SIMULA code, or insert TAB character.
If `simula-tab-always-indent' is non-nil, always indent current line.
Otherwise, indent only if point is before any non-whitespace
character on the line.
A numeric argument, regardless of its value, means indent rigidly
all the lines of the SIMULA statement after point so that this line
becomes properly indented.
The relative indentation among the lines of the statement are preserved."
(declare (obsolete indent-for-tab-command "28.1"))
(interactive "P")
(let ((case-fold-search t))
(if (or whole-exp simula-tab-always-indent
(save-excursion
(skip-chars-backward " \t\f")
(bolp)))
;; reindent current line
(let ((indent (save-excursion
(beginning-of-line)
(simula-calculate-indent)))
(current (current-indentation))
(origin (- (point-max) (point)))
(bol (save-excursion
(skip-chars-backward " \t\f")
(bolp)))
beg end)
(unwind-protect
(if (eq current indent)
(if (save-excursion
(skip-chars-backward " \t\f")
(bolp))
(back-to-indentation))
(beginning-of-line)
(delete-horizontal-space)
(indent-to indent))
(if (not bol)
(goto-char (- (point-max) origin))))
(setq origin (point))
(if whole-exp
(save-excursion
(beginning-of-line 2)
(setq beg (point))
(goto-char origin)
(simula-next-statement 1)
(setq end (point))
(if (and (> end beg) (not (eq indent current)))
(indent-code-rigidly beg end (- indent current) "%")))))
(insert-tab))))