aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-06-29 03:21:26 +0000
committerRichard M. Stallman1995-06-29 03:21:26 +0000
commit1e87252ca9504752162df693e84e9dc3b94fe3bb (patch)
tree80e878154950eee7b720ef03be20adc1e438cb62
parent8f066a20b28d51e2d1467ce59fdd9abe8fc95354 (diff)
downloademacs-1e87252ca9504752162df693e84e9dc3b94fe3bb.tar.gz
emacs-1e87252ca9504752162df693e84e9dc3b94fe3bb.zip
(current-fill-column): If fill-column is nil, return nil.
-rw-r--r--lisp/textmodes/fill.el31
1 files changed, 16 insertions, 15 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index ae3e136bca5..81791f0c506 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -72,21 +72,22 @@ subtracted from `fill-column'.
72The fill column to use for a line is the first column at which the column 72The fill column to use for a line is the first column at which the column
73number equals or exceeds the local fill-column - right-margin difference." 73number 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.