comparison lisp/textmodes/fill.el @ 12429:d6d785d96455

(current-fill-column): If fill-column is nil, return nil.
author Richard M. Stallman <rms@gnu.org>
date Thu, 29 Jun 1995 03:21:26 +0000
parents b0a7e8ff84ad
children 34e9427fe8f5
comparison
equal deleted inserted replaced
12428:e4c0623f4a2e 12429:d6d785d96455
70 subtracted from `fill-column'. 70 subtracted from `fill-column'.
71 71
72 The fill column to use for a line is the first column at which the column 72 The fill column to use for a line is the first column at which the column
73 number equals or exceeds the local fill-column - right-margin difference." 73 number equals or exceeds the local fill-column - right-margin difference."
74 (save-excursion 74 (save-excursion
75 (let* ((here (progn (beginning-of-line) (point))) 75 (if fill-column
76 (here-col 0) 76 (let* ((here (progn (beginning-of-line) (point)))
77 (eol (progn (end-of-line) (point))) 77 (here-col 0)
78 margin fill-col change col) 78 (eol (progn (end-of-line) (point)))
79 ;; Look separately at each region of line with a different right-margin 79 margin fill-col change col)
80 (while (and (setq margin (get-text-property here 'right-margin) 80 ;; Look separately at each region of line with a different right-margin.
81 fill-col (- fill-column (or margin 0)) 81 (while (and (setq margin (get-text-property here 'right-margin)
82 change (text-property-not-all here eol 82 fill-col (- fill-column (or margin 0))
83 'right-margin margin)) 83 change (text-property-not-all
84 (progn (goto-char (1- change)) 84 here eol 'right-margin margin))
85 (setq col (current-column)) 85 (progn (goto-char (1- change))
86 (< col fill-col))) 86 (setq col (current-column))
87 (setq here change 87 (< col fill-col)))
88 here-col col)) 88 (setq here change
89 (max here-col fill-col)))) 89 here-col col))
90 (max here-col fill-col)))))
90 91
91 (defun canonically-space-region (beg end) 92 (defun canonically-space-region (beg end)
92 "Remove extra spaces between words in region. 93 "Remove extra spaces between words in region.
93 Puts one space between words in region; two between sentences. 94 Puts one space between words in region; two between sentences.
94 Remove indenation from each line." 95 Remove indenation from each line."