Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
0a749fa0
Commit
0a749fa0
authored
Nov 03, 2013
by
Michal Nazarewicz
Committed by
Stefan Monnier
Nov 03, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* lisp/textmodes/fill.el (fill-single-char-nobreak-p): New function
checking whether point is after a 1-letter word.
parent
ec79b92b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
etc/NEWS
etc/NEWS
+6
-0
lisp/ChangeLog
lisp/ChangeLog
+6
-1
lisp/textmodes/fill.el
lisp/textmodes/fill.el
+12
-1
No files found.
etc/NEWS
View file @
0a749fa0
...
...
@@ -180,6 +180,12 @@ some enhancements, like the ability to restore deleted frames. Command
** The default value of `comment-use-global-state' is changed to t,
and this variable has been marked obsolete.
** `fill-single-char-nobreak-p' prevents fill from breaking a line after
a 1-letter word, which is an error according to Polish and
Czech typography rules. To globally enable this feature, evaluate:
(add-hook 'fill-nobreak-predicate 'fill-single-char-nobreak-p)
*
Editing Changes in Emacs 24.4
...
...
lisp/ChangeLog
View file @
0a749fa0
2013-11-03 Nathan Trapuzzano <nbtrap@nbtrap.com> (tiny change)
2013-11-04 Michal Nazarewicz <mina86@mina86.com>
* textmodes/fill.el (fill-single-char-nobreak-p): New function
checking whether point is after a 1-letter word.
2013-11-04 Nathan Trapuzzano <nbtrap@nbtrap.com> (tiny change)
* progmodes/cperl-mode.el (cperl-font-lock-fontify-region-function):
Don't infloop when expanding region over `multiline' syntax-type that
...
...
lisp/textmodes/fill.el
View file @
0a749fa0
...
...
@@ -329,13 +329,24 @@ places."
(
and
(
memq
(
preceding-char
)
'
(
?\t
?\s
))
(
eq
(
char-syntax
(
following-char
))
?w
)))))))
(
defun
fill-single-char-nobreak-p
()
"Return t if point is placed just after a 1-letter word.
This is used in `fill-nobreak-predicate' to prevent breaking line just
after a 1-letter word (usually conjunction or preposition) which is
considered composition error in Polish and Czech typography."
(
save-excursion
(
skip-chars-backward
" \t"
)
(
backward-char
2
)
(
looking-at
"[[:space:]][[:alpha:]]"
)))
(
defcustom
fill-nobreak-predicate
nil
"List of predicates for recognizing places not to break a line.
The predicates are called with no arguments, with point at the place to
be tested. If it returns t, fill commands do not break the line there."
:group
'fill
:type
'hook
:options
'
(
fill-french-nobreak-p
fill-single-word-nobreak-p
))
:options
'
(
fill-french-nobreak-p
fill-single-word-nobreak-p
fill-single-char-nobreak-p
))
(
defcustom
fill-nobreak-invisible
nil
"Non-nil means that fill commands do not break lines in invisible text."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment