diff options
| -rw-r--r-- | lisp/textmodes/fill.el | 31 |
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'. | |||
| 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. |