From: John Wiegley Date: Mon, 17 Jul 2000 06:33:36 +0000 (+0000) Subject: Added a new feature to align.el X-Git-Tag: emacs-pretest-21.0.90~2795 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6feeb380e8f3ba1b3be3328e2c565a382e61115b;p=emacs.git Added a new feature to align.el --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index db0a82d39b2..3a746723fba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2000-07-16 John Wiegley * international/kkc.el (kkc-show-conversion-list-count): Customize diff --git a/lisp/align.el b/lisp/align.el index d3195b44365..40c3decf8f2 100644 --- a/lisp/align.el +++ b/lisp/align.el @@ -1033,6 +1033,23 @@ to be colored." (setq align-highlight-overlays (cdr align-highlight-overlays)))) +;;;###autoload +(defun align-newline-and-indent () + "A replacement function for `newline-and-indent', aligning as it goes." + (interactive) + (let ((separate (or (if (symbolp align-region-separate) + (symbol-value align-region-separate) + align-region-separate) + 'entire)) + (end (point))) + (call-interactively 'newline-and-indent) + (save-excursion + (forward-line -1) + (while (not (or (bobp) + (align-new-section-p (point) end separate))) + (forward-line -1)) + (align (point) end)))) + ;;; Internal Functions: (defun align-match-tex-pattern (regexp end &optional reverse) @@ -1394,12 +1411,17 @@ aligner would have dealt with are." ;; are, if it's a very large region being ;; aligned (if report - (message - "Aligning `%s' [rule %d of %d] (%d%%)..." - (symbol-name (car rule)) - rule-index rule-count - (/ (* (- (point) real-beg) 100) - (- end-mark real-beg)))) + (let ((name (symbol-name (car rule)))) + (if name + (message + "Aligning `%s' (rule %d of %d) %d%%..." + rule-index rule-count + (/ (* (- (point) real-beg) 100) + (- end-mark real-beg))) + (message + "Aligning %d%%..." + (/ (* (- (point) real-beg) 100) + (- end-mark real-beg)))))) ;; if the search ended us on the beginning of ;; the next line, move back to the end of the