diff options
| author | Richard M. Stallman | 1998-08-08 21:31:12 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-08-08 21:31:12 +0000 |
| commit | eeb0f327362c6b1d12a0b1396e8c183d2ef4792a (patch) | |
| tree | d92c2a2aa7275c8df199893d2b65f1f92d1abde9 | |
| parent | 20cf0008edbf0a0bf1186adaeaf52b471f62e80a (diff) | |
| download | emacs-eeb0f327362c6b1d12a0b1396e8c183d2ef4792a.tar.gz emacs-eeb0f327362c6b1d12a0b1396e8c183d2ef4792a.zip | |
(forward-paragraph): Fix the logic for handling beginning of buffer
in the "no fill-prefix" case.
| -rw-r--r-- | lisp/textmodes/paragraphs.el | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index c0199b435df..d647419d123 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el | |||
| @@ -184,7 +184,7 @@ to which the end of the previous line belongs, or the end of the buffer." | |||
| 184 | paragraph-separate)) | 184 | paragraph-separate)) |
| 185 | ;; This is used for searching. | 185 | ;; This is used for searching. |
| 186 | (sp-paragraph-start (concat "^[ \t]*\\(" paragraph-start "\\)")) | 186 | (sp-paragraph-start (concat "^[ \t]*\\(" paragraph-start "\\)")) |
| 187 | start) | 187 | start found-start) |
| 188 | (while (and (< arg 0) (not (bobp))) | 188 | (while (and (< arg 0) (not (bobp))) |
| 189 | (if (and (not (looking-at paragraph-separate)) | 189 | (if (and (not (looking-at paragraph-separate)) |
| 190 | (re-search-backward "^\n" (max (1- (point)) (point-min)) t) | 190 | (re-search-backward "^\n" (max (1- (point)) (point-min)) t) |
| @@ -223,18 +223,21 @@ to which the end of the previous line belongs, or the end of the buffer." | |||
| 223 | ;;; (forward-line 1)) | 223 | ;;; (forward-line 1)) |
| 224 | (not (bobp))) | 224 | (not (bobp))) |
| 225 | (while (and (re-search-backward sp-paragraph-start nil 1) | 225 | (while (and (re-search-backward sp-paragraph-start nil 1) |
| 226 | (setq found-start t) | ||
| 226 | ;; Found a candidate, but need to check if it is a | 227 | ;; Found a candidate, but need to check if it is a |
| 227 | ;; REAL paragraph-start. | 228 | ;; REAL paragraph-start. |
| 228 | (not (bobp)) | ||
| 229 | (progn (setq start (point)) | 229 | (progn (setq start (point)) |
| 230 | (move-to-left-margin) | 230 | (move-to-left-margin) |
| 231 | (not (looking-at paragraph-separate))) | 231 | (not (looking-at paragraph-separate))) |
| 232 | (or (not (looking-at paragraph-start)) | 232 | (not (and (looking-at paragraph-start) |
| 233 | (and use-hard-newlines | 233 | (not |
| 234 | (not (get-text-property (1- start) | 234 | (and use-hard-newlines |
| 235 | 'hard))))) | 235 | (not (bobp)) |
| 236 | (not (get-text-property (1- start) | ||
| 237 | 'hard))))))) | ||
| 238 | (setq found-start nil) | ||
| 236 | (goto-char start)) | 239 | (goto-char start)) |
| 237 | (> (point) (point-min))) | 240 | found-start) |
| 238 | ;; Found one. | 241 | ;; Found one. |
| 239 | (progn | 242 | (progn |
| 240 | ;; Move forward over paragraph separators. | 243 | ;; Move forward over paragraph separators. |