aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Wiegley2000-07-17 06:33:36 +0000
committerJohn Wiegley2000-07-17 06:33:36 +0000
commit6feeb380e8f3ba1b3be3328e2c565a382e61115b (patch)
tree21f7e185925bd92668dbb8329c4e6d1b88391db6
parent7a3fd467589e4a263726aad8652c9d9ca8cfa380 (diff)
downloademacs-6feeb380e8f3ba1b3be3328e2c565a382e61115b.tar.gz
emacs-6feeb380e8f3ba1b3be3328e2c565a382e61115b.zip
Added a new feature to align.el
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/align.el34
2 files changed, 34 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index db0a82d39b2..3a746723fba 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12000-07-16 John Wiegley <johnw@gnu.org.
2
3 * lisp/align.el (align-newline-and-indent): Adding new function
4 for auto-aligning blocks of code on RET.
5 (align-region): Fixed badly formatted minibuffer message.
6
12000-07-17 Kenichi Handa <handa@etl.go.jp> 72000-07-17 Kenichi Handa <handa@etl.go.jp>
2 8
3 * international/kkc.el (kkc-show-conversion-list-count): Customize 9 * 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."
1033 (setq align-highlight-overlays 1033 (setq align-highlight-overlays
1034 (cdr align-highlight-overlays)))) 1034 (cdr align-highlight-overlays))))
1035 1035
1036;;;###autoload
1037(defun align-newline-and-indent ()
1038 "A replacement function for `newline-and-indent', aligning as it goes."
1039 (interactive)
1040 (let ((separate (or (if (symbolp align-region-separate)
1041 (symbol-value align-region-separate)
1042 align-region-separate)
1043 'entire))
1044 (end (point)))
1045 (call-interactively 'newline-and-indent)
1046 (save-excursion
1047 (forward-line -1)
1048 (while (not (or (bobp)
1049 (align-new-section-p (point) end separate)))
1050 (forward-line -1))
1051 (align (point) end))))
1052
1036;;; Internal Functions: 1053;;; Internal Functions:
1037 1054
1038(defun align-match-tex-pattern (regexp end &optional reverse) 1055(defun align-match-tex-pattern (regexp end &optional reverse)
@@ -1394,12 +1411,17 @@ aligner would have dealt with are."
1394 ;; are, if it's a very large region being 1411 ;; are, if it's a very large region being
1395 ;; aligned 1412 ;; aligned
1396 (if report 1413 (if report
1397 (message 1414 (let ((name (symbol-name (car rule))))
1398 "Aligning `%s' [rule %d of %d] (%d%%)..." 1415 (if name
1399 (symbol-name (car rule)) 1416 (message
1400 rule-index rule-count 1417 "Aligning `%s' (rule %d of %d) %d%%..."
1401 (/ (* (- (point) real-beg) 100) 1418 rule-index rule-count
1402 (- end-mark real-beg)))) 1419 (/ (* (- (point) real-beg) 100)
1420 (- end-mark real-beg)))
1421 (message
1422 "Aligning %d%%..."
1423 (/ (* (- (point) real-beg) 100)
1424 (- end-mark real-beg))))))
1403 1425
1404 ;; if the search ended us on the beginning of 1426 ;; if the search ended us on the beginning of
1405 ;; the next line, move back to the end of the 1427 ;; the next line, move back to the end of the