diff options
| author | Glenn Morris | 2014-01-27 21:50:16 -0500 |
|---|---|---|
| committer | Glenn Morris | 2014-01-27 21:50:16 -0500 |
| commit | 793ffe819539d4f642631910598b9c8dc696ec38 (patch) | |
| tree | 427e29742730ec5e9487a9795c4138ba8d93115b | |
| parent | afc123c7bfa0f8a88b52c1caa4f1b996e64fbe41 (diff) | |
| download | emacs-793ffe819539d4f642631910598b9c8dc696ec38.tar.gz emacs-793ffe819539d4f642631910598b9c8dc696ec38.zip | |
Doc for fill-single-char-nobreak-p
* doc/emacs/text.texi (Fill Commands): Mention fill-single-char-nobreak-p.
* lisp/textmodes/fill.el (fill-single-char-nobreak-p): Doc tweak.
* etc/NEWS: Related edit.
| -rw-r--r-- | doc/emacs/ChangeLog | 2 | ||||
| -rw-r--r-- | doc/emacs/text.texi | 7 | ||||
| -rw-r--r-- | etc/NEWS | 7 | ||||
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/textmodes/fill.el | 8 |
5 files changed, 15 insertions, 11 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index ba6430c4826..9cc901b87a2 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2014-01-28 Glenn Morris <rgm@gnu.org> | 1 | 2014-01-28 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * text.texi (Fill Commands): Mention fill-single-char-nobreak-p. | ||
| 4 | |||
| 3 | * indent.texi (Tab Stops): Updates for new tab-stop behavior. | 5 | * indent.texi (Tab Stops): Updates for new tab-stop behavior. |
| 4 | 6 | ||
| 5 | 2014-01-27 Glenn Morris <rgm@gnu.org> | 7 | 2014-01-27 Glenn Morris <rgm@gnu.org> |
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index 4d19ddbf1a6..1d30740467e 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi | |||
| @@ -562,10 +562,11 @@ customize the abnormal hook variable @code{fill-nobreak-predicate} | |||
| 562 | (@pxref{Hooks}). Each function in this hook is called with no | 562 | (@pxref{Hooks}). Each function in this hook is called with no |
| 563 | arguments, with point positioned where Emacs is considering breaking a | 563 | arguments, with point positioned where Emacs is considering breaking a |
| 564 | line. If a function returns a non-@code{nil} value, Emacs will not | 564 | line. If a function returns a non-@code{nil} value, Emacs will not |
| 565 | break the line there. Two functions you can use are | 565 | break the line there. Functions you can use there include: |
| 566 | @code{fill-single-word-nobreak-p} (don't break after the first word of | 566 | @code{fill-single-word-nobreak-p} (don't break after the first word of |
| 567 | a sentence or before the last) and @code{fill-french-nobreak-p} (don't | 567 | a sentence or before the last); @code{fill-single-char-nobreak-p} |
| 568 | break after @samp{(} or before @samp{)}, @samp{:} or @samp{?}). | 568 | (don't break after a one-letter word); and @code{fill-french-nobreak-p} |
| 569 | (don't break after @samp{(} or before @samp{)}, @samp{:} or @samp{?}). | ||
| 569 | 570 | ||
| 570 | @node Fill Prefix | 571 | @node Fill Prefix |
| 571 | @subsection The Fill Prefix | 572 | @subsection The Fill Prefix |
| @@ -280,11 +280,10 @@ having just one space, no spaces, or reverting to the original | |||
| 280 | spacing. Like `just-one-space', it can handle or ignore newlines and | 280 | spacing. Like `just-one-space', it can handle or ignore newlines and |
| 281 | leave different number of spaces. | 281 | leave different number of spaces. |
| 282 | 282 | ||
| 283 | +++ | ||
| 283 | *** `fill-single-char-nobreak-p' prevents fill from breaking a line after | 284 | *** `fill-single-char-nobreak-p' prevents fill from breaking a line after |
| 284 | a 1-letter word, which is an error according to Polish and | 285 | a one-letter word, which is an error according to some rules of typography. |
| 285 | Czech typography rules. To globally enable this feature, evaluate: | 286 | To use it, add it to the `fill-nobreak-predicate' hook. |
| 286 | |||
| 287 | (add-hook 'fill-nobreak-predicate 'fill-single-char-nobreak-p) | ||
| 288 | 287 | ||
| 289 | +++ | 288 | +++ |
| 290 | ** Uniquify is enabled by default, with `post-forward-angle-brackets' style. | 289 | ** Uniquify is enabled by default, with `post-forward-angle-brackets' style. |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a9a5e6eb3b0..fd0d60923e9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2014-01-28 Glenn Morris <rgm@gnu.org> | 1 | 2014-01-28 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * textmodes/fill.el (fill-single-char-nobreak-p): Doc tweak. | ||
| 4 | |||
| 3 | * indent.el (tab-stop-list): Doc fix. Add :version. | 5 | * indent.el (tab-stop-list): Doc fix. Add :version. |
| 4 | 6 | ||
| 5 | * vc/pcvs.el (vc-editable-p, vc-checkout): Remove unused declarations. | 7 | * vc/pcvs.el (vc-editable-p, vc-checkout): Remove unused declarations. |
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 35cc5320250..dac74e758fa 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el | |||
| @@ -330,10 +330,10 @@ places." | |||
| 330 | (eq (char-syntax (following-char)) ?w))))))) | 330 | (eq (char-syntax (following-char)) ?w))))))) |
| 331 | 331 | ||
| 332 | (defun fill-single-char-nobreak-p () | 332 | (defun fill-single-char-nobreak-p () |
| 333 | "Return t if point is placed just after a 1-letter word. | 333 | "Return non-nil if a one-letter word is before point. |
| 334 | This is used in `fill-nobreak-predicate' to prevent breaking line just | 334 | This function is suitable for adding to the hook `fill-nobreak-predicate', |
| 335 | after a 1-letter word (usually conjunction or preposition) which is | 335 | to prevent the breaking of a line just after a one-letter word, |
| 336 | considered composition error in Polish and Czech typography." | 336 | which is an error according to some rules of typography." |
| 337 | (save-excursion | 337 | (save-excursion |
| 338 | (skip-chars-backward " \t") | 338 | (skip-chars-backward " \t") |
| 339 | (backward-char 2) | 339 | (backward-char 2) |