diff options
author | Marcin Borkowski <mbork@mbork.pl> | 2018-01-24 10:32:40 +0100 |
---|---|---|
committer | Marcin Borkowski <mbork@mbork.pl> | 2018-01-24 10:32:40 +0100 |
commit | 96de0503cd04f3cba7c4db94789b958e9775e2c6 (patch) | |
tree | 86a459aa1c5e2739034c7a69e2d74a1e75ac7090 /lisp/textmodes/fill.el | |
parent | 109da684c5124e22505917fe0255ca66f2a6bfc9 (diff) | |
parent | 521470987b198fcadff294a8e3c700be21b1a15c (diff) | |
download | emacs-96de0503cd04f3cba7c4db94789b958e9775e2c6.tar.gz |
Merge branch 'fix/bug-20871-cur'
Diffstat (limited to 'lisp/textmodes/fill.el')
-rw-r--r-- | lisp/textmodes/fill.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 7f9538fb569..08e975f2355 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -340,6 +340,18 @@ places." (and (memq (preceding-char) '(?\t ?\s)) (eq (char-syntax (following-char)) ?w))))))) +(defun fill-polish-nobreak-p () + "Return nil if Polish style allows breaking the line at point. +This function may be used in the `fill-nobreak-predicate' hook. +It is almost the same as `fill-single-char-nobreak-p', with the +exception that it does not require the one-letter word to be +preceded by a space. This blocks line-breaking in cases like +\"(a jednak)\"." + (save-excursion + (skip-chars-backward " \t") + (backward-char 2) + (looking-at "[^[:alpha:]]\\cl"))) + (defun fill-single-char-nobreak-p () "Return non-nil if a one-letter word is before point. This function is suitable for adding to the hook `fill-nobreak-predicate', |