Function: tpu-add-at-eol

tpu-add-at-eol is an interactive and byte-compiled function defined in tpu-edt.el.gz.

Signature

(tpu-add-at-eol TEXT)

Documentation

Add text to the end of each line in a region, or each line of the entire buffer if no region is selected.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/tpu-edt.el.gz
(defun tpu-add-at-eol (text)
  "Add text to the end of each line in a region,
or each line of the entire buffer if no region is selected."
  (interactive
   (list (tpu-string-prompt "String to add: " 'tpu-add-at-eol-hist)))
  (if (string= "" text) (tpu-error "No string specified."))
  (cond ((tpu-mark)
	 (save-excursion
	   (if (> (point) (tpu-mark)) (exchange-point-and-mark))
	   (while (< (point) (tpu-mark))
	     (end-of-line)
	     (if (<= (point) (tpu-mark)) (insert text))
	     (forward-line)))
	 (tpu-unselect t))
	(t
	 (save-excursion
	   (goto-char (point-min))
	   (while (not (eobp))
	     (end-of-line) (insert text) (forward-line))))))