Function: org-ascii--justify-lines

org-ascii--justify-lines is a byte-compiled function defined in ox-ascii.el.gz.

Signature

(org-ascii--justify-lines S TEXT-WIDTH HOW)

Documentation

Justify all lines in string S.

TEXT-WIDTH is an integer specifying maximum length of a line. HOW determines the type of justification: it can be left, right, full or center.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-ascii.el.gz
(defun org-ascii--justify-lines (s text-width how)
  "Justify all lines in string S.
TEXT-WIDTH is an integer specifying maximum length of a line.
HOW determines the type of justification: it can be `left',
`right', `full' or `center'."
  (with-temp-buffer
    (insert s)
    (goto-char (point-min))
    (let ((fill-column text-width)
          ;; Ensure that `indent-tabs-mode' is nil so that indentation
          ;; will always be achieved using spaces rather than tabs.
          (indent-tabs-mode nil)
	  ;; Disable `adaptive-fill-mode' so it doesn't prevent
	  ;; filling lines matching `adaptive-fill-regexp'.
	  (adaptive-fill-mode nil))
      (while (< (point) (point-max))
	(justify-current-line how)
	(forward-line)))
    (buffer-string)))