Mercurial > emacs
comparison lisp/woman.el @ 73374:959e3f79c94d
* woman.el (woman2-format-paragraphs): Avoid infinite loop in case
there is no terminating newline.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sun, 15 Oct 2006 19:13:44 +0000 |
parents | 5d2e9706764f |
children | b2e5081b9320 7eeafaaa9eab |
comparison
equal
deleted
inserted
replaced
73373:052270c7f73d | 73374:959e3f79c94d |
---|---|
4119 (and (re-search-forward "\\(^\\s *$\\)\\|\\(^\\s +\\)" to 1) | 4119 (and (re-search-forward "\\(^\\s *$\\)\\|\\(^\\s +\\)" to 1) |
4120 ;; A blank line should leave a space like .sp 1 (p. 14). | 4120 ;; A blank line should leave a space like .sp 1 (p. 14). |
4121 (eolp) | 4121 (eolp) |
4122 (skip-syntax-forward " ") | 4122 (skip-syntax-forward " ") |
4123 (setq woman-leave-blank-lines 1)) | 4123 (setq woman-leave-blank-lines 1)) |
4124 (beginning-of-line) | 4124 ;; This shouldn't happen, but in case it does (e.g. for |
4125 ;; badly-formatted manfiles with no terminating newline), | |
4126 ;; avoid an infinite loop. | |
4127 (unless (and (eolp) (eobp)) | |
4128 (beginning-of-line)) | |
4125 ;; If a single short line then just leave it. | 4129 ;; If a single short line then just leave it. |
4126 ;; This is necessary to preserve some table layouts. | 4130 ;; This is necessary to preserve some table layouts. |
4127 ;; PROBABLY NOT NECESSARY WITH SQUEEZE MODIFICATION !!!!! | 4131 ;; PROBABLY NOT NECESSARY WITH SQUEEZE MODIFICATION !!!!! |
4128 (if (or (> (count-lines from (point)) 1) | 4132 (if (or (> (count-lines from (point)) 1) |
4129 (save-excursion | 4133 (save-excursion |