316 |
:type 'hook |
:type 'hook |
317 |
:options '(fill-french-nobreak-p fill-single-word-nobreak-p)) |
:options '(fill-french-nobreak-p fill-single-word-nobreak-p)) |
318 |
|
|
319 |
|
(defcustom fill-nobreak-invisible nil |
320 |
|
"Non-nil means that fill command do not break lines in invisible text." |
321 |
|
:type 'boolean |
322 |
|
:group 'fill) |
323 |
|
|
324 |
(defun fill-nobreak-p () |
(defun fill-nobreak-p () |
325 |
"Return nil if breaking the line at point is allowed. |
"Return nil if breaking the line at point is allowed. |
326 |
Can be customized with the variable `fill-nobreak-predicate'." |
Can be customized with the variables `fill-nobreak-predicate' |
327 |
(unless (bolp) |
and `fill-nobreak-invisible'." |
328 |
|
(or |
329 |
|
(and fill-nobreak-invisible (line-move-invisible (point))) |
330 |
|
(unless (bolp) |
331 |
(or |
(or |
332 |
;; Don't break after a period followed by just one space. |
;; Don't break after a period followed by just one space. |
333 |
;; Move back to the previous place to break. |
;; Move back to the previous place to break. |
348 |
(unless use-hard-newlines |
(unless use-hard-newlines |
349 |
(save-excursion |
(save-excursion |
350 |
(skip-chars-forward " \t") (looking-at paragraph-start))) |
(skip-chars-forward " \t") (looking-at paragraph-start))) |
351 |
(run-hook-with-args-until-success 'fill-nobreak-predicate)))) |
(run-hook-with-args-until-success 'fill-nobreak-predicate))))) |
352 |
|
|
353 |
;; Put `fill-find-break-point-function' property to charsets which |
;; Put `fill-find-break-point-function' property to charsets which |
354 |
;; require special functions to find line breaking point. |
;; require special functions to find line breaking point. |
533 |
;; Give newline the properties of the space(s) it replaces |
;; Give newline the properties of the space(s) it replaces |
534 |
(set-text-properties (1- (point)) (point) |
(set-text-properties (1- (point)) (point) |
535 |
(text-properties-at (point))) |
(text-properties-at (point))) |
536 |
|
;; If we don't want breaks in invisible text, don't insert |
537 |
|
;; an invisible newline. |
538 |
|
(if fill-nobreak-invisible |
539 |
|
(remove-text-properties (1- (point)) (point) |
540 |
|
'(invisible t))) |
541 |
(if (or fill-prefix |
(if (or fill-prefix |
542 |
(not fill-indent-according-to-mode)) |
(not fill-indent-according-to-mode)) |
543 |
(indent-to-left-margin) |
(indent-to-left-margin) |