Commit 4c06fbee authored by Karl Heuer's avatar Karl Heuer
Browse files

(lisp-fill-paragraph): When filling a comment,

find paragraph bounds by hand, and pass the SQUEEZE-AFTER arg
to fill-region-as-paragraph.
parent c7edd03c
......@@ -740,6 +740,7 @@ and initial semicolons."
(fill-paragraph justify)
;; Narrow to include only the comment, and then fill the region.
(save-excursion
(save-restriction
(beginning-of-line)
(narrow-to-region
......@@ -758,10 +759,23 @@ and initial semicolons."
(point)))
;; Lines with only semicolons on them can be paragraph boundaries.
(let ((paragraph-start (concat paragraph-start "\\|[ \t;]*$"))
(let* ((paragraph-start (concat paragraph-start "\\|[ \t;]*$"))
(paragraph-separate (concat paragraph-start "\\|[ \t;]*$"))
(fill-prefix comment-fill-prefix))
(fill-paragraph justify))))
(paragraph-ignore-fill-prefix nil)
(fill-prefix comment-fill-prefix)
(end (progn
(forward-paragraph)
(or (bolp) (newline 1))
(point)))
(beg (progn (backward-paragraph) (point))))
(fill-region-as-paragraph beg end
justify nil
(save-excursion
(goto-char beg)
(if (looking-at fill-prefix)
nil
(re-search-forward comment-start-skip)
(point))))))))
t))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment