aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichal Nazarewicz2013-11-03 23:29:59 -0500
committerStefan Monnier2013-11-03 23:29:59 -0500
commit0a749fa0e64fc88bcd1772253774d7e44ecfe8ce (patch)
tree214a0cfeb1f5759ffcedd2940ec7852d86920412 /lisp
parentec79b92bfa0b040917a8f3250fe2f819cd8d92db (diff)
downloademacs-0a749fa0e64fc88bcd1772253774d7e44ecfe8ce.tar.gz
emacs-0a749fa0e64fc88bcd1772253774d7e44ecfe8ce.zip
* lisp/textmodes/fill.el (fill-single-char-nobreak-p): New function
checking whether point is after a 1-letter word.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/textmodes/fill.el13
2 files changed, 18 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fb4f29befe1..9ff4ab8f04c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,4 +1,9 @@
12013-11-03 Nathan Trapuzzano <nbtrap@nbtrap.com> (tiny change) 12013-11-04 Michal Nazarewicz <mina86@mina86.com>
2
3 * textmodes/fill.el (fill-single-char-nobreak-p): New function
4 checking whether point is after a 1-letter word.
5
62013-11-04 Nathan Trapuzzano <nbtrap@nbtrap.com> (tiny change)
2 7
3 * progmodes/cperl-mode.el (cperl-font-lock-fontify-region-function): 8 * progmodes/cperl-mode.el (cperl-font-lock-fontify-region-function):
4 Don't infloop when expanding region over `multiline' syntax-type that 9 Don't infloop when expanding region over `multiline' syntax-type that
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 119b4b04593..73b9362da76 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -329,13 +329,24 @@ places."
329 (and (memq (preceding-char) '(?\t ?\s)) 329 (and (memq (preceding-char) '(?\t ?\s))
330 (eq (char-syntax (following-char)) ?w))))))) 330 (eq (char-syntax (following-char)) ?w)))))))
331 331
332(defun fill-single-char-nobreak-p ()
333 "Return t if point is placed just after a 1-letter word.
334This is used in `fill-nobreak-predicate' to prevent breaking line just
335after a 1-letter word (usually conjunction or preposition) which is
336considered composition error in Polish and Czech typography."
337 (save-excursion
338 (skip-chars-backward " \t")
339 (backward-char 2)
340 (looking-at "[[:space:]][[:alpha:]]")))
341
332(defcustom fill-nobreak-predicate nil 342(defcustom fill-nobreak-predicate nil
333 "List of predicates for recognizing places not to break a line. 343 "List of predicates for recognizing places not to break a line.
334The predicates are called with no arguments, with point at the place to 344The predicates are called with no arguments, with point at the place to
335be tested. If it returns t, fill commands do not break the line there." 345be tested. If it returns t, fill commands do not break the line there."
336 :group 'fill 346 :group 'fill
337 :type 'hook 347 :type 'hook
338 :options '(fill-french-nobreak-p fill-single-word-nobreak-p)) 348 :options '(fill-french-nobreak-p fill-single-word-nobreak-p
349 fill-single-char-nobreak-p))
339 350
340(defcustom fill-nobreak-invisible nil 351(defcustom fill-nobreak-invisible nil
341 "Non-nil means that fill commands do not break lines in invisible text." 352 "Non-nil means that fill commands do not break lines in invisible text."