diff options
| author | Stefan Monnier | 2006-09-06 16:35:18 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2006-09-06 16:35:18 +0000 |
| commit | 4a3608f5045e534b19020fc4767b7635ebc8d3e4 (patch) | |
| tree | 4ed70d4c1a660ed07269afe128530d177f5bdcc9 | |
| parent | e959542d9950f0ae7d85df9811758eb7b747746c (diff) | |
| download | emacs-4a3608f5045e534b19020fc4767b7635ebc8d3e4.tar.gz emacs-4a3608f5045e534b19020fc4767b7635ebc8d3e4.zip | |
(fill-single-word-nobreak-p): Allow breaking before
last word, if it's not the end of the paragraph.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/textmodes/fill.el | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 55fa2cf011b..1c75e6ec602 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2006-09-06 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2006-09-06 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * textmodes/fill.el (fill-single-word-nobreak-p): Allow breaking before | ||
| 4 | last word, if it's not the end of the paragraph. | ||
| 5 | |||
| 3 | * files.el (abbreviate-file-name): Don't mistakenly match newlines in | 6 | * files.el (abbreviate-file-name): Don't mistakenly match newlines in |
| 4 | file name. | 7 | file name. |
| 5 | 8 | ||
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 95f73b56952..af97ca83e6e 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el | |||
| @@ -292,7 +292,9 @@ act as a paragraph-separator." | |||
| 292 | 292 | ||
| 293 | (defun fill-single-word-nobreak-p () | 293 | (defun fill-single-word-nobreak-p () |
| 294 | "Don't break a line after the first or before the last word of a sentence." | 294 | "Don't break a line after the first or before the last word of a sentence." |
| 295 | (or (looking-at (concat "[ \t]*\\sw+" "\\(?:" (sentence-end) "\\)")) | 295 | ;; Actually, allow breaking before the last word of a sentence, so long as |
| 296 | ;; it's not the last word of the paragraph. | ||
| 297 | (or (looking-at (concat "[ \t]*\\sw+" "\\(?:" (sentence-end) "\\)[ \t]*$")) | ||
| 296 | (save-excursion | 298 | (save-excursion |
| 297 | (skip-chars-backward " \t") | 299 | (skip-chars-backward " \t") |
| 298 | (and (/= (skip-syntax-backward "w") 0) | 300 | (and (/= (skip-syntax-backward "w") 0) |