changeset 13505:86470b361571

(change-log-mode): Remove incorrect "^" anchors from paragraph-start and -separate. (change-log-fill-paragraph): Use regular value of paragraph-start to bound paragraph to be filled, modified values only to do the filling. Make lines beginning with parentheses paragraph-starters, but not paragraph-separators.
author Richard M. Stallman <rms@gnu.org>
date Sat, 11 Nov 1995 05:33:37 +0000
parents 1319330ca7ff
children 6360f5543071
files lisp/add-log.el
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/add-log.el	Sat Nov 11 05:32:13 1995 +0000
+++ b/lisp/add-log.el	Sat Nov 11 05:33:37 1995 +0000
@@ -282,8 +282,10 @@
 	fill-column 74)
   (use-local-map change-log-mode-map)
   ;; Let each entry behave as one paragraph:
-  (set (make-local-variable 'paragraph-start) "^\\s *$\\|^\f")
-  (set (make-local-variable 'paragraph-separate) "^\\s *$\\|^\f\\|^\\sw")
+  ;; We really do want "^" in paragraph-start below: it is only the lines that
+  ;; begin at column 0 (despite the left-margin of 8) that we are looking for.
+  (set (make-local-variable 'paragraph-start) "\\s *$\\|\f\\|^\\sw")
+  (set (make-local-variable 'paragraph-separate) "\\s *$\\|\f\\|^\\sw")
   ;; Let all entries for one day behave as one page.
   ;; Match null string on the date-line so that the date-line
   ;; is grouped with what follows.
@@ -302,9 +304,10 @@
   "Fill the paragraph, but preserve open parentheses at beginning of lines.
 Prefix arg means justify as well."
   (interactive "P")
-  (let ((paragraph-separate (concat paragraph-separate "\\|^\\s *\\s("))
-	(paragraph-start (concat paragraph-start "\\|^\\s *\\s(")))
-    (fill-paragraph justify)))
+  (let ((end (save-excursion (forward-paragraph) (point)))
+	(beg (save-excursion (backward-paragraph)(point)))
+	(paragraph-start (concat paragraph-start "\\|\\s *\\s(")))
+    (fill-region beg end justify)))
 
 (defvar add-log-current-defun-header-regexp
   "^\\([A-Z][A-Z_ ]*[A-Z_]\\|[-_a-zA-Z]+\\)[ \t]*[:=]"