From e87005f433c39d5d797ab3866a88420c594abefe Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Sat, 5 Apr 2003 15:34:38 +0000 Subject: Add proof-indent-pad-eol to add useless spaces --- generic/proof-indent.el | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) (limited to 'generic/proof-indent.el') 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 + ) + + + -- cgit v1.2.3