Commit e7d485f5 authored by David Byers's avatar David Byers

Fix error filling indented paragraphs

Detailed changes:
> 2006-04-25  David Byers  <davby@ida.liu.se>
>
> 	* lyskom-rest.el (lyskom-fill-next-paragraph): Fixed off-by-one
> 	error in handling indented paragraphs.
>
parent ebc358a9
2006-04-25 David Byers <davby@ida.liu.se>
* lyskom-rest.el (lyskom-fill-next-paragraph): Fixed off-by-one
error in handling indented paragraphs.
2006-04-25 Per Cederqvist <ceder@lysator.liu.se>
Get rid of compiler warning probably introduced 2006-04-05.
......
......@@ -2582,26 +2582,6 @@ or not."
(setq eol-point (save-excursion (end-of-line) (point)))
(setq paragraph-width (max paragraph-width (- eol-point (point))))
;; Handle geometric paragraphs
;;
;; Geometric paragraphs have constant differences in line
;; length. There is also a requirement of minimum size,
;; which is enforced in lyskom-maybe-fill-region
;;
(when geometric-text
(setq current-line-length (lyskom-fill-message-line-length))
(cond ((and (null length-difference)
current-line-length
last-line-length)
(setq length-difference (- current-line-length last-line-length)))
((and current-line-length
last-line-length
(/= (- current-line-length last-line-length)
length-difference))
(setq geometric-text nil))))
;;
;; Handle unconditional paragraph break (empty line)
;;
......@@ -2655,14 +2635,14 @@ or not."
;; - It can continue an all-colon line
;;
(when (looking-at "^\\s-+\\S-")
(when (looking-at "^\\(\\s-+\\)\\S-")
(cond (bulleted-paragraph (lyskom-fill-message-next-line))
((equal (match-string 0) indented-paragraph)
((equal (match-string 1) indented-paragraph)
(lyskom-fill-message-next-line))
((eq all-colon-lines t) (lyskom-fill-message-next-line))
((lyskom-maybe-fill-region start (1- (point)) nil t)
(lyskom-fill-message-return))
(t (setq indented-paragraph (match-string 0)))))
(t (setq indented-paragraph (match-string 1)))))
;;
;; If we have seen indentation, but don't see it now,
......@@ -2702,6 +2682,28 @@ or not."
(setq all-colon-lines t)
(setq all-colon-lines nil))
;; Handle geometric paragraphs
;;
;; Geometric paragraphs have constant differences in line
;; length. There is also a requirement of minimum size,
;; which is enforced in lyskom-maybe-fill-region
;;
(when geometric-text
(setq current-line-length (lyskom-fill-message-line-length))
(cond ((and (null length-difference)
current-line-length
last-line-length)
(setq length-difference (- current-line-length last-line-length)))
((and current-line-length
last-line-length
(/= (- current-line-length last-line-length)
length-difference))
(setq geometric-text nil))))
) ;; catch lyskom-fill-message-next-line
......
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