aboutsummaryrefslogtreecommitdiffhomepage
path: root/generic/proof-indent.el
diff options
context:
space:
mode:
authorGravatar David Aspinall <da@inf.ed.ac.uk>2003-04-05 15:34:38 +0000
committerGravatar David Aspinall <da@inf.ed.ac.uk>2003-04-05 15:34:38 +0000
commite87005f433c39d5d797ab3866a88420c594abefe (patch)
treebeee350812f9ae56d9bc98e5d965451064c35a49 /generic/proof-indent.el
parent4de2228bd7f39bdce86035fdbc69703f228e9f02 (diff)
Add proof-indent-pad-eol to add useless spaces
Diffstat (limited to 'generic/proof-indent.el')
-rw-r--r--generic/proof-indent.el41
1 files changed, 39 insertions, 2 deletions
diff --git a/generic/proof-indent.el b/generic/proof-indent.el
index ffcf6510..22ff742c 100644
--- a/generic/proof-indent.el
+++ b/generic/proof-indent.el
@@ -1,6 +1,6 @@
;; proof-indent.el Generic Indentation for Proof Assistants
;;
-;; Authors: Markus Wenzel
+;; Authors: Markus Wenzel, David Aspinall
;; License: GPL (GNU GENERAL PUBLIC LICENSE)
;;
;; $Id$
@@ -84,7 +84,44 @@
(back-to-indentation)
(proof-indent-calculate (proof-indent-offset) (proof-indent-inner-p))))))
(if (< (current-column) (current-indentation))
- (back-to-indentation)))))
+ (back-to-indentation))))
+ (if proof-indent-pad-eol
+ (proof-indent-pad-eol)))
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Useless spaces
+;;
+
+(defun proof-indent-pad-eol (&optional col)
+ "Add padding to end of current line to match the previous line or COL.
+This function adds useless space to buffers, but it cleans up the appearance
+of locked regions in XEmacs."
+ ;; A hook for TAB?
+ (interactive)
+ (save-excursion
+ (let ((descol (or col
+ (save-excursion
+ (end-of-line 0)
+ (current-column)))))
+ (save-excursion
+ (end-of-line 1)
+ (if (or (equal (current-column) 0) ;; special case for empty lines
+ (> descol (current-column)))
+ (progn
+ (insert-char ?\ (- descol (current-column)))))))))
+
+(defun proof-indent-pad-eol-region (start end)
+ "Pad a region with extra spaces to the length of the longest line."
+ (interactive)
+ ;; Find the longest line..
+ ;; pad others to the same length
+ )
+
+
+