;; Maintainer: FSF
;; Keywords: wp
+;; Package: emacs
;; This file is part of GNU Emacs.
number equals or exceeds the local fill-column - right-margin difference."
(save-excursion
(if fill-column
- (let* ((here (progn (beginning-of-line) (point)))
+ (let* ((here (line-beginning-position))
(here-col 0)
(eol (progn (end-of-line) (point)))
margin fill-col change col)
(if (and oneleft
(not (and use-hard-newlines
(get-text-property (1- (point)) 'hard))))
- (delete-backward-char 1)
+ (delete-char -1)
(backward-char 1)
(setq oneleft t)))
(setq to (copy-marker (point) t))
(skip-chars-backward " "))
(setq ncols (- fc endcol))
;; Ncols is number of additional space chars needed
- (if (and (> ncols 0) (> nspaces 0) (not eop))
- (progn
- (setq curr-fracspace (+ ncols (/ (1+ nspaces) 2))
- count nspaces)
- (while (> count 0)
- (skip-chars-forward " ")
- (insert-and-inherit
- (make-string (/ curr-fracspace nspaces) ?\s))
- (search-forward " " nil t)
- (setq count (1- count)
- curr-fracspace
- (+ (% curr-fracspace nspaces) ncols)))))))
+ (when (and (> ncols 0) (> nspaces 0) (not eop))
+ (setq curr-fracspace (+ ncols (/ nspaces 2))
+ count nspaces)
+ (while (> count 0)
+ (skip-chars-forward " ")
+ (insert-char ?\s (/ curr-fracspace nspaces) t)
+ (search-forward " " nil t)
+ (setq count (1- count)
+ curr-fracspace
+ (+ (% curr-fracspace nspaces) ncols))))))
(t (error "Unknown justification value"))))
(goto-char pos)
(move-marker pos nil)))
"")
string))
-;; arch-tag: 727ad455-1161-4fa9-8df5-0f74b179216d
;;; fill.el ends here