/[emacs]/emacs/lisp/textmodes/fill.el
ViewVC logotype

Diff of /emacs/lisp/textmodes/fill.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.180 by ttn, Sat Aug 6 17:41:14 2005 UTC revision 1.181 by lektu, Tue Aug 9 14:01:29 2005 UTC
# Line 163  Remove indentation from each line." Line 163  Remove indentation from each line."
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
# Line 282  act as a paragraph-separator." Line 282  act as a paragraph-separator."
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
# Line 312  places." Line 312  places."
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
# Line 439  Point is moved to just past the fill pre Line 439  Point is moved to just past the fill pre
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
# Line 471  Point is moved to just past the fill pre Line 471  Point is moved to just past the fill pre
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)
# Line 830  can take care of filling.  JUSTIFY is us Line 830  can take care of filling.  JUSTIFY is us
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)
# Line 1223  otherwise it is made canonical." Line 1223  otherwise it is made canonical."
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
# Line 1282  in the paragraph. Line 1282  in the paragraph.
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.

Legend:
Removed from v.1.180  
changed lines
  Added in v.1.181

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26