163 |
;; This is quick, but loses when a tab follows the end of a sentence. |
;; This is quick, but loses when a tab follows the end of a sentence. |
164 |
;; Actually, it is difficult to tell that from "Mr.\tSmith". |
;; Actually, it is difficult to tell that from "Mr.\tSmith". |
165 |
;; Blame the typist. |
;; Blame the typist. |
166 |
(subst-char-in-region beg end ?\t ?\ ) |
(subst-char-in-region beg end ?\t ?\s) |
167 |
(while (and (< (point) end) |
(while (and (< (point) end) |
168 |
(re-search-forward end-spc-re end t)) |
(re-search-forward end-spc-re end t)) |
169 |
(delete-region |
(delete-region |
282 |
(string-match comment-start-skip |
(string-match comment-start-skip |
283 |
first-line-prefix))) |
first-line-prefix))) |
284 |
first-line-prefix |
first-line-prefix |
285 |
(make-string (string-width first-line-prefix) ?\ )))) |
(make-string (string-width first-line-prefix) ?\s)))) |
286 |
;; But either way, reject it if it indicates the start |
;; But either way, reject it if it indicates the start |
287 |
;; of a paragraph when text follows it. |
;; of a paragraph when text follows it. |
288 |
(if (not (eq 0 (string-match paragraph-start |
(if (not (eq 0 (string-match paragraph-start |
312 |
(backward-char 1) |
(backward-char 1) |
313 |
(or (looking-at "[([{,A+,b+(B]") |
(or (looking-at "[([{,A+,b+(B]") |
314 |
;; Don't cut right after a single-letter word. |
;; Don't cut right after a single-letter word. |
315 |
(and (memq (preceding-char) '(?\t ?\ )) |
(and (memq (preceding-char) '(?\t ?\s)) |
316 |
(eq (char-syntax (following-char)) ?w))))))) |
(eq (char-syntax (following-char)) ?w))))))) |
317 |
|
|
318 |
(defcustom fill-nobreak-predicate nil |
(defcustom fill-nobreak-predicate nil |
439 |
(sentence-end-without-space-list |
(sentence-end-without-space-list |
440 |
(string-to-list sentence-end-without-space))) |
(string-to-list sentence-end-without-space))) |
441 |
(while (re-search-forward eol-double-space-re to t) |
(while (re-search-forward eol-double-space-re to t) |
442 |
(or (>= (point) to) (memq (char-before) '(?\t ?\ )) |
(or (>= (point) to) (memq (char-before) '(?\t ?\s)) |
443 |
(memq (char-after (match-beginning 0)) |
(memq (char-after (match-beginning 0)) |
444 |
sentence-end-without-space-list) |
sentence-end-without-space-list) |
445 |
(insert-and-inherit ?\ )))) |
(insert-and-inherit ?\s)))) |
446 |
|
|
447 |
(goto-char from) |
(goto-char from) |
448 |
(if enable-multibyte-characters |
(if enable-multibyte-characters |
471 |
(goto-char from) |
(goto-char from) |
472 |
(skip-chars-forward " \t") |
(skip-chars-forward " \t") |
473 |
;; Then change all newlines to spaces. |
;; Then change all newlines to spaces. |
474 |
(subst-char-in-region from to ?\n ?\ ) |
(subst-char-in-region from to ?\n ?\s) |
475 |
(if (and nosqueeze (not (eq justify 'full))) |
(if (and nosqueeze (not (eq justify 'full))) |
476 |
nil |
nil |
477 |
(canonically-space-region (or squeeze-after (point)) to) |
(canonically-space-region (or squeeze-after (point)) to) |
830 |
(if has-code-and-comment |
(if has-code-and-comment |
831 |
(concat |
(concat |
832 |
(if (not indent-tabs-mode) |
(if (not indent-tabs-mode) |
833 |
(make-string (current-column) ?\ ) |
(make-string (current-column) ?\s) |
834 |
(concat |
(concat |
835 |
(make-string (/ (current-column) tab-width) ?\t) |
(make-string (/ (current-column) tab-width) ?\t) |
836 |
(make-string (% (current-column) tab-width) ?\ ))) |
(make-string (% (current-column) tab-width) ?\s))) |
837 |
(buffer-substring (point) comin)) |
(buffer-substring (point) comin)) |
838 |
(buffer-substring (line-beginning-position) comin)))) |
(buffer-substring (line-beginning-position) comin)))) |
839 |
beg end) |
beg end) |
1223 |
(while (> count 0) |
(while (> count 0) |
1224 |
(skip-chars-forward " ") |
(skip-chars-forward " ") |
1225 |
(insert-and-inherit |
(insert-and-inherit |
1226 |
(make-string (/ curr-fracspace nspaces) ?\ )) |
(make-string (/ curr-fracspace nspaces) ?\s)) |
1227 |
(search-forward " " nil t) |
(search-forward " " nil t) |
1228 |
(setq count (1- count) |
(setq count (1- count) |
1229 |
curr-fracspace |
curr-fracspace |
1282 |
|
|
1283 |
When calling from a program, pass range to fill as first two arguments. |
When calling from a program, pass range to fill as first two arguments. |
1284 |
|
|
1285 |
Optional third and fourth arguments JUSTIFY and MAIL-FLAG: |
Optional third and fourth arguments JUSTIFYP and CITATION-REGEXP: |
1286 |
JUSTIFY to justify paragraphs (prefix arg), |
JUSTIFYP to justify paragraphs (prefix arg). |
1287 |
When filling a mail message, pass a regexp for CITATION-REGEXP |
When filling a mail message, pass a regexp for CITATION-REGEXP |
1288 |
which will match the prefix of a line which is a citation marker |
which will match the prefix of a line which is a citation marker |
1289 |
plus whitespace, but no other kind of prefix. |
plus whitespace, but no other kind of prefix. |