[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ASCII formatting for plain text email



Pierre Willaime <pierre.willaime@univ-lorraine.fr> writes:

> 1- a simple way to draw a line (without pressing 72 times on "-")
> -----------------------------------------------------------------------
>
> 2- a simple way to align some text to the right (that is to say to
> automatically calculate how many spaces are needed to fill the gap
> between the text on the left an the text on the right for 72 characters
> line.
>
> 3- a simple way to do boxes (no present in debian-annouce header)

Since you mentioned Emacs, I'd say artist-mode for the lines and
boxes. See the manual but mouse-2 for a menu where you can select, say,
a rectangle or line and mouse-1 to draw. Shift with those for straight
lines and squares.

   To right justtify a paragraph or region, well, I didn't find anything
               ready to go except the little function below. Works great
           though. Fill-column controls the right margin, default is 70.

(defun right-region (from to)
  "Right-justify each nonblank line starting in the region."
  (interactive "r")
  (if (> from to)
      (let ((tem to))
	(setq to from from tem)))
  (save-excursion
    (save-restriction
      (narrow-to-region from to)
      (goto-char from)
      (while (not (eobp))
	(or (save-excursion
	      (skip-chars-forward " \t") (eolp))
	    (justify-current-line 'right))
	(forward-line 1)))))

From
https://emacs.stackexchange.com/questions/3540/how-to-right-align-region-and-or-line


Reply to: