diff options
author | David Aspinall <da@inf.ed.ac.uk> | 2000-05-26 18:08:17 +0000 |
---|---|---|
committer | David Aspinall <da@inf.ed.ac.uk> | 2000-05-26 18:08:17 +0000 |
commit | a8a4203ca93c5ac56b0570c06089040f8a570a5c (patch) | |
tree | 628153db79a051a0dbaf49f14e7b248ed666adbd /generic/proof-indent.el | |
parent | dacba6c398ece6ea00677ce77c7377dcf82aae23 (diff) |
Update to use generic option indent-line, and switch inside
function rather than mode (so can be turned on/off easily).
Diffstat (limited to 'generic/proof-indent.el')
-rw-r--r-- | generic/proof-indent.el | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/generic/proof-indent.el b/generic/proof-indent.el index 00ab6fc6..b93c39f7 100644 --- a/generic/proof-indent.el +++ b/generic/proof-indent.el @@ -83,24 +83,27 @@ ;;;###autoload (defun proof-indent-line () - "Indent current line of proof script" + "Indent current line of proof script, if indentation enabled." (interactive) - (if (< (point) (proof-locked-end)) - (if (< (current-column) (current-indentation)) - (skip-chars-forward "\t ")) - (save-excursion - (beginning-of-line) - (let* ((state (proof-parse-to-point)) - (beg (point)) - (indent (cond ((car state) 1) - ((> (nth 1 state) 0) 1) - (t (funcall proof-stack-to-indent (nth 2 state)))))) - (skip-chars-forward "\t ") - (if (not (eq (current-indentation) indent)) - (progn (delete-region beg (point)) - (indent-to indent))))) - (skip-chars-forward "\t "))) + (unless (not (proof-ass script-indent)) + (if (< (point) (proof-locked-end)) + (if (< (current-column) (current-indentation)) + (skip-chars-forward "\t ")) + (save-excursion + (beginning-of-line) + (let* ((state (proof-parse-to-point)) + (beg (point)) + (indent (cond + ((car state) 1) + ((> (nth 1 state) 0) 1) + (t (funcall proof-stack-to-indent (nth 2 state)))))) + (skip-chars-forward "\t ") + (if (not (eq (current-indentation) indent)) + (progn (delete-region beg (point)) + (indent-to indent))))) + (skip-chars-forward "\t "))) +;;;###autoload (defun proof-indent-region (start end) (interactive "r") (if (< (point) (proof-locked-end)) |